How to use calculate_module_scores function in Hotspot library?
Question
Hi Hotspot team,
I'm working with spatial transcriptomics data and noticed there's a calculate_module_scores function in the Hotspot library source code. However, I couldn't find clear documentation or examples on how to use this function with gene sets.
What I'm trying to achieve
I want to calculate module/pathway scores for specific gene sets (like EMT, hypoxia, immune signatures) in my spatial transcriptomics data, and then identify hotspots based on these module scores.
Current understanding
I know the basic Hotspot workflow:
import hotspot
hs = hotspot.Hotspot(adata)
hs.create_knn_graph(weighted_graph=False, n_neighbors=30)
hs_results = hs.compute_autocorrelations(jobs=1)
But I'm interested in using calculate_module_scores for gene set analysis.
Specific questions
-
Function signature: What are the parameters for calculate_module_scores?
-
Input format: How should gene sets be provided?
# Option 1: Dictionary format?
gene_sets = {
'EMT': ['VIM', 'CDH2', 'SNAI1', 'SNAI2', 'TWIST1'],
'Hypoxia': ['HIF1A', 'VEGFA', 'PDK1', 'LDHA'],
'Immune': ['CD68', 'CD163', 'CSF1R', 'PTPRC']
}
# Option 2: DataFrame format?
# Option 3: GMT file format?
-
Integration with Hotspot analysis:
- Does
calculate_module_scores return scores that can be used with compute_autocorrelations()?
- Do I need to add the scores back to the AnnData object?
-
Usage example: Could you provide a minimal working example?
import hotspot
# How to use calculate_module_scores?
hs = hotspot.Hotspot(adata)
module_scores = hs.calculate_module_scores(???) # What goes here?
# Then how to proceed with hotspot analysis?
-
Relationship to other functions: How does this relate to other Hotspot functions like compute_modules() or compute_autocorrelations()?
6 can hotspot plot like spottedpy
How to use
calculate_module_scoresfunction in Hotspot library?Question
Hi Hotspot team,
I'm working with spatial transcriptomics data and noticed there's a
calculate_module_scoresfunction in the Hotspot library source code. However, I couldn't find clear documentation or examples on how to use this function with gene sets.What I'm trying to achieve
I want to calculate module/pathway scores for specific gene sets (like EMT, hypoxia, immune signatures) in my spatial transcriptomics data, and then identify hotspots based on these module scores.
Current understanding
I know the basic Hotspot workflow:
But I'm interested in using
calculate_module_scoresfor gene set analysis.Specific questions
Function signature: What are the parameters for
calculate_module_scores?Input format: How should gene sets be provided?
Integration with Hotspot analysis:
calculate_module_scoresreturn scores that can be used withcompute_autocorrelations()?Usage example: Could you provide a minimal working example?
Relationship to other functions: How does this relate to other Hotspot functions like
compute_modules()orcompute_autocorrelations()?6 can hotspot plot like spottedpy