mantispy.pp.feature_batch_sensitivity#

mantispy.pp.feature_batch_sensitivity(adata, batch_key='Metadata_Batch', threshold=0.05, key_added='batch', copy=False)[source]#

Test each feature for dependence on the batch, after whatever correction was applied.

Parameters:
adata AnnData

Profiles to test.

batch_key str (default: 'Metadata_Batch')

obs column holding the batch, imaging week or plate.

threshold float (default: 0.05)

q-value below which a feature is called batch sensitive.

key_added str (default: 'batch')

Prefix for var[key_added + "_pvalue"], _qvalue and _sensitive.

copy bool (default: False)

Return a modified copy instead of mutating in place.

Return type:

AnnData | None

Returns:

None, or the modified copy. Writes var[key_added + "_pvalue"], var[key_added + "_qvalue"] and the boolean var[key_added + "_sensitive"].

Raises:

ValueError – If batch_key holds fewer than two batches.

Notes

Uses Kruskal-Wallis instead of ANOVA, because morphology features are not normally distributed and a few extreme wells should not decide the result. Expect a large fraction to come back sensitive, since per-plate centering does not remove plate structure: most features still depend on the plate after per-plate normalization.

Compare the sensitive fraction before and after a correction.