.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 method points 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 pass method explicitly, 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 AnnData with .var columns peptide_id and protein_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) – .obs column defining batches. For "copf", peptide correlations are computed per batch and pooled across batches (see pairwise_peptide_correlations()). If None, 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 adata in place; else return a modified copy.

  • verbose (bool) – If True, print status messages about each step.

Returns:

None if inplace=True, else a modified copy of adata. For "copf", the following are written:

  • .uns['pairwise_peptide_correlations'] (and .uns['pairwise_peptide_correlations_by_batch'] if batch_key is given)

  • .uns['dendograms'] and .uns['clusters']

  • .var columns cluster_id, proteoform_id, proteoform_score, proteoform_score_z, proteoform_score_dz, proteoform_score_pval, proteoform_score_pval_adj and is_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