.proteoform_scores

proteopy.pl.proteoform_scores(adata, *, adj=True, pval_threshold=None, score_threshold=None, log_scores=False, protein_id_key=None, highlight_prots=None, protein_label_fontsize=8, protein_label_color='black', show=True, save=None, ax=None)[source]

Scatter plot of COPF proteoform scores vs. p-values.

Parameters:
  • adata (AnnData) – AnnData with COPF score annotations in .var.

  • adj (bool) – Use adjusted proteoform_score_pval_adj values when True.

  • pval_threshold (float | int | None) – Maximum p-value used to highlight points. None disables filtering by p-value.

  • score_threshold (float | int | None) – Minimum proteoform score used to highlight points. None disables score-based filtering.

  • log_scores (bool) – Plot p-values on a log-scaled y-axis when True; otherwise use a linear scale.

  • protein_id_key (str | None) – Column in .var whose values are used as display labels instead of protein_id. 1-to-1 mapping between protein_id and protein_id_key is enforced.

  • highlight_prots (list[str] | None) – Protein IDs to highlight with text labels on the scatter plot. When protein_id_key is set, values must come from the protein_id_key column.

  • protein_label_fontsize (int | float) – Font size for the highlight labels.

  • protein_label_color (str) – Color for the highlight labels and connector lines.

  • show (bool) – Call matplotlib.pyplot.show() when True.

  • save (str | Path | None) – File path to save the figure. None skips saving.

  • ax (matplotlib.axes.Axes | None) – Matplotlib Axes object to plot onto. If None, a new figure and axes are created.

Returns:

The Axes object used for plotting.

Return type:

matplotlib.axes.Axes

Examples

Basic scatter plot of proteoform scores:

>>> import proteopy as pr
>>> adata = pr.read.long(...)
>>> pr.tl.pairwise_peptide_correlations(adata)
>>> 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_pval_adj=0.4)
>>> pr.pl.proteoform_scores(adata)

Highlight specific proteins by protein_id:

>>> pr.pl.proteoform_scores(
...     adata,
...     highlight_prots=["P12345", "Q67890"],
... )

Highlight proteins using an alternative label column:

>>> pr.pl.proteoform_scores(
...     adata,
...     protein_id_key="gene_name",
...     highlight_prots=["GAPDH", "ACTB"],
...     protein_label_color="red",
...     protein_label_fontsize=10,
... )