.infer_proteoform_groups
- proteopy.tl.infer_proteoform_groups(adata, method='copf', *, batch_key=None, min_score=0.1, min_adj_pval=0.1, inplace=True, verbose=False)[source]
Infer proteoform groups from peptide-level data.
A wrapper around the currently recommended proteoform inference approach in ProteoPy.
Warning
This is a dynamic function. The default
methodpoints to the approach the ProteoPy developers currently recommend and may change in future releases as better approaches become available, which would change the results of calls that rely on the default. For reproducible analyses, always passmethodexplicitly, e.g.method="copf".Available methods:
"copf"(current default)COPF, COrrelation based functional ProteoForm assessment [1]. Equivalent to running:
pr.tl.pairwise_peptide_correlations( adata, batch_key=batch_key, ) pr.tl.peptide_dendograms_by_correlation( adata, method="agglomerative-hierarchical-clustering", ) pr.tl.peptide_clusters_from_dendograms( adata, n_clusters=2, min_peptides_per_cluster=2, ) pr.tl.proteoform_scores( adata, min_score=min_score, min_pval_adj=min_adj_pval, )
Call these functions individually for finer control over each step.
- Parameters:
adata (AnnData) – Peptide-level
AnnDatawith.varcolumnspeptide_idandprotein_id.method (str) – Proteoform inference method. One of
"copf". The default tracks the currently recommended method and may change; pass it explicitly for reproducibility.batch_key (str | None) –
.obscolumn defining batches. For"copf", peptide correlations are computed per batch and pooled across batches (seepairwise_peptide_correlations()). IfNone, all observations are treated as a single batch.min_score (float) – Minimum proteoform score for a protein to be called as having proteoforms (see
proteoform_scores()).min_adj_pval (float) – Maximum Benjamini-Hochberg adjusted p-value for a protein to be called as having proteoforms.
inplace (bool) – If True, modify
adatain place; else return a modified copy.verbose (bool) – If True, print status messages about each step.
- Returns:
Noneifinplace=True, else a modified copy ofadata. For"copf", the following are written:.uns['pairwise_peptide_correlations'](and.uns['pairwise_peptide_correlations_by_batch']ifbatch_keyis given).uns['dendograms']and.uns['clusters'].varcolumnscluster_id,proteoform_id,proteoform_score,proteoform_score_z,proteoform_score_dz,proteoform_score_pval,proteoform_score_pval_adjandis_proteoform
- Return type:
AnnData | None
Examples
>>> import proteopy as pr >>> pr.tl.infer_proteoform_groups( ... adata, ... method="copf", ... batch_key="multiplex_batch", ... min_score=0.1, ... min_adj_pval=0.1, ... ) >>> adata.var.loc[adata.var["is_proteoform"] == 1, "protein_id"]
References