Making use of curatedMetagenomicData
Levi Waldron
1/11/2017
Source:vignettes/extras/MAE-curatedMetagenomicData.Rmd
MAE-curatedMetagenomicData.Rmd
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)
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