Skip to main content

Multimodal omics analysis framework

Project description

muon is a multimodal omics Python framework.

Documentation | Tutorials | Publication

Documentation Status PyPi version Powered by NumFOCUS

Data structure

muon is designed around MuData (multimodal data) objects — in the same vein as scanpy and AnnData are designed to work primarily with scRNA-seq data in Python. Individual modalities in MuData are naturally represented with AnnData objects.

MuData class and .h5mu files I/O operations are part of the standalone mudata library.

Input

MuData class is implemented in the mudata library and is exposed in muon:

from muon import MuData

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

If multimodal data from 10X Genomics is to be read, muon provides a reader that returns 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

Basic .h5mu files I/O functionality is implemented in mudata and is exposed in muon. A MuData object represents modalities as collections of AnnData objects, and these collections can be saved on disk and retrieved using HDF5-based .h5mu files, which design is based on .h5ad file structure.

mdata.write("pbmc_10k.h5mu")
mdata = mu.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 = mu.read("pbmc_10k.h5mu/rna")
mu.write("pbmc_10k.h5mu/rna", adata)

Multimodal omics analysis

muon incorporates a set of methods for multimodal omics analysis. These methods address the challenge of taking multimodal data as their input. For instance, while for a unimodal analysis one would use principal components analysis, muon comes with a method to run multi-omics factor analysis:

# Unimodal
import scanpy as sc
sc.tl.pca(adata)

# Multimodal
import muon as mu
mu.tl.mofa(mdata)

Individual assays

Individual assays are stored as AnnData object, which enables the use of all the default scanpy functionality per assay:

import scanpy as sc

sc.tl.umap(mdata.mod["rna"])

Typically, a modality inside a container can be referred to with a variable to make the code more concise:

rna = mdata.mod["rna"]
sc.pl.umap(rna)

Modules in muon

muon comes with a set of modules that can be used hand in hand with scanpy's API. These modules are named after respective sequencing protocols and comprise special functions that might come in handy. It is also handy to import them as two letter abbreviations:

# ATAC module:
from muon import atac as ac

# Protein (epitope) module:
from muon import prot as pt

Some implementation details are noted in DESIGN.md.

Contributions in the form of issues, pull requests or discussions are welcome.

Citation

If you use muon in your work, please cite the muon 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.

muon 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

muon-0.1.8.tar.gz (162.3 kB view details)

Uploaded Source

Built Distribution

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

muon-0.1.8-py3-none-any.whl (295.7 kB view details)

Uploaded Python 3

File details

Details for the file muon-0.1.8.tar.gz.

File metadata

  • Download URL: muon-0.1.8.tar.gz
  • Upload date:
  • Size: 162.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for muon-0.1.8.tar.gz
Algorithm Hash digest
SHA256 fef4b96e94ce6967e3163b6a531472d9e41e48314e9447e3f24b46dd33c4c0a5
MD5 bfd4442c561dfe5cfcdab9dcc81c98a6
BLAKE2b-256 4f7a1bfb185e2296a4608cc8dd15cea2aa381db3c4f61226f5a489a69b63dc89

See more details on using hashes here.

Provenance

The following attestation bundles were made for muon-0.1.8.tar.gz:

Publisher: release.yaml on scverse/muon

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

File details

Details for the file muon-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: muon-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 295.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for muon-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 582c9b540a55d5dda6913043087cd1f9f77b77023ac4efd4f07f0686a62fab3d
MD5 709f8fadb54418ea0c1db833791eb8cc
BLAKE2b-256 5ea8d4a6478beff3c048c734b1a89674812cafd734204dc0def96bbe3d1fcc9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for muon-0.1.8-py3-none-any.whl:

Publisher: release.yaml on scverse/muon

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