mantispy.pp.image_qc#
- mantispy.pp.image_qc(adata, metrics=('FocusScore', 'PowerLogLogSlope', 'PercentMaximal', 'PercentMinimal', 'Saturation'), channel=None, method='mad', threshold='auto', by='Metadata_Plate', k=15, copy=False)#
Flag low-quality images and broadcast the verdict onto their cells.
- Parameters:
adata (
AnnData) – Object carryinguns["mantispy"]["image_table"]andobs["Metadata_ImageNumber"].metrics (
Sequence[str] (default:('FocusScore', 'PowerLogLogSlope', 'PercentMaximal', 'PercentMinimal', 'Saturation'))) – Which MeasureImageQuality metrics to use.channel (
str|None(default:None)) – Restrict to one channel’s metrics.Noneuses every channel present.method (
str(default:'mad')) –"mad"flags an image when any metric is an outlier within itsbygroup."knn"flags images that sit far from their neighbors in the standardized metric space, which catches unusual combinations of metrics that a per-metric rule misses.threshold (
float|str(default:'auto')) –"auto"flags a score above the method’s default robust-z cutoff (DEFAULT_CUTOFF). A float thresholds the raw score instead.by (
str|None(default:'Metadata_Plate')) – Compute thresholds within each group of this column, normally the plate.Nonepools every image, which flags every image on a dim plate and misses a blurred image on a bright one.k (
int(default:15)) – Neighbors formethod="knn".copy (
bool(default:False)) – Return a modified copy instead of mutating in place.
- Return type:
- Returns:
None, or the modified copy. Writesuns["mantispy"]["image_qc"](the image table plusqc_image_scoreandqc_image_pass) and broadcastsobs["qc_image_pass"].- Raises:
KeyError – If the image table is missing, holds none of the requested metrics, or lacks the
bycolumn, orobshas noMetadata_ImageNumberto broadcast onto.ValueError – If
methodis unknown, or some images have no value inby.