pygecko.parsers package
Submodules
pygecko.parsers.agilent_fid_parser module
- class pygecko.parsers.agilent_fid_parser.Agilent_FID_Parser
Bases:
objectA class wrapping functions to parse raw data from an Agilent GC/FID into FID_Sequence objects.
- classmethod load_injection(raw_directory: str, solvent_delay: float | int) FID_Injection
Returns an FID_Injection object.
- Parameters:
raw_directory (str) – Path to the directory containing the corresponding xy-file and the acaml-file.
solvent_delay (float) – Retention time of the solvent peak in minutes.
- Returns:
An FID_Injection object.
- Return type:
- classmethod load_ri_calibration(raw_directory: str, solvent_delay, c_count: int, rt: float) RI_Calibration
Returns an RI_Calibration object.
- Parameters:
raw_directory (str) – Path to the directory containing the corresponding xy-file and the acaml-file.
solvent_delay (float) – Retention time of the solvent peak in minutes.
c_count (int) – Carbon count of the alkane the retention time is provided for.
rt (float) – Retention time of the alkane the c_count is provided for.
- Returns:
An RI_Calibration object.
- Return type:
- classmethod load_sequence(raw_directory: str, solvent_delay: float | int, pos: bool = False) FID_Sequence
Returns an FID_Sequence object.
- Parameters:
raw_directory (str) – Path to the directory containing the corresponding xy-files and the acaml-file.
solvent_delay (float) – Retention time of the solvent peak in minutes.
pos (bool, optional) – Indicates if plate position is given in the injection names. Defaults to False.
- Returns:
An FID_Sequence object
- Return type:
pygecko.parsers.agilent_ms_parser module
- class pygecko.parsers.agilent_ms_parser.Agilent_MS_Parser
Bases:
objectA class wrapping functions to parse raw data from an Agilent GC/MS into MS_Sequence objects.
- classmethod load_injection(raw_directory: str) MS_Injection
Returns an MS_Injection object.
- Parameters:
raw_directory (str) – Path to the directory containing the raw data.
- Returns:
An MS_Injection object
- Return type:
- classmethod load_ri_calibration(raw_directory: str, c_count: int, rt: float) RI_Calibration
Returns an RI_Calibration object.
- Parameters:
raw_directory (str) – Path to the directory containing the raw data.
c_count (int) – Number of carbon atoms for as specific alkane present in the standard.
rt (float) – Retention time of the alkane the c_count is provided for.
- Returns:
An RI_Calibration object
- Return type:
- classmethod load_sequence(sequence_directory: str, pos: bool = False) MS_Sequence
Returns an MS_Sequence object.
- Parameters:
sequence_directory (str) – Path to the directory containing the raw data.
chrom_path (str) – Path to the directory containing the chromatograms.
pos (bool, optional) – Indicates if plate position is given in the injection names. Defaults to False.
- Returns:
An MS_Sequence object
- Return type:
pygecko.parsers.fid_base_parser module
- class pygecko.parsers.fid_base_parser.FID_Base_Parser
Bases:
object- static load_injection(xy_file: Path | str, solvent_delay: float, pos: bool = False) FID_Injection
Returns an FID_Injection object.
- Parameters:
xy_file (Path|str) – Path to a xy_file.
solvent_delay (float) – Solvent delay of the injection.
- Returns:
An FID_Injection object.
- Return type:
- static load_ri_calibration(xy_file: Path | str, solvent_delay, c_count: int, rt: float) RI_Calibration
Returns an RI_Calibration object.
- Parameters:
xy_file (Path|str) – Path to a xy_file.
solvent_delay (float) – Solvent delay of the injection.
c_count (int) – Carbon count of the alkane the retention time is provided for.
rt (float) – Retention time of the alkane the c_count is provided for.
- Returns:
An RI_Calibration object.
- Return type:
- static load_sequence(xy_directory: Path | str, solvent_delay: float, pos: bool = False) FID_Sequence
Returns an FID_Sequence object.
- Parameters:
xy_directory (Path|str) – Path to a directory containing xy-files.
solvent_delay (float) – Solvent delay of the injections.
- Returns:
An FID_Sequence object.
- Return type:
- static read_xy_array(path: Path) ndarray | None
Takes in the path to a xy-file, returns the xy_array.
pygecko.parsers.file_readers module
- pygecko.parsers.file_readers.extract_scans_from_mzml(mzml_file: ~pathlib.Path) -> (<class 'pandas.core.frame.DataFrame'>, <class 'str'>)
Takes in the path to a mzml file containing the scans of an injection, returns a DataFrame containing the scans and the sample name.
- Parameters:
mzml_file (Path) – Path to the mzml file.
- Returns:
DataFrame containing the scans and the sample name.
- Return type:
tuple[pd.DataFrame, str]
- pygecko.parsers.file_readers.extract_scans_from_mzxml(mzxml_file: Path) DataFrame
Takes in the path to a mzxml file containing the scans of an injection, returns a DataFrame containing the scans and the sample name.
- Parameters:
mzxml_file (Path) – Path to the mzxml file.
- Returns:
DataFrame containing the scans and the sample name.
- Return type:
tuple[pd.DataFrame, str]
pygecko.parsers.ms_base_parser module
- class pygecko.parsers.ms_base_parser.MS_Base_Parser
Bases:
object- static extract_scans_from_raw_data(raw_path: ~pathlib.Path, temp_dir: ~tempfile.TemporaryDirectory | None = None) -> (<class 'pandas.core.frame.DataFrame'>, <class 'str'>)
Takes in the path to a raw file containing the scans of an injection, returns a DataFrame containing the scans and the injection’s sample name.
- static initialize_injection(path: Path, pos: bool = False, temp_dir: TemporaryDirectory | None = None) MS_Injection
Returns an MS_Injection object.
- Parameters:
path (Path) – Path to the raw directory.
- Returns:
An MS_Injection object
- Return type:
- static load_injection(raw_data_path: str | Path, pos: bool = False, temp_dir: TemporaryDirectory | None = None) MS_Injection
Returns an MS_Injection object.
- Parameters:
raw_data_path (str) – Path to the raw data.
temp_dir (tempfile.TemporaryDirectory) – Temporary directory to store the converted mzML file. Defaults to None.
- Returns:
An MS_Injection object
- Return type:
- static load_ri_calibration(raw_data_path: str, c_count: int, rt: float) RI_Calibration
Returns an RI_Calibration object.
- Parameters:
raw_directory (str) – Path to the directory containing the raw data.
c_count (int) – Number of carbon atoms for as specific alkane present in the standard.
rt (float) – Retention time of the alkane the c_count is provided for.
- Returns:
An RI_Calibration object
- Return type:
- static load_sequence(raw_directory: Path | str, pos: bool = False) MS_Sequence
Returns an MS_Sequence object.
- Parameters:
raw_directory (Path|str) – Path to a directory containing raw data.
- Returns:
An MS_Sequence object.
- Return type:
pygecko.parsers.msconvert_wraper module
- pygecko.parsers.msconvert_wraper.msconvert(input_files: list | str, output_dir, format='mzML')
Takes in a list of input filenames and the output directory, converts the input files to the specified format and saves them in the output directory.
- Parameters:
input_files (list|str) – Input filename or list of input filenames.
output_dir (str) – Path to the output directory.
format (str) – Output format. Default: ‘mzML’.
pygecko.parsers.utilities module
- class pygecko.parsers.utilities.HiddenPrints
Bases:
object
- pygecko.parsers.utilities.find_directories_with_extension(directory_path, extension)
- pygecko.parsers.utilities.list_files_and_directories(directory_path)