pyms.GCMS
¶
Module to handle raw data.
Class to model GC-MS data.
Classes:
|
Generic object for GC-MS data. |
Data:
-
class
GCMS_data
(time_list, scan_list)[source]¶ Bases:
pymsBaseClass
,TimeListMixin
,MaxMinMassMixin
,GetIndexTimeMixin
Generic object for GC-MS data.
Contains the raw data as a list of scans and a list of times.
- Parameters:
- Authors:
Qiao Wang, Andrew Isaac, Vladimir Likic, Dominic Davis-Foster (type assertions and properties)
Methods:
__eq__
(other)Return whether this GCMS_data object is equal to another object.
__len__
()Returns the length of the data object, defined as the number of scans.
__repr__
()Return a string representation of the
GCMS_data
.__str__
()Return
str(self)
.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 time at given index.
info
([print_scan_n])Prints some information about the data.
trim
([begin, end])Trims data in the time domain.
write
(file_root)Writes the entire raw data to two CSV files:
write_intensities_stream
(file_name)Loop over all scans and, for each scan, write the intensities to the given file, one intensity per line.
Attributes:
Returns the maximum m/z value in the spectrum.
Returns the maximum retention time for the data in seconds.
Returns the minimum m/z value in the spectrum.
Returns the minimum retention time for the data in seconds.
Return a list of the scan objects.
Returns the total ion chromatogram.
Return a copy of the time list.
Returns the time step of the data.
Returns the standard deviation of the time step of the data.
-
__eq__
(other)[source]¶ Return whether this GCMS_data object is equal to another object.
- Parameters:
other – The other object to test equality with.
- Return type:
-
__len__
()[source]¶ Returns the length of the data object, defined as the number of scans.
- Author:
Vladimir Likic
- 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
max_mass
¶ Returns the maximum m/z value in the spectrum.
-
property
min_mass
¶ Returns the minimum m/z value in the spectrum.
-
property
scan_list
¶ Return a list of the scan objects.
-
property
tic
¶ Returns the total ion chromatogram.
- Author:
Andrew Isaac
- Return type:
-
property
time_step_std
¶ Returns the standard deviation of the time step of the data.
- Return type:
-
trim
(begin=None, end=None)[source]¶ Trims data in the time domain.
The arguments
begin
andend
can be either integers (in which case they are taken as the first/last scan number for trimming) or strings in which case they are treated as time strings and converted to scan numbers.At present both
begin
andend
must be of the same type, either both scan numbers or time strings.At least one of
begin
andend
is required.
-
write
(file_root)[source]¶ Writes the entire raw data to two CSV files:
<file_root>.I.csv
, containing the intensities; and<file_root>.mz.csv
, containing the corresponding m/z values.
In general these are not two-dimensional matrices, because different scans may have different numbers of m/z values recorded.
pyms.GCMS.Function
¶
Provides conversion and information functions for GC-MS data objects.
Functions:
|
Compares two GCMS_data objects. |
|
Converts the window selection parameter into points based on the time step in an ion chromatogram. |
-
ic_window_points
(ic, window_sele, half_window=False)[source]¶ Converts the window selection parameter into points based on the time step in an ion chromatogram.
- Parameters:
ic (
IonChromatogram
) – ion chromatogram object relevant for the conversionwindow_sele (
Union
[int
,str
]) – The window selection parameter. This can be an integer or time string. If an integer, taken as the number of points. If a string, must of the form'<NUMBER>s'
or'<NUMBER>m'
, specifying a time in seconds or minutes, respectivelyhalf_window (
bool
) – Specifies whether to return half-window. DefaultFalse
.
- Author:
Vladimir Likic
- Return type:
pyms.GCMS.IO
¶
Input/output functions for GC-MS data files.
pyms.GCMS.IO.ANDI
¶
Functions for reading ANDI-MS data files.
Functions:
|
A reader for ANDI-MS NetCDF files. |
pyms.GCMS.IO.JCAMP
¶
Functions for I/O of data in JCAMP-DX format.
Functions:
|
Generic reader for JCAMP DX files. |
pyms.GCMS.IO.MZML
¶
Functions for reading mzML format data files.
Functions:
|
A reader for mzML files. |