\setcounter{tocdepth}{5} \tableofcontents
This package implements a novel data integration model for sample-wise integration of different views. It accounts for compositionality and employs a non-parametric mean-variance trend for sequence count data. The resulting model can be conveniently plotted to allow for explorative visualization of variability shared over different views.
The package can be installed and loaded using the following commands:
knitr::opts_chunk$set(cache = FALSE, autodep = TRUE, warning = FALSE, message = FALSE, echo = TRUE, eval = TRUE, tidy = TRUE, fig.width = 9, fig.height = 6, purl = TRUE, fig.show = "hold", cache.lazy = FALSE) palStore = palette() #Load all fits, to avoid refitting every time rebuilding the vignette load(system.file("extdata", "zhangFits.RData", package = "combi"))
library(BiocManager) BiocManager::install("combi", update = FALSE)
library(devtools) install_github("CenterForStatistics-UGent/combi")
suppressPackageStartupMessages(library(combi)) cat("combi package version", as.character(packageVersion("combi")), "\n")
data(Zhang)
For an unconstrained ordination, a named list of datasets with overlapping samples must be supplied. The datasets can currently be supplied as a raw data matrix (with features in the columns), or as a phyloseq, SummarizedExperiment or ExpressionSet object. In addition, information on the required distribution ("quasi" for quasi-likelihood fitting, "gaussian" for normal data) and compositional nature (TRUE/FALSE) should be supplied
microMetaboInt = combi( list("microbiome" = zhangMicrobio, "metabolomics" = zhangMetabo), distributions = c("quasi", "gaussian"), compositional = c(TRUE, FALSE), logTransformGaussian = FALSE)
One can print basic infor about the ordination
microMetaboInt
A simple plot function is available for the result, for samples and shapes, a data frame should also be supplied
plot(microMetaboInt)
plot(microMetaboInt, samDf = zhangMetavars, samCol = "ABX")
By default, only the most important features (furthest away from the origin) are shown. To show all features, one can resort to point cloud plots or density plots as follows:
plot(microMetaboInt, samDf = zhangMetavars, samCol = "ABX", featurePlot = "points")
plot(microMetaboInt, samDf = zhangMetavars, samCol = "ABX", featurePlot = "density")
The drawback is that now no feature labels are shown.
As an aid to interpretation of compositional views, links between features can be plotted and projected onto samples by providing their names or approximate coordinates
#First define the plot, and return the coordinates mmPlot = plot(microMetaboInt, samDf = zhangMetavars, samCol = "ABX", returnCoords = TRUE, featNum = 10) #Providing feature names, and sample coordinates, but any combination is allowed addLink(mmPlot, links = cbind("Staphylococcus_819c11","OTU929ffc"), Views = 1, samples = c(0,1))
Finally, one can extract the coordinates for use in third-party software
coords = extractCoords(microMetaboInt, Dim = c(1,2))
For a constrained ordination also a data frame of sample variables should be supplied
microMetaboIntConstr = combi( list("microbiome" = zhangMicrobio, "metabolomics" = zhangMetabo), distributions = c("quasi", "gaussian"), compositional = c(TRUE, FALSE), logTransformGaussian = FALSE, covariates = zhangMetavars)
Also here we can get a quick overview
microMetaboIntConstr
and plot the ordination
plot(microMetaboIntConstr, samDf = zhangMetavars, samCol = "ABX")
Convergence of the iterative algorithm can be assessed as follows:
convPlot(microMetaboInt)
Influence of the different views can be investigated through
inflPlot(microMetaboInt, samples = 1:20, plotType = "boxplot")
This vignette was generated with following version of R:
sessionInfo()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.