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 .txt signature format, dispatched by the .txt extension) 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] when use_raw=True (since the matrix is aligned to adata.raw.var_names, not adata.var_names), otherwise to adata.varm[varm_key].

Return type:

None

Returns:

None A genes by signatures dataframe of +1 / -1 / 0 values is created or overwritten in place under varm_key, aligned to genes from adata (or adata.raw when use_raw=True).