.is_proteodata
- proteopy.utils.is_proteodata(adata, *, raise_error=False, layers=None)[source]
Check whether the AnnData object stores peptide- or protein-level proteomics data.
- Parameters:
adata (
AnnData) – AnnData object whose .var annotations will be inspected.raise_error (
bool) – If True, raise a ValueError for proteomics-specific validation failures instead of returning False.layers (
str|list[str] |None) – Optional layer key or list of layer keys inadata.layersto validate. Each specified layer matrix is checked for infinite values, the same way.Xis checked.
- Returns:
(True, "peptide")if the data satisfy the peptide-level assumptions,(True, "protein")if they satisfy the protein-level assumptions, otherwise(False, None)whenraise_erroris False.- Return type:
Notes
Peptide-level data must provide both
.var["peptide_id"]and.var["protein_id"]. Everypeptide_idvalue must be unique, and the column must matchadata.var_names(and the.varindex) exactly. Each peptide must map to exactly oneprotein_id. Neither column may contain missing values.Protein-level data must provide
.var["protein_id"], must not contain apeptide_idcolumn, and theprotein_idvalues must matchadata.var_names(and the.varindex) exactly while also being unique. The column must not contain missing values.Set
raise_error=Trueto raise a ValueError instead of returning False when the proteomics-specific validation fails.