.long
- proteopy.read.long(intensities, *, level=None, sep=None, sample_annotation=None, var_annotation=None, fill_na=None, column_map=None, sort_obs_by_annotation=False)[source]
Read long-format peptide or protein files into an AnnData container.
- Parameters:
intensities (str | Path | pd.DataFrame) – Long-form intensities data. Accepts a file path (str or Path) or a pandas DataFrame. When a file path is provided, the separator is auto-detected from the extension (.csv -> ‘,’, .tsv -> ‘t’) unless sep is explicitly specified.
level ({"peptide", "protein"}, default None) – Select whether to process peptide- or protein-level inputs. This argument is required.
sep (str, optional) – Delimiter passed to pandas.read_csv. If None (the default), the separator is auto-detected from the file extension. Ignored when input is a DataFrame.
sample_annotation (str | Path | pd.DataFrame, optional) – Optional obs annotations. Accepts a file path or DataFrame.
var_annotation (str | Path | pd.DataFrame, optional) – Optional var annotations merged into
adata.var. Accepts a file path or DataFrame. Interpreted as peptide annotations whenlevel="peptide"and as protein annotations whenlevel="protein".fill_na (float, optional) – Optional replacement value for missing intensity entries.
column_map (dict, optional) – Optional mapping that specifies custom column names for the expected keys: peptide_id, protein_id, sample_id, intensity.
sort_obs_by_annotation (bool, default False) – When True, reorder observations to match the order of samples in the annotation (if supplied) or the original intensity table.
- Returns:
Structured representation of the long-form intensities ready for downstream analysis.
- Return type:
AnnData