Skip to main content

Multimodal data

Project description

mudata header

PyPI Tests codecov Documentation Powered by scverse Powered by NumFOCUS

MuData – multimodal data

Documentation | Publication | Changelog

For using MuData in multimodal omics applications see muon.

Data structure

In the same vein as AnnData is designed to represent unimodal annotated datasets in Python, MuData is designed to provide functionality to load, process, and store multimodal omics data.

MuData
  .obs     -- annotation of observations (cells, samples)
  .var     -- annotation of features (genes, genomic loci, etc.)
  .obsm    -- multidimensional cell annotation,
              incl. a boolean for each modality
              that links .obs to the cells of that modality
  .varm    -- multidimensional feature annotation,
              incl. a boolean vector for each modality
              that links .var to the features of that modality
  .mod
    AnnData
      .X    -- data matrix (cells x features)
      .obs  -- cell metadata (assay-specific)
      .var  -- annotation of features (genes, peaks, genomic sites)
      .obsm
      .varm
      .uns
  .uns

Overview

Input

MuData can be thought of as a multimodal container, in which every modality is an AnnData object:

from mudata import MuData

mdata = MuData({'rna': adata_rna, 'atac': adata_atac})

If multimodal data from 10X Genomics is to be read, convenient readers are provided by muon that return a MuData object with AnnData objects inside, each corresponding to its own modality:

import muon as mu

mu.read_10x_h5("filtered_feature_bc_matrix.h5")
# MuData object with n_obs × n_vars = 10000 × 80000
# 2 modalities
#   rna:	10000 x 30000
#     var:	'gene_ids', 'feature_types', 'genome', 'interval'
#   atac:	10000 x 50000
#     var:	'gene_ids', 'feature_types', 'genome', 'interval'
#     uns:	'atac', 'files'

I/O with .h5mu files

MuData objects represent modalities as collections of AnnData objects. These collections can be saved to disk and retrieved using HDF5-based .h5mu files, which design is based on .h5ad file structure.

import mudata as md

mdata_pbmc.write("pbmc_10k.h5mu")
mdata = md.read("pbmc_10k.h5mu")

It allows to effectively use the hierarchical nature of HDF5 files and to read/write AnnData object directly from/to .h5mu files:

adata = md.read("pbmc_10k.h5mu/rna")
md.write("pbmc_10k.h5mu/rna", adata)

Citation

If you use mudata in your work, please cite the publication as follows:

MUON: multimodal omics analysis framework

Danila Bredikhin, Ilia Kats, Oliver Stegle

Genome Biology 2022 Feb 01. doi: 10.1186/s13059-021-02577-8.

You can cite the scverse publication as follows:

The scverse project provides a computational ecosystem for single-cell omics data analysis

Isaac Virshup, Danila Bredikhin, Lukas Heumos, Giovanni Palla, Gregor Sturm, Adam Gayoso, Ilia Kats, Mikaela Koutrouli, Scverse Community, Bonnie Berger, Dana Pe’er, Aviv Regev, Sarah A. Teichmann, Francesca Finotello, F. Alexander Wolf, Nir Yosef, Oliver Stegle & Fabian J. Theis

Nat Biotechnol. 2023 Apr 10. doi: 10.1038/s41587-023-01733-8.

mudata is part of the scverse® project (website, governance) and is fiscally sponsored by NumFOCUS. If you like scverse® and want to support our mission, please consider making a tax-deductible donation to help the project pay for developer time, professional services, travel, workshops, and a variety of other needs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mudata-0.3.4.tar.gz (327.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mudata-0.3.4-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file mudata-0.3.4.tar.gz.

File metadata

  • Download URL: mudata-0.3.4.tar.gz
  • Upload date:
  • Size: 327.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mudata-0.3.4.tar.gz
Algorithm Hash digest
SHA256 36ac8c58bd1869c2dd865caa8dfad6811ddc23b522a239ae534b328fcd4357d4
MD5 f9a9291e09fe2d67829ca0ff05d01cb7
BLAKE2b-256 2cd917d2220c1e68198adb030433e353c86c531295bf971a35490b79ad908154

See more details on using hashes here.

Provenance

The following attestation bundles were made for mudata-0.3.4.tar.gz:

Publisher: release.yaml on scverse/mudata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mudata-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: mudata-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mudata-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5c16316155538cab7b4c0c56eb91e22b5aca9150351d18a3eb14837fd8a2f768
MD5 7732dbde5822d6e0d3c0378db1847684
BLAKE2b-256 6aeeae7614fdafdf5f9a4cf7f71d1c6d5ea7478580c9b7b6491d56eaa5ef8130

See more details on using hashes here.

Provenance

The following attestation bundles were made for mudata-0.3.4-py3-none-any.whl:

Publisher: release.yaml on scverse/mudata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page