pyms.Gapfill
¶
Gap Filling Routines.
pyms.Gapfill.Class
¶
Provides a class for handling Missing Peaks in an output file (i.e. area.csv
).
Classes:
|
Class to encapsulate a peak object identified as missing in the output area matrix fom PyMassSpec. |
|
A collection of MissingPeak objects. |
-
class
MissingPeak
(common_ion, qual_ion_1, qual_ion_2, rt=0.0)[source]¶ Bases:
object
Class to encapsulate a peak object identified as missing in the output area matrix fom PyMassSpec.
- Parameters:
- Authors:
Jairus Bowne, Sean O’Callaghan, Dominic Davis-Foster
Attributes:
Returns the common ion for the peak object across an experiment.
The area of the common ion
The retention time of the apex of the peak
Returns the top (most abundant) ion for the peak object.
Returns the second most abundant ion for the peak object.
Returns the retention time of the peak.
-
property
common_ion
¶ Returns the common ion for the peak object across an experiment.
- Return type:
- Returns:
Common ion for the peak
- Author:
Jairus Bowne
-
property
qual_ion1
¶ Returns the top (most abundant) ion for the peak object.
- Return type:
- Returns:
Most abundant ion
- Author:
Jairus Bowne
-
property
qual_ion2
¶ Returns the second most abundant ion for the peak object.
- Return type:
- Returns:
Second most abundant ion
- Author:
Jairus Bowne
-
class
Sample
(sample_name, matrix_position)[source]¶ Bases:
object
A collection of MissingPeak objects.
- Parameters:
- Authors:
Sean O’Callaghan, Dominic Davis-Foster (properties)
Methods:
add_missing_peak
(missing_peak)Add a new MissingPeak object to the Sample.
Returns a dictionary containing
average_rt : exact_rt
pairs.Attributes:
Returns a list of the MissingPeak objects in the Sample object.
Returns name of the sample.
Returns a dictionary containing
rt : area
pairs.-
add_missing_peak
(missing_peak)[source]¶ Add a new MissingPeak object to the Sample.
- Parameters:
missing_peak (
MissingPeak
) – The missing peak object to be added.
-
property
missing_peaks
¶ Returns a list of the MissingPeak objects in the Sample object.
- Return type:
pyms.Gapfill.Function
¶
Functions to fill missing peak objects.
Classes:
|
Flag to indicate the filetype for |
Functions:
|
Convert a .csv file to a pandas DataFrame. |
|
Integrates raw data around missing peak locations to fill |
|
Finds the |
|
Creates a new |
|
Creates a new rt.csv file, replacing |
-
enum
MissingPeakFiletype
(value)[source]¶ Bases:
IntEnum
Flag to indicate the filetype for
pyms.Gapfill.Function.missing_peak_finder()
.New in version 2.3.0.
- Member Type:
Valid values are as follows:
-
MZML
= <MissingPeakFiletype.MZML: 1>¶
-
NETCDF
= <MissingPeakFiletype.NETCDF: 2>¶
-
file2dataframe
(file_name)[source]¶ Convert a .csv file to a pandas DataFrame.
- Parameters:
- Authors:
Jairus Bowne, Sean O’Callaghan, Dominic Davis-Foster (pathlib support)
New in version 2.3.0.
- Return type:
-
missing_peak_finder
(sample, file_name, points=3, null_ions=None, crop_ions=None, threshold=1000, rt_window=1, filetype=MissingPeakFiletype.MZML)[source]¶ Integrates raw data around missing peak locations to fill
NA
s in the data matrix.- Parameters:
sample (
Sample
) – The sample object containing missing peaksfile_name (
str
) – Name of the raw data filepoints (
int
) – Peak finding - Peak if maxima over ‘points’ number of scans. Default3
.null_ions (
Optional
[List
]) – Ions to be deleted in the matrix. Default[73, 147]
.crop_ions (
Optional
[List
]) – Range of Ions to be considered. Default[50, 540]
.threshold (
int
) – Minimum intensity of IonChromatogram allowable to fill. Default1000
.rt_window (
float
) – Window in seconds around average RT to look for. Default1
.filetype (
MissingPeakFiletype
) – Default<MissingPeakFiletype.MZML: 1>
.
- Author:
Sean O’Callaghan
-
mp_finder
(input_matrix)[source]¶ Finds the
'NA'
s in the transformedarea_ci.csv
file and makespyms.Gapfill.Class.Sample
objects with them
-
write_filled_csv
(sample_list, area_file, filled_area_file)[source]¶ Creates a new
area_ci.csv
file, replacing NAs with values from the sample_list objects where possible.