alphapepttools.io.AnnDataFactory#
- class alphapepttools.io.AnnDataFactory(psm_df, intensity_column, sample_id_column, feature_id_column)#
Factory class to convert AlphaBase PSM DataFrames to AnnData format.
Methods table#
|
Create AnnData object from PSM DataFrame. |
|
Create AnnDataFactory from PSM files. |
Methods#
- AnnDataFactory.create_anndata(var_columns=None, obs_columns=None)#
Create AnnData object from PSM DataFrame.
- Parameters:
- Return type:
- Returns:
ad.AnnData AnnData object where: - obs (rows) are raw names - var (columns) are proteins - X contains intensity values
- classmethod AnnDataFactory.from_files(file_paths, reader_type='maxquant', level='proteins', *, intensity_column=None, feature_id_column=None, sample_id_column=None, additional_columns=None, **reader_kwargs)#
Create AnnDataFactory from PSM files.
- Parameters:
reader_type (str, optional) – Type of PSM reader to use, by default “maxquant”
level (str, optional) – Level of quantification to read. One of “proteins”, “precursors”, or “genes”. Defaults to “proteins”.
intensity_column (str, optional) – Name of the column storing intensity data. Default is taken from
psm_reader.yamlfeature_id_column (str, optional) – Name of the column storing feature ids. Default is taken from
psm_reader.yamlsample_id_column (str, optional) – Name of the column storing sample ids. Default is taken from
psm_reader.yamladditional_columns (list[str], optional) – Names of additional columns from the PSM table to retain for experiment-specific metadata. These columns can be added to the resulting AnnData object as annotations. Note that if a column has a higher cardinality than the
feature_id_column(i.e., multiple values per feature), only the first value encountered will be kept.**reader_kwargs – Additional arguments passed to PSM reader
- Return type:
- Returns:
AnnDataFactory Initialized AnnDataFactory instance