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: AnnData
    Annotated data matrix.

 obs_inp: str
    Keys for annotations of observations/cells from 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: AnnData
    Annotated data matrix.

 obs_inp: str
    Keys for annotations of observations/cells from AnnData.

 gene: str
    The gene name that should be used for the calculation.

 which_var: str (default: 'var_names')
    Key in the 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: AnnData
    Annotated data matrix.

 obs_inp: str
    Keys for annotations of observations/cells from AnnData.

 gene: str
    The gene name that should be used for the calculation.

 which_var: str (default: 'var_names')
    Key in the Anndata variable that habors the given gene name. The default will use anndata.var_names

 use_raw: bool (default: True)
    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 use_raw=False

 layer_key: str (default: None)
    If the unnormalized counts are stored in layers, please specify the layer key.