Skip to content

plot like spottedpy #51

@worker000000

Description

@worker000000

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

  1. Function signature: What are the parameters for calculate_module_scores?

  2. 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?
  3. 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?
  4. 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?
  5. Relationship to other functions: How does this relate to other Hotspot functions like compute_modules() or compute_autocorrelations()?

6 can hotspot plot like spottedpy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions