Skip to content

Visualization

msmu.pl provides QC and exploratory plots for MuData objects using plotly.

Choose plot options

  • mdata: required MuData containing the modality to plot.
  • modality: required for plot_id, plot_intensity, and plot_missingness; elsewhere it defaults to the level the plot is normally read at (psm for plot_var, protein for plot_pca, plot_umap, plot_correlation, and plot_upset).
  • groupby: observation column used to split traces/groups (e.g., filename, condition). If omitted, falls back to obs_column.
  • obs_column: observation column used for labeling/group resolution; all elements should be unique. If omitted or no column exists, creates __obs_idx__ column from the index of .obs
  • colorby: optional .obs column for coloring; only applied when groupby equals obs_column.
  • ptype: plot style selector (hist, box, vln, etc.).
  • layer: optional; plot a layer instead of .X (plot_id, plot_intensity, plot_missingness, plot_upset).
  • template: optional plotly template, "msmu" by default (plot_id, plot_intensity, plot_pca, plot_umap).
  • **kwargs: forwarded to go.Figure.update_layout for per-plot overrides.

Per-plot optional arguments:

  • bins: histogram bin count for plot_intensity and plot_var.
  • pcs: which principal components to draw in plot_pca, default (1, 2).
  • key: .obsm key holding the embedding, default X_pca / X_umap.
  • subset, subset_column: restrict plot_upset to one group of samples — it keeps the observations whose subset_column value in .obs equals subset.

Plot examples

The examples below use the dataset described by Uszkoreit et al. (2022).

Sample metadata used below

set sample_id sample_name condition replicate
S1 QExHF04026 G1-1 G1 1
S1 QExHF04028 G2-1 G2 1
S1 QExHF04030 G3-1 G3 1
S1 QExHF04032 G4-1 G4 1
S1 QExHF04034 G5-1 G5 1
S1 QExHF04036 G1-2 G1 2
S1 QExHF04038 G2-2 G2 2
S1 QExHF04040 G3-2 G3 2
S1 QExHF04042 G4-2 G4 2
S1 QExHF04044 G5-2 G5 2
S1 QExHF04046 G1-3 G1 3
S1 QExHF04048 G2-3 G2 3
S1 QExHF04050 G3-3 G3 3
S1 QExHF04052 G4-3 G4 3
S1 QExHF04054 G5-3 G5 3

plot_id

mm.pl.plot_id(mdata, "protein", groupby="sample_name")

mm.pl.plot_id(mdata, "protein", groupby="condition")

plot_intensity

mm.pl.plot_intensity(mdata, "protein", groupby="sample_name", ptype="hist")

plot_missingness

mm.pl.plot_missingness(mdata, "protein")

plot_var

mm.pl.plot_var(mdata, "psm", groupby="sample_name", var_column="charge", ptype="stacked_bar")

mm.pl.plot_var(mdata, "psm", groupby="sample_name", var_column="peptide_length", ptype="vln")

plot_pca & plot_umap

mm.pl.plot_pca(mdata, "protein", groupby="condition")

plot_pca(..., key="X_pca") expects: - coordinates in mdata[modality].obsm[key] - PCA variance metadata in mdata[modality].uns[key]["variance_ratio"]

plot_umap(..., key="X_umap") expects: - coordinates in mdata[modality].obsm[key]

plot_correlation

mm.pl.plot_correlation(mdata, "protein")

plot_upset

mm.pl.plot_upset(mdata, "protein", groupby="condition")

References

Uszkoreit, J., Barkovits, K., Pacharra, S., Pfeiffer, K., Steinbach, S., Marcus, K., and Eisenacher, M. Dataset containing physiological amounts of spike-in proteins into murine C2C12 background as a ground truth quantitative LC-MS/MS reference. Data in Brief 43, 108435 (2022). https://doi.org/10.1016/j.dib.2022.108435.