Skip to content

msmu.dt.drop

Delete a metadata entry or table column in place, recording its location for replay.

target is uns, obsm, varm, a modality-specific equivalent, or a table path accepted by map. A mapping target deletes its key; a table target deletes a column, so <modality>.decoy removes a decoy-table column while <modality>.uns with key="decoy" removes the whole table. Missing keys raise KeyError. Returns the same MuData; provenance and global modality masks cannot be deleted.

Parameters:

Name Type Description Default
mdata MuData

MuData to modify.

required
target str

Metadata mapping or table path.

required
key str

Entry or column to delete. Missing keys raise KeyError; _log and global modality masks are protected.

required

Returns:

Type Description
MuData

The same MuData, modified in place.

Examples:

import msmu as mm
mdata.uns["temporary_note"] = "reviewed"
mm.dt.drop(mdata, target="uns", key="temporary_note")