Skip to content

msmu.pl.plot_upset

Show feature intersections across observation groups.

Parameters:

Name Type Description Default
mdata MuData

MuData containing the selected modality and observation metadata.

required
modality str

Name of the modality to plot, such as "protein" or "psm".

'protein'
layer str | None

Quantification layer; None reads .X.

None
subset str | None

Optional value to select in subset_column before plotting.

None
subset_column str | None

Observation column used for subset; omitted values use the same sample-identifier resolution as obs_column.

None
groupby str | None

Grouping column in observation metadata (or feature metadata where supported). None uses the resolved obs_column.

None
obs_column str | None

Sample identifier in mdata.obs. If omitted, uses .uns["plotting"]["default_obs_column"], then source name/source_name/sample/filename, then the observation index.

None
kwargs str

Additional plotly layout options, for example width=800 or title_text="QC".

{}

Returns:

Type Description
Figure

plotly Figure. Call .show() to display or .write_html("plot.html") to export.

Notes

Intersections are based on non-missing quantification. groupby must resolve to an observation grouping. Quantification and embeddings are unchanged. Resolving an existing sample-identifier column can convert that column in mdata.obs to categorical; pass a copy to preserve its dtype.

Examples:

import msmu as mm
fig = mm.pl.plot_upset(mdata, modality="protein")
fig.show()