How costalab/pilot works
PILOT is a Python toolkit for patient-level analysis of single-cell and pathomics data. Its principal workflow extracts sample and cell/structure information, computes sample-to-sample Wasserstein distances with optimal transport, then supports sample-level trajectory or subgroup analysis. Interpretation capabilities include identifying cell- and gene-level changes, differential expression, and plots. Source excerpts show the main analysis modules and plotting imports; broader workflow links are based on the README, so unsampled implementation details are not inferred.
Main entry points: Trajectory.py Sample trajectories · pl.py Plotting API · Cell_gene_selection.py Cell and gene selection · patients_sub_clustering.py Patient subgroups
Components 16
Sample analysis
- Data extraction
pilotpy/tools/Trajectory.py - OT distances
pilotpy/tools/Trajectory.py - Sample trajectories
pilotpy/tools/Trajectory.py - Patient subgroups
pilotpy/tools/patients_sub_clustering.py
Biological interpretation
- Cell and gene selection
pilotpy/tools/Cell_gene_selection.py - Cluster differentiation
pilotpy/tools/Gene_cluster_specific.py - Expression models
pilotpy/tools/Gene_cluster_specific_functions.py - Pseudobulk DE
pilotpy/plot/pseudobulk_DE_analysis.py
Plots and reports
- Trajectory plots
pilotpy/plot/ploting.py - Gene analysis plots
pilotpy/plot/gene_selection_analysis.py - Curve metrics
pilotpy/plot/curve_activity.py - DE and enrichment plots
pilotpy/plot/pseudobulk_DE_analysis.py
Python API
- Analysis API
pilotpy/tl.py - Plotting API
pilotpy/pl.py
Other components
- Researcher
- Annotated data
Connections 19
- Researcher → Annotated data: provides
README.md - Researcher → Analysis API: runs analysis
README.md - Analysis API → Data extraction: exposes tools
pilotpy/tl.py - Annotated data → Data extraction: supplies input
- Data extraction → OT distances: prepares samples
pilotpy/tools/Trajectory.py - OT distances → Sample trajectories: supports analysis
README.md - OT distances → Patient subgroups: supports analysis
README.md - Sample trajectories → Cell and gene selection: interprets changes
README.md - Patient subgroups → Cell and gene selection: ranks features
README.md - Sample trajectories → Cluster differentiation: compares clusters
pilotpy/tools/Trajectory.py - Cluster differentiation → Expression models: fits models
pilotpy/tools/Gene_cluster_specific.py - Sample trajectories → Pseudobulk DE: enables DE
README.md - Plotting API → Trajectory plots: exposes plots
pilotpy/pl.py - Plotting API → Gene analysis plots: exposes plots
pilotpy/pl.py - Plotting API → Curve metrics: exposes metrics
- Plotting API → DE and enrichment plots: exposes reports
- Sample trajectories → Trajectory plots: visualizes results
pilotpy/tools/Trajectory.py - Cell and gene selection → Gene analysis plots: visualizes results
- Pseudobulk DE → DE and enrichment plots: produces results
pilotpy/plot/pseudobulk_DE_analysis.py