stereo.algorithm.score_genes.ScoreGenes.main¶
- ScoreGenes.main(genes_used, ctrl_as_ref=True, ctrl_size=50, genes_reference=None, n_bins=25, random_state=0, use_raw=None, res_key='score')[source]¶
Score a set of genes for each cell/bin.
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
genes_referencefor each binned expression value.- Parameters:
genes_used (
Union[ndarray,List[str],Tuple[str]]) – The list of gene names used for score calculation.ctrl_as_ref (
bool) – Allow to use the control genes as reference, defaults to Truectrl_size (
int) – Number of reference genes to be sampled from each bin, defaults to 50, you can setctrl_size=len(genes_used)if the length ofgenes_usedis not too short.genes_reference (
Union[ndarray,List[str],Tuple[str],None]) – Genes for sampling the reference set, default is all genes.n_bins (
int) – Number of expression level bins for sampling, defaults to 25random_state (
Union[int,RandomState,None]) – The random seed for sampling, defaults to 0, fixed value to fixed result.use_raw (
Optional[bool]) – Whether to use thedata.raw, defaults toTrueifdata.rawis notNoneres_key (
str) – the column name of the result to be added indata.cells, defaults to “score”