harreman.hotspot.calculate_super_module_scores#
- harreman.hotspot.calculate_super_module_scores(adata, super_module_dict=None, device=device(type='cpu'), 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 containing super-module IDs (integers) as keys and a list of associated modules (as integers) as values
device (torch.device, optional) – Device to use for computation (e.g., CUDA or CPU). Defaults to GPU if available.
verbose (bool, optional (default: False)) – Whether to print progress and status messages.
- Returns:
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
- Return type:
None