Analyzes metabolic pathway heterogeneity within cell populations by calculating normalized enrichment scores (NES) for each pathway across different groups...
Analyzes metabolic pathway heterogeneity within cell populations by calculating normalized enrichment scores (NES) for each pathway across different groups. Quantifies metabolic diversity and identifies pathways with variable activity patterns. Uses principal component analysis and GSEA to assess pathway heterogeneity, revealing subpopulation-specific metabolic states and transitions.
MetabolicPathwayHeterogeneity is part of the ScrnaMetabolicLandscape group. Enable it by enabling the group:
[ScrnaMetabolicLandscape]
cache = true
MetabolicPathwayHeterogeneity receives input automatically from MetabolicInput (or MetabolicExprImputation if imputation enabled):
[ScrnaMetabolicLandscape.in]
srtobj = ["SeuratClustering"] # Input from upstream clustering process
All configuration is done at the ScrnaMetabolicLandscape group level:
[ScrnaMetabolicLandscape.envs]
# Core configuration (inherited by all metabolic processes)
gmtfile = "KEGG_2021_Human" # Metabolic pathways database
group_by = "seurat_clusters" # Column to group cells (e.g., "cluster")
subset_by = "treatment" # Optional: Subset by metadata column
ncores = 1 # Number of cores for parallelization
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
# Principal component selection for heterogeneity analysis
select_pcs = 0.8 # Fraction or number of PCs to use (0-1 = fraction, >1 = number)
# Pathway significance filtering
pathway_pval_cutoff = 0.01 # P-value cutoff to select enriched pathways
# Parallelization
ncores = 1 # Cores for parallel processing (inherited from group if not set)
# fgsea parameters
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
scoreType = "std" # Options: "std", "pos", "neg"
nproc = 1 # fgsea internal parallelization
minSize = 15 # Minimum pathway size
maxSize = 500 # Maximum pathway size
# Plots configuration
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.plots]
"Pathway Heterogeneity" = {
plot_type = "dot", # Options: dot, heatmap
devpars = { res = 100 } # Plot resolution
}
# Multiple analysis cases (advanced)
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.cases]
"Treatment" = {
subset_by = "treatment",
group_by = "seurat_clusters",
select_pcs = 0.8,
pathway_pval_cutoff = 0.01
}
select_pcs)select_pcs)| Value | Interpretation | Use Case |
|---|---|---|
| 0.8 (default) | Use PCs explaining 80% variance | Balanced approach |
| 0.5 | Use PCs explaining 50% variance | Focus on major variation sources |
| 0.95 | Use PCs explaining 95% variance | Comprehensive analysis (slower) |
| 5 (integer) | Use exactly 5 PCs | Manual control |
| 10 | Use exactly 10 PCs | Fine-grained heterogeneity |
Recommendation: Start with 0.8 (default), increase to 0.9-0.95 if you suspect hidden heterogeneity.
pathway_pval_cutoff = 0.01 # Only pathways with p < 0.01 are analyzed
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
scoreType = "std" # Options: "std", "pos", "neg"
| Score Type | Description | Use Case |
|---|---|---|
| std | Standard GSEA (both directions) | Default; detects heterogeneity in both high/low activity |
| pos | Only positive enrichment | Focus on pathways with increased activity variation |
| neg | Only negative enrichment | Focus on pathways with decreased activity variation |
The gmtfile parameter accepts:
"KEGG_2021_Human", "Reactome_Pathways_2024", "BioCarta_2016", "MSigDB_Hallmark_2020"/skills/processes/metabolicinput.md for detailed database options[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.in]
srtobj = ["SeuratClustering"]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
group_by = "seurat_clusters"
ncores = 8
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.95 # Capture 95% of variance
pathway_pval_cutoff = 0.01 # Significant pathways only
ncores = 8
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
scoreType = "std"
nproc = 8
minSize = 10
maxSize = 500
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "Reactome_Pathways_2024"
group_by = "seurat_clusters"
subset_by = "treatment" # Compare heterogeneity between treatments
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.8
pathway_pval_cutoff = 0.05 # More permissive for exploratory analysis
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.plots]
"Treatment Heterogeneity" = {
plot_type = "dot",
devpars = { width = 1200, height = 800, res = 150 }
}
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 10 # Use exactly 10 PCs
pathway_pval_cutoff = 0.01
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.plots]
"Pathway Heterogeneity" = {
plot_type = "dot",
devpars = { width = 1600, height = 1200, res = 300 }
}
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
ncores = 8
# Case 1: Overall cluster heterogeneity
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.cases.Clusters]
group_by = "seurat_clusters"
select_pcs = 0.8
pathway_pval_cutoff = 0.01
plots = {
"Cluster Heterogeneity" = { plot_type = "dot", devpars = { res = 150 } }
}
# Case 2: Treatment-specific heterogeneity
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.cases.Treatment]
subset_by = "treatment"
group_by = "seurat_clusters"
select_pcs = 0.9
pathway_pval_cutoff = 0.01
plots = {
"Treatment Heterogeneity" = { plot_type = "dot", devpars = { res = 150 } }
}
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.5 # Only major variance (50%)
pathway_pval_cutoff = 0.001 # Very strict significance
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
scoreType = "std"
minSize = 20 # Larger pathways only
maxSize = 300
Assess metabolic variability across clusters:
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.8
pathway_pval_cutoff = 0.01
Compare heterogeneity between responders and non-responders:
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "Reactome_Pathways_2024"
subset_by = "response" # "responder" vs "nonresponder"
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.85
pathway_pval_cutoff = 0.01
Analyze heterogeneity changes over time:
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
subset_by = "timepoint" # e.g., "day0", "day7", "day14"
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.9 # Comprehensive to detect gradual changes
pathway_pval_cutoff = 0.01
Analyze heterogeneity in glycolysis and OXPHOS:
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "/data/pathways/energy_metabolism.gmt" # Custom GMT
group_by = "seurat_clusters"
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.8
pathway_pval_cutoff = 0.05 # More permissive for focused analysis
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
minSize = 5 # Allow smaller custom pathways
Large dataset with many groups:
[ScrnaMetabolicLandscape]
[ScrnaMetabolicLandscape.envs]
gmtfile = "KEGG_2021_Human"
group_by = "seurat_clusters"
ncores = 16
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.8
ncores = 16
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
nproc = 1 # Parallelize at group level, not within fgsea
MetabolicInput (part of ScrnaMetabolicLandscape group)MetabolicExprImputation (if imputation enabled with noimpute = false)CombinedInput ā requires SeuratClustering or similar clustering processMetabolicPathwayActivity and MetabolicFeatures (same group)group_by (e.g., cluster assignments)subset_by for subset analysisMetabolicPathwayHeterogeneity generates the following outputs in the outdir directory (default: {{in.sobjfile | stem}}.pathwayhetero):
gmtfile must be a valid enrichit database name OR accessible GMT filegroup_by column must exist in Seurat object metadatasubset_by specified, column must exist and NA values will be removedselect_pcs: If 0 < value <= 1, interpreted as fraction; if > 1, interpreted as numberpathway_pval_cutoff: Must be between 0 and 1 (typically 0.001-0.1)ncores: Must be positive integergroup_by for heterogeneity analysisscoreType must be one of: "std", "pos", "neg"minSize < maxSizeminSize >= 1Cause: Groups have similar metabolic profiles or insufficient variance Solution:
# Increase PC capture
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.95 # Capture more variance
# Relax pathway significance
pathway_pval_cutoff = 0.05
# Check if groups are truly different
# May need to refine group_by or subset_by columns
Cause: High select_pcs or insufficient parallelization
Solution:
# Reduce PCs
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 0.7 # Use fewer PCs
# Increase parallelization
ncores = 8
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
nproc = 8
Cause: pathway_pval_cutoff too strict or weak biological signal
Solution:
# Relax cutoff
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
pathway_pval_cutoff = 0.05 # Increase from 0.01
# Or reduce pathway size filters
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.fgsea_args]
minSize = 10
maxSize = 800
Cause: Too many pathways or groups Solution:
# Reduce number of PCs
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
select_pcs = 5 # Use fixed small number
# Or filter pathways more aggressively
pathway_pval_cutoff = 0.001
# Reduce parallelization
ncores = 2
Cause: Inappropriate PC selection or wrong grouping variable Solution:
# Try different PC thresholds
select_pcs = 0.8 # Default
# vs
select_pcs = 10 # Fixed number
# Verify grouping variable is biologically meaningful
group_by = "refined_clusters" # More biologically relevant than raw seurat_clusters
# Check if subset_by is creating meaningful comparisons
subset_by = "cell_type" # More specific than "treatment"
Cause: Too many significant pathways Solution:
# Stricter filtering
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs]
pathway_pval_cutoff = 0.001 # Very strict
# Or use custom GMT with fewer pathways
[ScrnaMetabolicLandscape.envs]
gmtfile = "/data/pathways/core_metabolism.gmt"
# Increase plot size
[ScrnaMetabolicLandscape.MetabolicPathwayHeterogeneity.envs.plots]
"Pathway Heterogeneity" = {
plot_type = "dot",
devpars = { width = 2000, height = 1500, res = 150 }
}
Cause: GMT file gene names don't match Seurat object Solution:
name\tdescription\tgene1\tgene2\tgene3Cause: Only 1-2 groups in group_by column
Solution:
# Use different grouping variable with more groups
[ScrnaMetabolicLandscape.envs]
group_by = "seurat_clusters" # Should have >2 clusters
# Or add subset_by to create comparisons
subset_by = "treatment" # Creates multiple group sets
Cause: Pathways have little variation across groups Solution:
group_by variableMetabolic landscape methodology:
PCA (Principal Component Analysis):
GSEA (Gene Set Enrichment Analysis):
fgsea (Fast GSEA):
/skills/processes/metabolicinput.md/skills/processes/scrnametaboliclandscape.md - Full metabolic analysis group/skills/processes/metabolicinput.md - Input preparation and GMT databases/skills/processes/metabolicpathwayactivity.md - Pathway activity scoring (AUCell-based)/skills/processes/metabolicfeatures.md - Pathway enrichment analysis (FGSEA-based)Start: MetabolicPathwayHeterogeneity
ā
āā Do groups show obvious metabolic differences?
ā āā YES ā Use default settings (select_pcs = 0.8)
ā āā NO ā Increase PC capture (select_pcs = 0.95)
ā
āā How many groups in analysis?
ā āā 2-5 groups ā Use select_pcs = 0.8 (major variance)
ā āā 6-10 groups ā Use select_pcs = 0.85 (balanced)
ā āā >10 groups ā Use select_pcs = 0.9 (comprehensive)
ā
āā Exploratory vs confirmatory analysis?
ā āā Exploratory ā pathway_pval_cutoff = 0.05 (permissive)
ā āā Confirmatory ā pathway_pval_cutoff = 0.01 (default)
ā
āā Computational resources available?
āā Limited ā select_pcs = 0.7, ncores = 2
āā Moderate ā select_pcs = 0.8, ncores = 4
āā Abundant ā select_pcs = 0.95, ncores = 16
When using multiple cases (e.g., treatment vs control):