mapqc.evaluate#
- mapqc.evaluate(adata, case_control_key, case_cats, control_cats)#
Evaluate and summarize mapQC output.
- Parameters:
adata (
AnnData) – AnnData object with mapQC output (i.e. mapqc.run() has been run)case_control_key (
str) – Column name in adata.obs that contains the case-control informationcase_cats (
list[str]) – Unique case categories, i.e. the non-control categories to be evaluated for the query cells only, as a list (e.g. [“IPF”, “COPD”]). Each category will be evaluated separately. If only one category exists, still provide as a list (e.g. [“IPF”]).control_cats (
list[str]) – Unique control categories in adata.obs[case_control_key] for the query cells only, as a list (e.g. [“Control”, “Control_2”]). These will be evaluated as one group. The controls are considered to be the same as the reference used to map against.
- Return type:
- Returns:
dict of statistics: Dictionary containing the following statistics:
- perc_nhoods_passfloat
Percentage of neighborhoods that passed filtering
- perc_cells_sampledfloat
Percentage of cells that were sampled
- perc_sampled_cells_passfloat
Percentage of sampled cells that passed filtering
- perc_[control_cat]_cells_dist_to_reffloat
Percentage of [control_cat] cells that passed filtering that were distant to the reference (mapQC score > 2)
- perc_[case_cat]_cells_dist_to_reffloat
Percentage of [case_cat] cells that passed filtering that were distant to the reference (mapQC score > 2), for each case_cat included in case_cats
Notes
In addition to returning these statistics as a dictionary, the function prints each statistic to the console as it is calculated.