mantispy.pp.standardize_feature_names#

mantispy.pp.standardize_feature_names(adata, target='cp_measure', copy=False)[source]#

Rename features to target grammar, keeping the original in var.

CellProfiler feature names differ between versions, so renaming makes a dataset from an older pipeline comparable with one from a newer pipeline.

Parameters:
adata AnnData

Object to rename.

target str (default: 'cp_measure')

Naming grammar. Only "cp_measure" is supported.

copy bool (default: False)

Return a modified copy instead of mutating in place.

Return type:

AnnData | None

Returns:

None, or the modified copy. Rewrites var_names and writes var["original_name"] on the first call, never overwriting it afterwards, so the incoming names survive repeated calls.

Raises:

ValueError – If target is not supported, or renaming would give two features the same name (for example two Zernike orders).