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.

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  -- cells 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)

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.0.9.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

mudata-0.0.9-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mudata-0.0.9.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

File hashes

Hashes for mudata-0.0.9.tar.gz
Algorithm Hash digest
SHA256 9d83358130edc717452f7ce566dfda9a4d1aeeb945702c08139e3505c2f7e121
MD5 da4bc58225791d37a32b9793b42ddfff
BLAKE2b-256 3689a06359fc3cfea04ef40e4b79420c35245f9d526b572d6f6bdbc2f872ccb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mudata-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 20.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

File hashes

Hashes for mudata-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 87ccae3be46dcf5442f9fe232c54b32be8433008cc3142ee7d50a8d7a69eb1d8
MD5 33c44e8aa2e21c1c0231d5ef569e4c40
BLAKE2b-256 e019032c6fc9f650bf24e02f39c9bfe5b5d77c39aee8df9ecea078ea1ab41c30

See more details on using hashes here.

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