BaseParquetReader

class pyprophet.io._base.BaseParquetReader(config: BaseIOConfig)[source]

Bases: BaseReader

Class for reading and processing data from OpenSWATH results stored in Parquet format.

The ParquetReader class provides methods to read different levels of data from the file and process it accordingly. It supports reading data for semi-supervised learning, IPF analysis, context level analysis.

This assumes that the input file contains precursor and transition data.

infile

Input file path.

Type:

str

outfile

Output file path.

Type:

str

classifier

Classifier used for semi-supervised learning.

Type:

str

level

Level used in semi-supervised learning (e.g., ‘ms1’, ‘ms2’, ‘ms1ms2’, ‘transition’, ‘alignment’), or context level used peptide/protein/gene inference (e.g., ‘global’, ‘experiment-wide’, ‘run-specific’).

Type:

str

glyco

Flag indicating whether analysis is glycoform-specific.

Type:

bool

read()[source]

Read data from the input file based on the alogorithm.

__eq__(other)

Return self==value.

__hash__ = None
__init__(config: BaseIOConfig)[source]

Initialize the reader with a given configuration.

Parameters:

config (BaseIOConfig) – Configuration object containing input details, and module specific config for params for reading.

__repr__()

Return repr(self).

_collapse_ipf_peptide_ids(df)[source]

Collapse IPF peptide IDs to avoid duplicating feature data in the DataFrame.

Parameters: - df (DataFrame): Input DataFrame containing feature data.

Returns: - DataFrame: DataFrame with collapsed IPF peptide IDs.

_collapse_protein_ids(df)[source]

Collapse protein IDs to avoid duplicating feature data in the DataFrame.

Parameters: - df (DataFrame): Input DataFrame containing feature data.

Returns: - DataFrame: DataFrame with collapsed protein IDs.

Example: df = _collapse_protein_ids(df)

read() DataFrame[source]

Abstract method to be implemented by subclasses to read data from Parquet format for a specific algorithm.