Making use of curatedMetagenomicData

knitr::opts_chunk$set(echo = TRUE, eval = FALSE)

Fetch from curatedMetagenomicData

Download the data as an ExpressionSet list:

library(curatedMetagenomicData)
esetlist <- list(taxa = ZellerG_2014.metaphlan_bugs_list.stool()[, 1:10],
                 pathways = ZellerG_2014.pathabundance_relab.stool())
## species and strain-level taxa only:
esetlist$taxa <- esetlist$taxa[grep("s__", rownames(esetlist$taxa)), ]
## eliminate taxa-specific pathway contributions (only total pathway abundances):
esetlist$pathways <- esetlist$pathways[grep("g__", 
                                  rownames(esetlist$pathways), invert=TRUE), ]

Create the MultiAssayExperiment:

library(MultiAssayExperiment)
cmd <- MultiAssayExperiment(experiments=esetlist, 
    colData=colData(as(esetlist[[2]], "SummarizedExperiment")))
cmd
rownames(cmd)

CCA with omicade4

library(omicade4)
cmdsub <- cmd[, cmd$disease %in% c("adenoma", "CRC", "healthy"), ]
##Get rid of rows that are all zero:
cmdsub <- cmdsub[lapply(assays(cmdsub), function(exper) rowSums(exper) > 0), ]

mcoin <- mcia(assay(cmdsub))
plot(mcoin, phenovec=cmdsub$disease, sample.lab=FALSE)

iClusterPlus

Error, "system is computationally singular"

library(iClusterPlus)
datasets = assay(cmdsub)
datasets = lapply(datasets, t)
iclus = iCluster(datasets=datasets, k=5, lambda=c(0.2, 0.2))
plotiCluster(fit=iclus, label=cmdsub$disease)

sparse CCA

library(PMA)
cmd2 <- mergeReplicates(intersectColumns(cmd))
## ERROR: some columns have SD = 0
mycca <- PMA::CCA(x=t(assay(cmd2, 1)), z=t(assay(cmd2, 2)))
mycca

Others to try

library(made4)
library(MCIA)
# library(Rtopper)  # gene set analysis


Try the MultiAssayExperiment package in your browser

Any scripts or data that you put into this service are public.

MultiAssayExperiment documentation built on Nov. 8, 2020, 8:10 p.m.