rapids_singlecell.pp.calculate_qc_metrics#
- rapids_singlecell.pp.calculate_qc_metrics(adata, *, expr_type='counts', var_type='genes', qc_vars=None, log1p=True, layer=None)[source]#
Calculates basic qc Parameters. Calculates number of genes per cell (n_genes) and number of counts per cell (n_counts). Loosely based on calculate_qc_metrics from scanpy [Wolf et al. 2018]. Updates
obs
andvar
with columns with qc data.- Parameters:
- adata
AnnData
AnnData object
- expr_type
str
(default:'counts'
) Name of kind of values in X.
- var_type
str
(default:'genes'
) The kind of thing the variables are.
- qc_vars
str
|list
(default:None
) Keys for boolean columns of
var
which identify variables you could want to control for (e.g. Mito). Run flag_gene_family first- log1p
bool
(default:True
) Set to
False
to skip computinglog1p
transformed annotations.- layer
str
(default:None
)
- adata
- Return type:
- Returns:
- adds the following columns in
obs
: total_{var_type}_by_{expr_type}
E.g. ‘total_genes_by_counts’. Number of genes with positive counts in a cell.
total_{expr_type}
E.g. ‘total_counts’. Total number of counts for a cell.
- for
qc_var
inqc_vars
total_{expr_type}_{qc_var}
number of counts per qc_var (e.g total counts mitochondrial genes)
pct_{expr_type}_{qc_var}
Proportion of counts of qc_var (percent of counts mitochondrial genes)
- adds the following columns in
var
: total_{expr_type}
E.g. ‘total_counts’. Sum of counts for a gene.
n_genes_by_{expr_type}
E.g. ‘n_cells_by_counts’. Number of cells this expression is measured in.
mean_{expr_type}
E.g. “mean_counts”. Mean expression over all cells.
pct_dropout_by_{expr_type}
E.g. ‘pct_dropout_by_counts’. Percentage of cells this feature does not appear in.
- adds the following columns in