knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
CITE-seq data provide RNA and surface protein counts for the same cells. This tutorial shows how MuData can be integrated into with Bioconductor workflows to analyse CITE-seq data.
The most recent dev build can be installed from GitHub:
library(remotes) remotes::install_github("ilia-kats/MuData")
Stable version of MuData
will be available in future bioconductor versions.
library(MuData) library(SingleCellExperiment) library(MultiAssayExperiment) library(CiteFuse) library(scater) library(rhdf5)
We will use CITE-seq data available within
CiteFuse
Bioconductor package.
data("CITEseq_example", package = "CiteFuse") lapply(CITEseq_example, dim)
This dataset contains three matrices — one with RNA
counts, one with
antibody-derived tags (ADT
) counts and one with hashtag oligonucleotide
(HTO
) counts.
While CITE-seq analysis workflows such as CiteFuse should be consulted for more details, below we exemplify simple data transformations in order to demonstrate how their output can be saved to an H5MU file later on.
Following the CiteFuse tutorial, we start with creating a SingleCellExperiment
object with the three matrices:
sce_citeseq <- preprocessing(CITEseq_example) sce_citeseq
We will add a new assay with normalised RNA counts:
sce_citeseq <- scater::logNormCounts(sce_citeseq) sce_citeseq # new assay: logcounts
To the ADT modality, we will add an assay with normalised counts:
sce_citeseq <- CiteFuse::normaliseExprs( sce_citeseq, altExp_name = "ADT", transform = "log" ) altExp(sce_citeseq, "ADT") # new assay: logcounts
We will also generate reduced dimensions:
sce_citeseq <- scater::runPCA( sce_citeseq, exprs_values = "logcounts", ncomponents = 20 )
scater::plotReducedDim(sce_citeseq, dimred = "PCA", by_exprs_values = "logcounts", colour_by = "CD27")
An appropriate structure for multimodal datasets is
MultiAssayExperiment
.
We will make a respective MultiAssayExperiment object from sce_citeseq
:
experiments <- list( ADT = altExp(sce_citeseq, "ADT"), HTO = altExp(sce_citeseq, "HTO") ) # Drop other modalities from sce_citeseq altExp(sce_citeseq) <- NULL experiments[["RNA"]] <- sce_citeseq mae <- MultiAssayExperiment(experiments)
We can write the contents of the MultiAssayExperiment object into an H5MU file:
writeH5MU(mae, "citefuse_example.h5mu")
We can check that all the modalities were written to the file:
h5 <- rhdf5::H5Fopen("citefuse_example.h5mu") h5ls(H5Gopen(h5, "mod"), recursive = FALSE)
... both assays for ADT — raw counts are stored in X
and normalised counts
are in the corresponding layer:
h5ls(H5Gopen(h5, "mod/ADT"), FALSE) h5ls(H5Gopen(h5, "mod/ADT/layers"), FALSE)
... as well as reduced dimensions (PCA):
h5ls(H5Gopen(h5, "mod/RNA/obsm"), FALSE) # There is an alternative way to access groups: # h5&'mod'&'RNA'&'obsm' rhdf5::H5close()
mudata (Python) documentation
muon documentation and web page
Kim HJ, Lin Y, Geddes TA, Yang P, Yang JYH (2020). “CiteFuse enables multi-modal analysis of CITE-seq data.” Bioinformatics, 36(14), 4137–4143. https://doi.org/10.1093/bioinformatics/btaa282.
Ramos M, Schiffer L, Re A, Azhar R, Basunia A, Cabrera CR, Chan T, Chapman P, Davis S, Gomez-Cabrero D, Culhane AC, Haibe-Kains B, Hansen K, Kodali H, Louis MS, Mer AS, Reister M, Morgan M, Carey V, Waldron L (2017). “Software For The Integration Of Multi-Omics Experiments In Bioconductor.” Cancer Research, 77(21); e39-42.
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.