mantispy.pp.calculate_qc_metrics#
- mantispy.pp.calculate_qc_metrics(adata, image_shape=None, border_margin=10, max_nan_fraction=0.5, copy=False)#
Compute per-cell and per-feature QC metrics.
- Parameters:
adata (
AnnData) – Object to annotate.image_shape (
tuple[int,int] |None(default:None)) –(height, width)of a field of view. Without it, and withoutMetadata_Center_X/_Yinobs, the border flag staysFalse.border_margin (
int(default:10)) – Distance from the image edge, in pixels, inside which a cell is a border cell.max_nan_fraction (
float(default:0.5)) – Largest fraction of missing features a cell may have and still pass. Partial NaN is routine in CellProfiler output (Zernike and RadialDistribution features are undefined for small objects), so requiring no missing values would fail almost every cell.copy (
bool(default:False)) – Return a modified copy instead of mutating in place.
- Return type:
- Returns:
None, or the modified copy. Writes theobscolumnsqc_n_nan_features,qc_nan_fraction,qc_is_border,qc_area_outlierandqc_pass, and thevarcolumnsqc_n_nan,qc_varianceandqc_n_unique.- Raises:
KeyError – If
varhas nofeaturecolumn, whichqc_area_outlierneeds to find the area features, and which the schema requires.