Tools: tl#
This module provides various tools for analyzing proteomics data.
Clustering#
Automated sweep to pick a Leiden resolution that keeps mitochondria intact. |
|
Run Markov Clustering (MCL) on the neighbour graph. |
|
Quantify interfacialness of proteins across compartment boundaries. |
|
Per-group silhouette scores. |
|
Calinski–Harabasz score of cluster compactness vs separation. |
|
QSep cluster-separation metric for spatial proteomics. |
|
Train a TAGM-MAP (T-Augmented Gaussian Mixture, MAP variant) model. |
|
Predict sub-cellular localization for unlabelled proteins using a fitted TAGM-MAP model. |
|
F1 score. |
|
Return a balanced subset with equally sized clusters. |
Cluster Merging#
Consolidate overclustered Leiden solutions using PAGA connectivity and ontology enrichment.
Iteratively merge overclustered Leiden clusters using PAGA and GO enrichment. |
|
Iteratively merge small clusters into their most-connected neighbor. |
|
Build a dendrogram from PAGA connectivity and store it in |
|
Return all candidate merge pairs from the dendrogram, expanding ties. |
Semi-supervised Localization#
Propagate mutually exclusive labels (markers) along the k-NN graph, or train a classifier on them.
Propagate categorical annotations along the k-NN graph. |
|
Deprecated alias for |
|
Soft, uncertainty-aware version of the cluster-annotation pipeline. |
|
Resolve soft propagated probabilities into single / multi / unresolved labels. |
|
Train SVM classifier with hyperparameter tuning using marker proteins. |
|
Classify proteins using SVM with marker-based training. |
Ontology-aware Annotation#
Propagate overlapping / hierarchical labels (GO-CC, UniProt-SL) one-vs-rest, which yields per-term membership probabilities rather than a simplex.
Annotate a map with overlapping / hierarchical labels by one-vs-rest diffusion. |
|
(Re)resolve stored diffusion probabilities into a per-protein label, in place. |
Ontology Enrichment#
Gene-set enrichment for each cluster. |
|
Turn a per-cluster enrichment table into soft label distributions. |
Model-based Gene Set Analysis#
MGSA explains an observed protein set with a sparse set of ontology terms, rather than testing each term independently.
Run model-based gene set analysis. |
|
Model-based gene-set analysis (MGSA) per cluster. |
|
Convert a per-cluster MGSA posterior matrix into a soft-label distribution. |
|
Container for MGSA posterior summaries and diagnostics. |
|
Resolve a gene-set source into a |
C-COMPASS#
Neural-network compartment prediction, provided by the optional ccompass extra
(pip install grassp[ccompass]).
Predict compartment class contributions with the C-COMPASS neural network. |
|
Return (and optionally save) the default C-COMPASS hyperparameters used by |
Integration#
Return copies of several |
|
Aligned UMAP embedding for matched datasets. |
|
Compute per-protein remodeling score from two aligned datasets. |
|
M/R score for detecting protein translocation. |
Graph analysis#
Convert the k-NN graph stored in |
|
Return the set of closest neighbours for a node in a graph. |