mantispy.pp.correct_plate_position#
- mantispy.pp.correct_plate_position(adata, method='median_polish', by='Metadata_Plate', reference=None, max_iter=10, tol=0.0001, key_added=None, copy=False)#
Remove row and column position effects, per plate and per feature.
- Parameters:
adata (
AnnData) – Object to correct, at cell or well resolution.method (
str(default:'median_polish')) – Only"median_polish"(Tukey), which is robust to a few extreme wells.by (
str(default:'Metadata_Plate')) – Column identifying the plate.reference (
str|None(default:None)) – Fit the row and column effects on these rows only."negcon"is the usual choice, so that treatments laid out in particular columns are not absorbed into a column effect.Nonefits on every well.max_iter (
int(default:10)) – Maximum number of median-polish iterations.tol (
float(default:0.0001)) – Convergence tolerance of the median polish.key_added (
str|None(default:None)) – Write tolayers[key_added]instead of overwritingX.copy (
bool(default:False)) – Return a modified copy instead of mutating in place.
- Return type:
- Returns:
None, or the modified copy. WritesXorlayers[key_added], and the fitted effects per plate touns["mantispy"]["plate_position"].- Raises:
ValueError – If
methodis unknown, or a plate holds no reference rows.
Notes
The polish is fitted on the well grid. At cell resolution each well is first reduced to its median, and the fitted effect is then subtracted from every cell of that well.