rapids_singlecell.tl.score_genes#
- rapids_singlecell.tl.score_genes(adata, gene_list, *, ctrl_as_ref=True (settings.preset='scanpy-v1' – changes in 2.0), ctrl_size=50, gene_pool=None, n_bins=25, use=None, out=False, rng=None, score_name=None, copy=False, use_raw=None, layer=None)[source]#
Score a set of genes [SFG+15, TIP+16].
The score is the average expression of a set of genes subtracted with the average expression of a reference set of genes. The reference set is randomly sampled from the
gene_poolfor each binned expression value.- Parameters:
- adata
AnnData The annotated data matrix.
- gene_list
Sequence[str] |Index The list of gene names used for score calculation.
- ctrl_as_ref
bool|Default(default:True (settings.preset='scanpy-v1' – changes in 2.0)) Allow the algorithm to use the control genes as reference. Will be changed to
Falsein scanpy 2.0.- ctrl_size
int(default:50) Number of reference genes to be sampled from each bin. If
len(gene_list)is not too low, you can setctrl_size=len(gene_list).- gene_pool
Sequence[str] |Index|None(default:None) Genes for sampling the reference set. Default is all genes.
- n_bins
int(default:25) Number of expression level bins for sampling.
- use
LayerAcc|str|None(default:None) Which matrix to score, e.g.
A.XorA.layers['counts']. Strings are resolved byanndata.acc.AdAcc.resolve(), e.g.'layers.counts'.- out
AdRef|str|bool(default:False) Where to write the scores, e.g.
A.obs['k'](or'obs.k'). IfTrue, the scores are returned instead of written. IfFalse, they are written to.obs['score'].- rng
int|integer|Sequence[int] |SeedSequence|Generator|BitGenerator|None(default:None) Random seed or
Generatorfor sampling. The supersededrandom_stateargument is still accepted.- use_raw
bool|None(default:None) Deprecated since version 0.19.0:
rawis deprecated. Keep the data in a layer instead.Whether to use
rawattribute ofadata. Defaults toTrueif.rawis present and neitherusenorlayeris given.
- adata
- Return type:
- Returns:
The scores as a
Seriesifout=True, elseNone. By default setsadata.obs['score'](seeout).