mantispy.pp.feature_reproducibility#

mantispy.pp.feature_reproducibility(adata, by='Metadata_Perturbation', min_icc=0.2, key_added='icc', copy=False)[source]#

Score each feature by how consistently replicates of a perturbation agree on it.

A feature that varies only within replicate groups is noise, however large its variance. The intraclass correlation is the share of variance that lies between groups, which a variance filter does not measure.

Parameters:
adata AnnData

Profiles with several replicates per group, at well or perturbation resolution.

by str (default: 'Metadata_Perturbation')

obs column whose groups are the replicate sets.

min_icc float (default: 0.2)

Threshold for the boolean column. See the Notes on choosing it.

key_added str (default: 'icc')

var[key_added] holds the ICC; var[key_added + "_selected"] the flag.

copy bool (default: False)

Return a modified copy instead of mutating in place.

Return type:

AnnData | None

Returns:

None, or the modified copy. Writes the ICC to var[key_added] and the flag to var[key_added + "_selected"].

Raises:

ValueError – If by has a single group, so that no variance can lie between groups.

Notes

Filtering on ICC improves replicate retrieval, but the best cutoff differs by dataset, so 0.2 is a conservative default; choose one from the distribution in var[key_added].

ICC filtering can hurt other tasks. ICC measures reproducibility within a treatment, which is a different property from agreement between compounds that share a mechanism.