.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) –
AnnDatawith COPF score annotations in.var.adj (bool) – Use adjusted
proteoform_score_pval_adjvalues whenTrue.pval_threshold (float | int | None) – Maximum p-value used to highlight points.
Nonedisables filtering by p-value.score_threshold (float | int | None) – Minimum proteoform score used to highlight points.
Nonedisables 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
.varwhose values are used as display labels instead ofprotein_id. 1-to-1 mapping betweenprotein_idandprotein_id_keyis enforced.highlight_prots (list[str] | None) – Protein IDs to highlight with text labels on the scatter plot. When
protein_id_keyis set, values must come from theprotein_id_keycolumn.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()whenTrue.save (str | Path | None) – File path to save the figure.
Noneskips 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:
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, ... )