scviva.tools.vision.load_signatures#
- scviva.tools.vision.load_signatures(adata, use_raw=False, gmt_files=None, dicts=None, min_signature_genes=5, sig_gene_threshold=0.001, varm_key='signatures')[source]#
Compute signature scores from .gmt/.txt files or dictionaries.
- Parameters:
- adata
AnnData AnnData object to compute signatures for.
- use_raw
bool Whether to use adata.raw.X for signature computation.
- gmt_files
Sequence[str] |None List of .gmt files (or R VISION’s tab-delimited
.txtsignature format, dispatched by the.txtextension) to use for signature computation.- dicts
Sequence[dict] |None List of dictionaries to use for signature computation.
- min_signature_genes
int Minimum number of genes that must match the dataset for a signature to be kept. Mirrors R VISION’s
min_signature_genes(default 5).- sig_gene_threshold
float Genes expressed in fewer than this fraction of cells are excluded from signatures. Mirrors R VISION’s
sig_gene_threshold(default 0.001).- varm_key
str Key to store the resulting gene x signature matrix under. Written to
adata.raw.varm[varm_key]whenuse_raw=True(since the matrix is aligned toadata.raw.var_names, notadata.var_names), otherwise toadata.varm[varm_key].
- adata
- Return type:
- Returns:
None A genes by signatures dataframe of +1 / -1 / 0 values is created or overwritten in place under
varm_key, aligned to genes fromadata(oradata.rawwhenuse_raw=True).