Skip to main content

Multimodal omics analysis framework

Project description

Documentation Status PyPi version

MuData – multimodal data

Please refer to the MuData documentation here.

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.

  .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
      .X    -- data matrix (cells x features)
      .obs  -- cells metadata (assay-specific)
      .var  -- annotation of features (genes, peaks, genomic sites)



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

# 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_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 ="pbmc_10k.h5mu/rna")
md.write("pbmc_10k.h5mu/rna", adata)

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.2.2.tar.gz (21.9 kB view hashes)

Uploaded source

Built Distribution

mudata-0.2.2-py3-none-any.whl (23.1 kB view hashes)

Uploaded py3

Supported by

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