grassp.pp.calculate_qc_metrics#
- calculate_qc_metrics(data, qc_vars=(), percent_top=(50, 100, 200, 500), layer=None, use_raw=False, inplace=True, log1p=True, var_type='proteins', expr_type='intensity', parallel=None)[source]#
 Calculate quality control metrics.
This function is a wrapper around
scanpy.pp.calculate_qc_metrics()scanpy.pp.calculate_qc_metrics. It calculates quality control metrics for proteins and samples and adds them todata.obsanddata.var.- Parameters:
 - data 
AnnData The annotated data matrix.
- qc_vars 
Union[Collection[str],str] (default:()) Column names in
.obsto add to the QC metrics.- percent_top 
Optional[Collection[int]] (default:(50, 100, 200, 500)) Which proportions of top genes to cover.
- layer 
str|None(default:None) Layer to use for QC metric calculation.
- use_raw 
bool(default:False) Whether to use
.rawfor calculation.- inplace 
bool(default:True) Whether to add the QC metrics to the AnnData object.
- log1p 
bool(default:True) Whether to log1p the expression values before calculating QC metrics.
- var_type 
str(default:'proteins') The type of variables in the data.
- expr_type 
str(default:'intensity') The type of expression values in the data.
- parallel 
bool|None(default:None) Whether to run the calculation in parallel.
- data 
 - Return type:
 - Returns:
 - if 
inplace=True. Noneand modifies the data.obsand.varwith the QC metrics.- if 
inplace=False, a tuple with protein-wise and sample-wise QC metrics: protein_qc_metrics:
pd.DataFramewith protein-wise QC metricssample_qc_metrics:
pd.DataFramewith sample-wise QC metrics
- if