Overview
TheComprehensivePipeline class provides an end-to-end analysis workflow that combines basic clustering, communication analysis, and multi-chamber analysis into a single unified pipeline. This is the recommended pipeline for complete cardiac tissue characterization.
Inheritance: BasePipeline
Source: heartmap.pipelines.ComprehensivePipeline (src/heartmap/pipelines/init.py:370)
Constructor
Configuration object containing all analysis parameters including resolution for clustering.
Attributes
Inherited fromBasePipeline:
config(Config): Configuration objectdata_processor(DataProcessor): Data processing handlervisualizer(Visualizer): Visualization handlerexporter(ResultsExporter): Results export handlerresults(Dict[str, Any]): Dictionary storing pipeline results
Methods
run()
Run the comprehensive HeartMAP analysis pipeline from raw data to final results.Path to raw single-cell data file (10X format or similar).
Directory to save all results, visualizations, and comprehensive report. If None, results are returned but not saved.
Dictionary containing comprehensive pipeline results:
Fully annotated data object with all analysis results stored in
.obs, .obsm, and .unsComprehensive analysis results organized by module
Cell type annotation results
Array of cluster assignments for each cell (from Leiden clustering)
Cell-cell communication analysis results
Hub scores for each cell (index matches adata.obs.index)
Multi-chamber analysis results (chamber markers, correlations, etc.)
ImportError: If required dependencies (scanpy, pandas, numpy, matplotlib) are not available
- Data Loading and Processing - Loads and preprocesses raw data using
DataProcessor.process_from_raw() - Neighborhood Graph - Computes PCA (40 components) and k-nearest neighbors (k=15)
- Dimensionality Reduction - Calculates UMAP for visualization
- Cell Clustering - Performs Leiden clustering using the resolution from config
- Communication Analysis - Calculates hub scores and communication patterns
- Multi-Chamber Analysis - Identifies chamber-specific patterns
- Comprehensive Visualization - Generates integrated dashboard with all visualizations
- Report Generation - Creates comprehensive HTML/PDF report with all findings
save_results()
Inherited fromBasePipeline. Save pipeline results to disk.
Directory path where results will be saved
Usage Example
Output Files
Whenoutput_dir is specified, the pipeline generates:
Data Files
heartmap_complete.h5ad- Fully annotated AnnData object with all results- Results exported via
ResultsExporter
Visualizations
figures/comprehensive_dashboard.png- Integrated multi-panel dashboardfigures/umap_clusters.png- UMAP colored by clusterfigures/qc_*.png- Quality control metricsfigures/communication_*.png- Communication analysis plotsfigures/chamber_*.png- Multi-chamber analysis plots
Reports
- Comprehensive HTML/PDF report generated by
ResultsExporter.generate_comprehensive_report()
Comparison with Other Pipelines
| Feature | BasicPipeline | AdvancedCommunicationPipeline | MultiChamberPipeline | ComprehensivePipeline |
|---|---|---|---|---|
| Input | Raw data | Annotated data | H5AD file | Raw data |
| Clustering | ✓ | - | - | ✓ |
| Communication | - | ✓ | - | ✓ |
| Multi-chamber | - | - | ✓ | ✓ |
| Dashboard | - | - | - | ✓ |
| Report | - | - | - | ✓ |
Best Practices
- Use for complete analysis: The
ComprehensivePipelineis ideal when you want all analyses in one workflow - Check output_dir size: Comprehensive analysis generates many files; ensure adequate disk space
- Review configuration: All config parameters affect the comprehensive analysis
- Inspect the dashboard: The comprehensive dashboard provides an overview of all results
- Read the report: The generated report summarizes all findings with interpretations
Related Documentation
BasicPipeline
Basic clustering component of comprehensive analysis
AdvancedCommunicationPipeline
Communication analysis component
MultiChamberPipeline
Multi-chamber analysis component
Config
Configuration object reference
Complete Analysis Guide
Detailed guide on running comprehensive analysis