Tools
Calculate basic cell statistics of selected regions.
Percentage cells in each region
scselpy.tl.cells_per_cluster(adata,obs_inp)
Calculates the percentage of cells in each selected region.
adata:
Annotated data matrix. AnnData obs_inp:
Keys for annotations of observations/cells from str AnnData. Percentage cells expressing a certain gene
scselpy.tl.cells_expressing_gene(adata,obs_inp,gene,which_var="var_names")
Calculates the percentage of cells expressing a certain gene.
adata:
Annotated data matrix. AnnData obs_inp:
Keys for annotations of observations/cells from str AnnData. gene:
The gene name that should be used for the calculation. str which_var:
Key in the str (default: 'var_names') Anndata variable that habors the given gene name. The default will use anndata.var_names Calculating Transcripts per Million
scselpy.tl.calculate_TPM(adata,obs_inp,gene,which_var="var_names",use_raw=True,layer_key=None)
Calculates the transcripts per million of a certain gene within a region of cells.
adata:
Annotated data matrix. AnnData obs_inp:
Keys for annotations of observations/cells from str AnnData. gene:
The gene name that should be used for the calculation. str which_var:
Key in the str (default: 'var_names') Anndata variable that habors the given gene name. The default will use anndata.var_names use_raw:
It is recommended to use unnormalized and unscaled values for calculating the TPM. Therefore, by default the script will use anndata.raw. If the unnormalized values are not stored here, please pass bool (default: True) use_raw=False layer_key:
If the unnormalized counts are stored in layers, please specify the layer key. str (default: None)