scviva.tools.harreman.hotspot.calculate_super_module_scores#

scviva.tools.harreman.hotspot.calculate_super_module_scores(adata, super_module_dict=None, device='auto', verbose=False)[source]#

Calculate super-module scores for gene super-modules across cells.

Parameters:
adata AnnData

Annotated data object (AnnData). Required fields in adata.uns: - ‘layer_key’: name of the layer from which to extract the expression matrix - ‘model’: statistical model used to normalize expression (e.g., ‘DANB’, ‘normal’) - ‘umi_counts’: total UMI counts per cell - ‘gene_modules’: dictionary mapping module IDs (as strings) to lists of gene names

super_module_dict dict

Dictionary with super-module IDs (integers) as keys and lists of associated modules (as integers) as values.

device device | str

Device to use for computation (e.g., CUDA or CPU). Defaults to GPU if available.

verbose bool | None

Whether to print progress and status messages.

Return type:

None

Returns:

None The following results are stored in the AnnData object:

  • adata.obsm['super_module_scores']: (cells x super-modules) DataFrame with per-cell super-module activity scores

  • adata.varm['gene_loadings_sm']: (genes x super-modules) DataFrame with gene loadings for each super-module

  • adata.uns['gene_modules_sm']: dictionary mapping super-module names to gene lists