pyms.IonChromatogram
¶
Classes to model a GC-MS Ion Chromatogram.
Classes:
|
Models a base peak chromatogram (BPC). |
|
Models an extracted ion chromatogram (EIC). |
|
Models an ion chromatogram. |
-
class
BasePeakChromatogram
(intensity_list, time_list)[source]¶ Bases:
IonChromatogram
Models a base peak chromatogram (BPC).
An ion chromatogram is a set of intensities as a function of retention time. This can can be either m/z channel intensities (for example, ion chromatograms at
m/z = 65
), or cumulative intensities over all measured m/z. In the latter case the ion chromatogram is total ion chromatogram (TIC).- Parameters:
- Authors:
Lewis Lee, Vladimir Likic, Dominic Davis-Foster (type assertions and properties)
New in version 2.3.0.
Methods:
__copy__
()Returns a new IonChromatogram containing a copy of the data in this object.
__eq__
(other)Return whether this IonChromatogram object is equal to another object.
__len__
()Returns the length of the IonChromatogram object.
__sub__
(other)Subtracts another IC from the current one (in place).
dump
(file_name[, protocol])Dumps an object to a file through
pickle.dump()
.get_index_at_time
(time)Returns the nearest index corresponding to the given time.
Returns the intensity at the given index.
Returns time at given index.
is_bpc
()Returns whether the ion chromatogram is a base peak chromatogram (BPC).
is_eic
()Returns whether the ion chromatogram is an extracted ion chromatogram (EIC).
is_tic
()Returns whether the ion chromatogram is a total ion chromatogram (TIC) or extracted ion chromatogram (EIC).
write
(file_name[, minutes, formatting])Writes the ion chromatogram to the specified file.
Attributes:
Returns a copy of the intensity array.
Returns a copy of the intensity array as a list of lists of floats.
Returns a copy of the intensity matrix.
Returns the m/z channel of the IC.
Returns the intensity matrix as a list of lists of floats.
Returns a copy of the time list.
Returns the time step.
-
__copy__
()¶ Returns a new IonChromatogram containing a copy of the data in this object.
- Return type:
-
__eq__
(other)¶ Return whether this IonChromatogram object is equal to another object.
-
__len__
()¶ Returns the length of the IonChromatogram object.
- Authors:
Lewis Lee, Vladimir Likic
- Return type:
-
__sub__
(other)¶ Subtracts another IC from the current one (in place).
- Parameters:
other (
IonChromatogram
) – Another IC- Return type:
-
dump
(file_name, protocol=3)¶ Dumps an object to a file through
pickle.dump()
.
-
get_index_at_time
(time)¶ Returns the nearest index corresponding to the given time.
- Parameters:
time (
float
) – Time in seconds- Return type:
- Returns:
Nearest index corresponding to given time
- Authors:
Lewis Lee, Tim Erwin, Vladimir Likic
Changed in version 2.3.0: Now returns
-1
if no index is found.
-
get_intensity_at_index
(ix)¶ Returns the intensity at the given index.
-
get_time_at_index
(ix)¶ Returns time at given index.
-
property
intensity_array
¶ Returns a copy of the intensity array.
- Return type:
- Returns:
Matrix of intensity values.
- Authors:
Andrew Isaac, Lewis Lee
-
property
intensity_array_list
¶ Returns a copy of the intensity array as a list of lists of floats.
-
property
intensity_matrix
¶ Returns a copy of the intensity matrix.
- Return type:
- Returns:
Matrix of intensity values.
- Author:
Andrew Isaac
-
static
is_bpc
()[source]¶ Returns whether the ion chromatogram is a base peak chromatogram (BPC).
- Return type:
-
static
is_eic
()¶ Returns whether the ion chromatogram is an extracted ion chromatogram (EIC).
New in version 2.3.0.
- Return type:
-
is_tic
()¶ Returns whether the ion chromatogram is a total ion chromatogram (TIC) or extracted ion chromatogram (EIC).
- Authors:
Lewis Lee, Vladimir Likic
- Return type:
-
property
mass
¶ Returns the m/z channel of the IC.
-
property
matrix_list
¶ Returns the intensity matrix as a list of lists of floats.
- Return type:
- Returns:
Matrix of intensity values
- Author:
Andrew Isaac
-
property
time_list
¶ Returns a copy of the time list.
-
write
(file_name, minutes=False, formatting=True)¶ Writes the ion chromatogram to the specified file.
- Parameters:
- Authors:
Lewis Lee, Vladimir Likic, Dominic Davis-Foster (pathlib support)
-
class
ExtractedIonChromatogram
(intensity_list, time_list, masses)[source]¶ Bases:
IonChromatogram
Models an extracted ion chromatogram (EIC).
An ion chromatogram is a set of intensities as a function of retention time. This can can be either m/z channel intensities (for example, ion chromatograms at
m/z = 65
), or cumulative intensities over all measured m/z. In the latter case the ion chromatogram is total ion chromatogram (TIC).- Parameters:
- Authors:
Lewis Lee, Vladimir Likic, Dominic Davis-Foster (type assertions and properties)
New in version 2.3.0.
Methods:
__copy__
()Returns a new IonChromatogram containing a copy of the data in this object.
__eq__
(other)Return whether this IonChromatogram object is equal to another object.
__len__
()Returns the length of the IonChromatogram object.
__sub__
(other)Subtracts another IC from the current one (in place).
dump
(file_name[, protocol])Dumps an object to a file through
pickle.dump()
.get_index_at_time
(time)Returns the nearest index corresponding to the given time.
Returns the intensity at the given index.
Returns time at given index.
is_bpc
()Returns whether the ion chromatogram is a base peak chromatogram (BPC).
is_eic
()Returns whether the ion chromatogram is an extracted ion chromatogram (EIC).
is_tic
()Returns whether the ion chromatogram is a total ion chromatogram (TIC) or extracted ion chromatogram (EIC).
write
(file_name[, minutes, formatting])Writes the ion chromatogram to the specified file.
Attributes:
Returns a copy of the intensity array.
Returns a copy of the intensity array as a list of lists of floats.
Returns a copy of the intensity matrix.
Returns the m/z channel of the IC.
List of extracted masses in the EIC.
Returns the intensity matrix as a list of lists of floats.
Returns a copy of the time list.
Returns the time step.
-
__copy__
()¶ Returns a new IonChromatogram containing a copy of the data in this object.
- Return type:
-
__eq__
(other)¶ Return whether this IonChromatogram object is equal to another object.
-
__len__
()¶ Returns the length of the IonChromatogram object.
- Authors:
Lewis Lee, Vladimir Likic
- Return type:
-
__sub__
(other)¶ Subtracts another IC from the current one (in place).
- Parameters:
other (
IonChromatogram
) – Another IC- Return type:
-
dump
(file_name, protocol=3)¶ Dumps an object to a file through
pickle.dump()
.
-
get_index_at_time
(time)¶ Returns the nearest index corresponding to the given time.
- Parameters:
time (
float
) – Time in seconds- Return type:
- Returns:
Nearest index corresponding to given time
- Authors:
Lewis Lee, Tim Erwin, Vladimir Likic
Changed in version 2.3.0: Now returns
-1
if no index is found.
-
get_intensity_at_index
(ix)¶ Returns the intensity at the given index.
-
get_time_at_index
(ix)¶ Returns time at given index.
-
property
intensity_array
¶ Returns a copy of the intensity array.
- Return type:
- Returns:
Matrix of intensity values.
- Authors:
Andrew Isaac, Lewis Lee
-
property
intensity_array_list
¶ Returns a copy of the intensity array as a list of lists of floats.
-
property
intensity_matrix
¶ Returns a copy of the intensity matrix.
- Return type:
- Returns:
Matrix of intensity values.
- Author:
Andrew Isaac
-
static
is_bpc
()¶ Returns whether the ion chromatogram is a base peak chromatogram (BPC).
New in version 2.3.0.
- Return type:
-
static
is_eic
()[source]¶ Returns whether the ion chromatogram is an extracted ion chromatogram (EIC).
- Return type:
-
is_tic
()¶ Returns whether the ion chromatogram is a total ion chromatogram (TIC) or extracted ion chromatogram (EIC).
- Authors:
Lewis Lee, Vladimir Likic
- Return type:
-
property
mass
¶ Returns the m/z channel of the IC.
-
property
matrix_list
¶ Returns the intensity matrix as a list of lists of floats.
- Return type:
- Returns:
Matrix of intensity values
- Author:
Andrew Isaac
-
property
time_list
¶ Returns a copy of the time list.
-
write
(file_name, minutes=False, formatting=True)¶ Writes the ion chromatogram to the specified file.
- Parameters:
- Authors:
Lewis Lee, Vladimir Likic, Dominic Davis-Foster (pathlib support)
-
class
IonChromatogram
(intensity_list, time_list, mass=None)[source]¶ Bases:
pymsBaseClass
,TimeListMixin
,IntensityArrayMixin
,GetIndexTimeMixin
Models an ion chromatogram.
An ion chromatogram is a set of intensities as a function of retention time. This can can be either m/z channel intensities (for example, ion chromatograms at
m/z = 65
), or cumulative intensities over all measured m/z. In the latter case the ion chromatogram is total ion chromatogram (TIC).The nature of an IonChromatogram object can be revealed by inspecting the value of the attribute ‘mass’. This is set to the m/z value of the ion chromatogram, or to
None
for TIC.- Parameters:
- Authors:
Lewis Lee, Vladimir Likic, Dominic Davis-Foster (type assertions and properties)
Changed in version 2.3.0: The
ia
parameter was renamed tointensity_list
.Methods:
__copy__
()Returns a new IonChromatogram containing a copy of the data in this object.
__eq__
(other)Return whether this IonChromatogram object is equal to another object.
__len__
()Returns the length of the IonChromatogram object.
__sub__
(other)Subtracts another IC from the current one (in place).
dump
(file_name[, protocol])Dumps an object to a file through
pickle.dump()
.get_index_at_time
(time)Returns the nearest index corresponding to the given time.
Returns the intensity at the given index.
Returns time at given index.
is_bpc
()Returns whether the ion chromatogram is a base peak chromatogram (BPC).
is_eic
()Returns whether the ion chromatogram is an extracted ion chromatogram (EIC).
is_tic
()Returns whether the ion chromatogram is a total ion chromatogram (TIC) or extracted ion chromatogram (EIC).
write
(file_name[, minutes, formatting])Writes the ion chromatogram to the specified file.
Attributes:
Returns a copy of the intensity array.
Returns a copy of the intensity array as a list of lists of floats.
Returns a copy of the intensity matrix.
Returns the m/z channel of the IC.
Returns the intensity matrix as a list of lists of floats.
Returns a copy of the time list.
Returns the time step.
-
__copy__
()[source]¶ Returns a new IonChromatogram containing a copy of the data in this object.
- Return type:
-
__len__
()[source]¶ Returns the length of the IonChromatogram object.
- Authors:
Lewis Lee, Vladimir Likic
- Return type:
-
__sub__
(other)[source]¶ Subtracts another IC from the current one (in place).
- Parameters:
other (
IonChromatogram
) – Another IC- Return type:
-
dump
(file_name, protocol=3)¶ Dumps an object to a file through
pickle.dump()
.
-
get_index_at_time
(time)¶ Returns the nearest index corresponding to the given time.
- Parameters:
time (
float
) – Time in seconds- Return type:
- Returns:
Nearest index corresponding to given time
- Authors:
Lewis Lee, Tim Erwin, Vladimir Likic
Changed in version 2.3.0: Now returns
-1
if no index is found.
-
get_time_at_index
(ix)¶ Returns time at given index.
-
property
intensity_array
¶ Returns a copy of the intensity array.
- Return type:
- Returns:
Matrix of intensity values.
- Authors:
Andrew Isaac, Lewis Lee
-
property
intensity_array_list
¶ Returns a copy of the intensity array as a list of lists of floats.
-
property
intensity_matrix
¶ Returns a copy of the intensity matrix.
- Return type:
- Returns:
Matrix of intensity values.
- Author:
Andrew Isaac
-
static
is_bpc
()[source]¶ Returns whether the ion chromatogram is a base peak chromatogram (BPC).
New in version 2.3.0.
- Return type:
-
static
is_eic
()[source]¶ Returns whether the ion chromatogram is an extracted ion chromatogram (EIC).
New in version 2.3.0.
- Return type:
-
is_tic
()[source]¶ Returns whether the ion chromatogram is a total ion chromatogram (TIC) or extracted ion chromatogram (EIC).
- Authors:
Lewis Lee, Vladimir Likic
- Return type:
-
property
mass
¶ Returns the m/z channel of the IC.
-
property
matrix_list
¶ Returns the intensity matrix as a list of lists of floats.
- Return type:
- Returns:
Matrix of intensity values
- Author:
Andrew Isaac
-
property
time_list
¶ Returns a copy of the time list.