├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── MicrobiomeAnalystR.Rproj ├── NAMESPACE ├── R ├── general_anal.R ├── general_graphics.R ├── general_io.R ├── general_load_libs.R ├── general_misc.R ├── general_multivar.R ├── general_proc.R ├── mdp_io.R ├── mdp_utils.R ├── meta_methods.R ├── meta_proc.R ├── meta_qc.R ├── mmp_utils.R ├── multifac_metadata.R ├── plotly_utils.R ├── rscripts ├── seq_proc.R ├── tsea_utils.R ├── utils_16s2fun.R ├── utils_corrnet.R ├── utils_dimreduction.R ├── utils_fastspar.R ├── utils_maaslin.R ├── utils_meta.R ├── utils_mirkat.R ├── utils_pcoa3d.R ├── utils_peak2fun.R ├── utils_ppd.R ├── utils_scatter3d.R ├── utils_scatter_json.R ├── utils_sdp.R ├── utils_secom.R └── utils_sparcc.R ├── README.Rmd ├── README.md ├── docs └── microbiomeanalystr_logo.png ├── man ├── AddErrMsg.Rd ├── ApplyAbundanceFilter.Rd ├── ApplyAbundanceFilterMeta.Rd ├── ApplyMetaboFilter.Rd ├── ApplyVarianceFilter.Rd ├── ApplyVarianceFilterMeta.Rd ├── CalculateHyperScore.Rd ├── CheckMetaDataIntegrity.Rd ├── CleanData.Rd ├── CompareSummaryStats.Rd ├── CoreMicrobeAnalysis.Rd ├── CreateFooter.Rd ├── CreateMDPRnwReport.Rd ├── CreatePhyloseqObj.Rd ├── CreatePhyloseqObjMeta.Rd ├── CreateRHistAppendix.Rd ├── CreateSDPRnwReport.Rd ├── CrossReferencing.Rd ├── FeatureCorrelation.Rd ├── GenerateTemplates.Rd ├── GetColorSchema.Rd ├── GetDataForPie.Rd ├── GetErrMsg.Rd ├── GetFinalNameMap.Rd ├── GetGeneListStat.Rd ├── GetMapTable.Rd ├── GetORATable.Rd ├── GetRFConf.Table.Rd ├── GetSigTable.Corr.Rd ├── GetSigTable.LEFSE.Rd ├── GetSigTable.METAGENOSEQ.Rd ├── GetSigTable.RNASeq.Rd ├── GetSigTable.UNIVAR.Rd ├── Init.DataMeta.Rd ├── Init.mbSetObj.Rd ├── Match.Pattern.Rd ├── MergeDatasets.Rd ├── PCoA3D.Anal.Rd ├── PCoA3DAnal.16SRef.Rd ├── Perform16FunAnot_mem.Rd ├── PerformAlphaDiversityComp.Rd ├── PerformBatchCorrection.Rd ├── PerformBetaDiversity.Rd ├── PerformCategoryComp.Rd ├── PerformDEAnalyse.Rd ├── PerformKOEnrichAnalysis_KO01100.Rd ├── PerformKOProjection.Rd ├── PerformKOmapping.Rd ├── PerformLefseAnal.Rd ├── PerformMetaEffectSize.Rd ├── PerformMetaboNormalization.Rd ├── PerformMetagenomeSeqAnal.Rd ├── PerformNetworkCorrelation.Rd ├── PerformNormalization.Rd ├── PerformNormalizationMeta.Rd ├── PerformPartialCorr.Rd ├── PerformRNAseqDE.Rd ├── PerformRarefaction.Rd ├── PerformRefDataMapping.Rd ├── PerformUnivarTest.Rd ├── PlotAlphaBoxData.Rd ├── PlotAlphaData.Rd ├── PlotBetaSummary.Rd ├── PlotBoxData.Rd ├── PlotBoxDataCorr.Rd ├── PlotCorr.Rd ├── PlotDataPieFromPie.Rd ├── PlotEnrichNet.Overview.Rd ├── PlotFunAnotSummary.Rd ├── PlotFunctionStack.Rd ├── PlotGroupPieGraph.Rd ├── PlotHeatmap.Rd ├── PlotImpVar.Rd ├── PlotImpVarLEfSe.Rd ├── PlotLEfSeSummary.Rd ├── PlotLibSizeView.Rd ├── PlotMetaDensity.Rd ├── PlotMetaPCA.Rd ├── PlotOverallPieGraph.Rd ├── PlotPCAView.Rd ├── PlotPhylogeneticTree.Rd ├── PlotPiechart.Rd ├── PlotRF.Classify.Rd ├── PlotRF.VIP.Rd ├── PlotRareCurve.Rd ├── PlotRarefactionCurve.Rd ├── PlotSamplePieGraph.Rd ├── PlotSampleTaxaAundanceBar.Rd ├── PlotSelectedSample.Rd ├── PlotTaxaAbundanceArea.Rd ├── PlotTaxaAbundanceBarSamGrp.Rd ├── PlotTaxaAundanceBar.Rd ├── PlotTreeGraph.Rd ├── PlotUsrRefPCoA3DScore.Rd ├── PrepareEnrichNet.Rd ├── PrepareHeatTreePlot.Rd ├── PrepareHeatTreePlotDataParse_cmf.Rd ├── PrepareHeatTreePlotDataParse_cmf_diff_table.Rd ├── PrepareHeatTreePlotDataParse_cmf_plot.Rd ├── PrepareMergedData.Rd ├── PreparePCA4Shotgun.Rd ├── PreparePDFReport.Rd ├── PrepareQueryJson.Rd ├── RF.Anal.Rd ├── Read16SAbundData.Rd ├── Read16SAbundDataMeta.Rd ├── Read16SBiomData.Rd ├── Read16STabData.Rd ├── Read16STaxaTable.Rd ├── Read16STaxaTableMeta.Rd ├── ReadMetabolicTable.Rd ├── ReadMothurData.Rd ├── ReadSampleTable.Rd ├── ReadSampleTableMeta.Rd ├── ReadSampleTableMetaInd.Rd ├── ReadShotgunBiomData.Rd ├── ReadShotgunTabData.Rd ├── ReadTreeFile.Rd ├── RunFastSpar.Rd ├── SanityCheckData.Rd ├── SanityCheckDataMeta.Rd ├── SanityCheckMetData.Rd ├── SanityCheckSampleData.Rd ├── SanityCheckSampleDataMeta.Rd ├── SavePiechartImg.Rd ├── SetDataTypeOfMeta.Rd ├── SetMetaAttributes.Rd ├── SetModuleType.Rd ├── SetTaxonSetLib.Rd ├── Setup.MapData.Rd ├── UpdateConfItems.Rd ├── UpdateListInput.Rd ├── UpdatePieData.Rd ├── UpdateSampleItems.Rd ├── case_when.Rd ├── condenseOTUs.Rd ├── dot-read.microbiomeanalyst.lib.rds.Rd └── dot-readDataTable.Rd ├── src ├── Makevars ├── Makevars.win ├── decorana.f ├── init.c ├── rowttests.c ├── util.c └── util.h └── vignettes ├── Introduction_to_MicrobiomeAnalystR.Rmd ├── Marker_Data_Profiling.Rmd ├── MicrobiomeAnalystR_dada2_processing_raw_data.Rmd ├── Projection_with_Public_Data.Rmd ├── Shotgun_Data_Profiling.Rmd └── Taxon_Set_Enrichment_Analysis.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | src/*.o 6 | src/*.so 7 | src/*.dll 8 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: MicrobiomeAnalystR 2 | Title: MicrobiomeAnalystR - A comprehensive R package for statistical, visual, and functional analysis of the microbiome. 3 | Version: 2.0 4 | Authors@R: c(person("Jianguo", "Xia", email = "jeff.xia@mcgill.ca", role = "aut"), person("Yao", "Lu", email = "yao.lu@mail.mcgill.ca", role=c("aut", "cre")), person("Zhiqiang", "Pang", email = "zhiqiang.pang@mail.mcgill.ca", role=c("aut")), person("Guangyan", "Zhou", email = "guangyan.zhou@mail.mcgill.ca", role=c("aut")), person("Jasmine", "Chong", email = "jasmine.chong@mail.mcgill.ca", role=c("aut")), person("Peng", "Liu", email = "peng.liu@mail.mcgill.ca", role=c("aut"))) 5 | Author: Jianguo Xia [aut], Yao Lu[aut, cre], Guangyan Zhou[aut],Zhiqiang Pang[aut], Jasmine Chong [aut], Peng Liu [aut] 6 | Maintainer: Yao Lu 7 | Description: This package contains the entire underlying R functionality of the web-based tool MicrobiomeAnalyst. It also provides a workflow for raw sequencing preprocessing using the DADA2 pipeline. 8 | Depends: R (>= 4.2.2), 9 | phyloseq 10 | License: What license is it under? 11 | Encoding: UTF-8 12 | LazyData: true 13 | RoxygenNote: 7.2.3 14 | Imports: 15 | metacoder, 16 | pryr, 17 | biomformat, 18 | RColorBrewer, 19 | ggplot2, 20 | gplots, 21 | Cairo, 22 | igraph, 23 | BiocParallel, 24 | randomForest, 25 | metagenomeSeq, 26 | MASS, 27 | DESeq2, 28 | vegan, 29 | RJSONIO, 30 | ggfortify, 31 | pheatmap, 32 | xtable, 33 | genefilter, 34 | data.table, 35 | reshape, 36 | reshape2, 37 | stringr, 38 | ape, 39 | grid, 40 | gridExtra, 41 | splitstackshape, 42 | R.utils, 43 | viridis, 44 | taxa, 45 | ggrepel, 46 | qs, 47 | Tax4Fun, 48 | ppcor, 49 | dplyr, 50 | limma, 51 | memoise, 52 | tidyverse 53 | Suggests: 54 | knitr, 55 | rmarkdown, 56 | DECIPHER, 57 | phangorn, 58 | dada2, 59 | MASS, 60 | MMUPHin, 61 | RSclient, 62 | alphashape3d, 63 | cowplot, 64 | doRNG, 65 | energy, 66 | geomtextpath, 67 | ggfortify, 68 | ggpubr, 69 | ggraph, 70 | ggrepel, 71 | ggsci, 72 | globaltest, 73 | gplots, 74 | gridGraphics, 75 | htmlwidgets, 76 | iheatmapr, 77 | ks, 78 | mixOmics, 79 | omicade4, 80 | parmigene, 81 | plotly, 82 | psych, 83 | randomForest, 84 | rgl, 85 | tibble, 86 | tidyr, 87 | edgeR 88 | VignetteBuilder: knitr 89 | -------------------------------------------------------------------------------- /MicrobiomeAnalystR.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | BuildType: Package 16 | PackageUseDevtools: Yes 17 | PackageInstallArgs: --no-multiarch --with-keep.source 18 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(.readDataTable) 4 | export(AddErrMsg) 5 | export(ApplyAbundanceFilter) 6 | export(ApplyAbundanceFilterMeta) 7 | export(ApplyMetaboFilter) 8 | export(ApplyVarianceFilter) 9 | export(ApplyVarianceFilterMeta) 10 | export(CalculateHyperScore) 11 | export(CheckMetaDataIntegrity) 12 | export(CompareSummaryStats) 13 | export(CoreMicrobeAnalysis) 14 | export(CreateFooter) 15 | export(CreateMDPRnwReport) 16 | export(CreatePhyloseqObj) 17 | export(CreatePhyloseqObjMeta) 18 | export(CreateRHistAppendix) 19 | export(CreateSDPRnwReport) 20 | export(CrossReferencing) 21 | export(FeatureCorrelation) 22 | export(GenerateTemplates) 23 | export(GetColorSchema) 24 | export(GetDataForPie) 25 | export(GetErrMsg) 26 | export(GetFinalNameMap) 27 | export(GetGeneListStat) 28 | export(GetMapTable) 29 | export(GetORATable) 30 | export(GetRFConf.Table) 31 | export(GetSeriesColors) 32 | export(GetSigTable.Corr) 33 | export(GetSigTable.LEFSE) 34 | export(GetSigTable.METAGENOSEQ) 35 | export(GetSigTable.RNASeq) 36 | export(GetSigTable.UNIVAR) 37 | export(Init.DataMeta) 38 | export(Init.mbSetObj) 39 | export(Match.Pattern) 40 | export(MergeDatasets) 41 | export(PCoA3D.Anal) 42 | export(PCoA3DAnal.16SRef) 43 | export(Perform16FunAnot_mem) 44 | export(PerformAlphaDiversityComp) 45 | export(PerformBatchCorrection) 46 | export(PerformBetaDiversity) 47 | export(PerformCategoryComp) 48 | export(PerformDEAnalyse) 49 | export(PerformKOEnrichAnalysis_KO01100) 50 | export(PerformKOProjection) 51 | export(PerformKOmapping) 52 | export(PerformLefseAnal) 53 | export(PerformMantelTest) 54 | export(PerformMetaEffectSize) 55 | export(PerformMetaboNormalization) 56 | export(PerformMetagenomeSeqAnal) 57 | export(PerformNetworkCorrelation) 58 | export(PerformNormalization) 59 | export(PerformNormalizationMeta) 60 | export(PerformPartialCorr) 61 | export(PerformRNAseqDE) 62 | export(PerformRarefaction) 63 | export(PerformRefDataMapping) 64 | export(PerformUnivarTest) 65 | export(PlotAlphaBoxData) 66 | export(PlotAlphaData) 67 | export(PlotBetaSummary) 68 | export(PlotBoxData) 69 | export(PlotBoxDataCorr) 70 | export(PlotCorr) 71 | export(PlotDataPieFromPie) 72 | export(PlotEnrichNet.Overview) 73 | export(PlotFunAnotSummary) 74 | export(PlotFunctionStack) 75 | export(PlotGroupPieGraph) 76 | export(PlotHeatmap) 77 | export(PlotImpVarLEfSe) 78 | export(PlotLEfSeSummary) 79 | export(PlotLibSizeView) 80 | export(PlotMetaDensity) 81 | export(PlotMetaPCA) 82 | export(PlotOverallPieGraph) 83 | export(PlotPCAView) 84 | export(PlotPhylogeneticTree) 85 | export(PlotPiechart) 86 | export(PlotRF.Classify) 87 | export(PlotRF.VIP) 88 | export(PlotRareCurve) 89 | export(PlotRarefactionCurve) 90 | export(PlotSampleTaxaAundanceBar) 91 | export(PlotSelectedSample) 92 | export(PlotTaxaAbundanceArea) 93 | export(PlotTaxaAbundanceBarSamGrp) 94 | export(PlotTaxaAundanceBar) 95 | export(PlotTreeGraph) 96 | export(PlotUsrRefPCoA3DScore) 97 | export(PrepareEnrichNet) 98 | export(PrepareHeatTreePlot) 99 | export(PrepareHeatTreePlotDataParse_cmf) 100 | export(PrepareHeatTreePlotDataParse_cmf_diff_table) 101 | export(PrepareHeatTreePlotDataParse_cmf_plot) 102 | export(PrepareMergedData) 103 | export(PreparePCA4Shotgun) 104 | export(PreparePDFReport) 105 | export(PrepareQueryJson) 106 | export(RF.Anal) 107 | export(Read16SAbundData) 108 | export(Read16SAbundDataMeta) 109 | export(Read16SBiomData) 110 | export(Read16STabData) 111 | export(Read16STaxaTable) 112 | export(Read16STaxaTableMeta) 113 | export(ReadMetabolicTable) 114 | export(ReadMothurData) 115 | export(ReadSampleTable) 116 | export(ReadSampleTableMeta) 117 | export(ReadSampleTableMetaInd) 118 | export(ReadShotgunBiomData) 119 | export(ReadShotgunTabData) 120 | export(ReadTreeFile) 121 | export(RunFastSpar) 122 | export(SanityCheckData) 123 | export(SanityCheckDataMeta) 124 | export(SanityCheckMetData) 125 | export(SanityCheckSampleData) 126 | export(SanityCheckSampleDataMeta) 127 | export(SavePiechartImg) 128 | export(SetDataTypeOfMeta) 129 | export(SetMetaAttributes) 130 | export(SetModuleType) 131 | export(SetTaxonSetLib) 132 | export(Setup.MapData) 133 | export(UpdateConfItems) 134 | export(UpdateListInput) 135 | export(UpdatePieData) 136 | export(UpdateSampleItems) 137 | import(DESeq2) 138 | import(MASS) 139 | import(RColorBrewer) 140 | import(Tax4Fun) 141 | import(ape) 142 | import(biomformat) 143 | import(data.table) 144 | import(edgeR) 145 | import(genefilter) 146 | import(ggfortify) 147 | import(ggplot2) 148 | import(grid) 149 | import(gridExtra) 150 | import(igraph) 151 | import(metacoder) 152 | import(metagenomeSeq) 153 | import(pheatmap) 154 | import(phyloseq) 155 | import(ppcor) 156 | import(randomForest) 157 | import(reshape) 158 | import(stringr) 159 | import(taxa) 160 | import(vegan) 161 | import(viridis) 162 | import(xtable) 163 | importFrom(grDevices,colorRampPalette) -------------------------------------------------------------------------------- /R/general_load_libs.R: -------------------------------------------------------------------------------- 1 | # Load phyloseq (note, the server is slim version) 2 | load_phyloseq <- function(){ 3 | suppressMessages(library(phyloseq)) 4 | } 5 | 6 | # Load metacoder 7 | load_metacoder <- function(){ 8 | suppressMessages(library(metacoder)) 9 | } 10 | 11 | # Load biomformat 12 | load_biomformat <- function(){ 13 | suppressMessages(library(biomformat)) 14 | } 15 | 16 | # Load R color brewer 17 | load_rcolorbrewer <- function(){ 18 | suppressMessages(library(RColorBrewer)) 19 | } 20 | 21 | # Load ggplot2 22 | load_ggplot <- function(){ 23 | suppressMessages(library(ggplot2)) 24 | } 25 | 26 | load_ggrepel <- function(){ 27 | suppressMessages(library(ggrepel)) 28 | } 29 | 30 | # Load gplots 31 | load_gplots <- function(){ 32 | suppressMessages(library(gplots)) 33 | } 34 | 35 | # Load cairo 36 | load_cairo <- function(){ 37 | suppressMessages(library(Cairo)) 38 | } 39 | 40 | # Load igraph 41 | load_igraph <- function(){ 42 | suppressMessages(library(igraph)) 43 | } 44 | 45 | # Load biocparallel 46 | load_biocparallel <- function(){ 47 | suppressMessages(library(BiocParallel)) 48 | } 49 | 50 | # Load randomforest 51 | load_randomforest <- function(){ 52 | suppressMessages(library(randomForest)) 53 | } 54 | 55 | # Load metagenomeSeq 56 | load_metagenomeseq <- function(){ 57 | suppressMessages(library(metagenomeSeq)) 58 | } 59 | 60 | # Load MASS 61 | load_MASS <- function(){ 62 | suppressMessages(library(MASS)) 63 | } 64 | 65 | # Load deseq2 66 | load_deseq <- function(){ 67 | suppressMessages(library(DESeq2)) 68 | } 69 | 70 | # Load vegan 71 | load_vegan <- function(){ 72 | suppressMessages(library(vegan)) 73 | } 74 | 75 | # Load ggfortify 76 | load_ggfortify <- function(){ 77 | suppressMessages(library(ggfortify)) 78 | } 79 | 80 | # Load pheatmap 81 | load_pheatmap <- function(){ 82 | suppressMessages(library(pheatmap)) 83 | } 84 | load_iheatmapr <- function(){ 85 | suppressMessages(library(iheatmapr)) 86 | } 87 | 88 | # Load xtable 89 | load_xtable <- function(){ 90 | suppressMessages(library(xtable)) 91 | } 92 | 93 | # Load data.table 94 | load_datatable <- function(){ 95 | suppressMessages(library(data.table)) 96 | } 97 | 98 | # Load reshape 99 | load_reshape <- function(){ 100 | suppressMessages(library(reshape)) 101 | } 102 | 103 | # Load stringr 104 | load_stringr <- function(){ 105 | suppressMessages(library(stringr)) 106 | } 107 | 108 | # Load ape 109 | load_ape <- function(){ 110 | suppressMessages(library(ape)) 111 | } 112 | 113 | # Load Tax4Fun 114 | load_tax4fun <- function(){ 115 | suppressMessages(library(Tax4Fun)) 116 | } 117 | 118 | # Load grid 119 | load_grid <- function(){ 120 | suppressMessages(library(grid)) 121 | } 122 | 123 | # Load gridExtra 124 | load_gridExtra <- function(){ 125 | suppressMessages(library(gridExtra)) 126 | } 127 | 128 | # Load splitstackshape 129 | load_splitstackshape <- function(){ 130 | suppressMessages(library(splitstackshape)) 131 | } 132 | 133 | # Load edgeR 134 | load_edgeR <- function(){ 135 | suppressMessages(library(edgeR)) 136 | } 137 | 138 | # Load globaltest 139 | load_globaltest <- function(){ 140 | suppressMessages(library(globaltest)) 141 | } 142 | 143 | # Load viridis 144 | load_viridis <- function(){ 145 | suppressMessages(library(viridis)) 146 | } 147 | 148 | # Load ppcor 149 | load_ppcor <- function(){ 150 | suppressMessages(library(ppcor)) 151 | } 152 | 153 | # Load ggraph 154 | load_ggraph <- function(){ 155 | suppressMessages(library(ggraph)) 156 | } 157 | 158 | # Load visNetwork 159 | load_visNetwork <- function(){ 160 | suppressMessages(library(visNetwork)) 161 | } 162 | -------------------------------------------------------------------------------- /R/meta_qc.R: -------------------------------------------------------------------------------- 1 | 2 | #'Plot PCA plot for meta-analysis samples 3 | #'@description 4 | #'@param imgNm name of the image to output 5 | #'@author Jeff Xia \email{jeff.xia@mcgill.ca} 6 | #'McGill University, Canada 7 | #'License: GNU GPL (>= 2) 8 | #'@export 9 | #' 10 | 11 | PlotMetaPCA <- function(imgNm, dpi, format,factor="NA"){ 12 | microbiome.meta <- qs::qread("microbiome_meta.qs"); 13 | x <- microbiome.meta[["data"]]; 14 | dpi <- as.numeric(dpi); 15 | #imgNm <- paste(imgNm, "_dpi", dpi, ".", format, sep=""); 16 | imgNm <- paste(imgNm, ".", format, sep=""); 17 | require('lattice'); 18 | require('ggplot2'); 19 | pca <- prcomp(t(na.omit(x))); 20 | imp.pca<-summary(pca)$importance; 21 | xlabel <- paste0("PC1"," (", 100*round(imp.pca[2,][1], 3), "%)") 22 | ylabel <- paste0("PC2"," (", 100*round(imp.pca[2,][2], 3), "%)") 23 | names <- colnames(x); 24 | pca.res <- as.data.frame(pca$x); 25 | # increase xlim ylim for text label 26 | xlim <- GetExtendRange(pca.res$PC1); 27 | ylim <- GetExtendRange(pca.res$PC2); 28 | 29 | #print(dim(pca.res)); 30 | 31 | if(factor == "NA"){ 32 | Conditions <- factor(microbiome.meta$cls.lbl); 33 | }else{ 34 | Conditions <- factor(microbiome.meta$cls.lbl); #temporarily 35 | } 36 | Datasets <- factor(microbiome.meta$data.lbl) 37 | pca.res$Conditions <- Conditions; 38 | pca.res$Datasets <- Datasets; 39 | pcafig <- ggplot(pca.res, aes(x=PC1, y=PC2, color=Conditions ,shape=Datasets)) + 40 | geom_point(size=4, alpha=0.5) + 41 | xlim(xlim)+ ylim(ylim) + 42 | xlab(xlabel) + ylab(ylabel) + 43 | theme_bw() 44 | 45 | Cairo(file=imgNm, width=9, height=8, type=format, bg="white", unit="in", dpi=dpi); 46 | print(pcafig); 47 | dev.off(); 48 | 49 | } 50 | 51 | #'Plot density plot of datasets in meta-analysis module 52 | #'@description 53 | #'@param imgNm name of the image to output 54 | #'@param format File format of output image (default to png) 55 | #'@param dpi dots per inch resolution of image (default 72) 56 | #'@author Jeff Xia \email{jeff.xia@mcgill.ca} 57 | #'McGill University, Canada 58 | #'License: GNU GPL (>= 2) 59 | #'@export 60 | #' 61 | PlotMetaDensity<- function(imgNm, dpi=72, format="png", factor=""){ 62 | require("ggplot2") 63 | microbiome.meta <- qs::qread("microbiome_meta.qs"); 64 | dat <- microbiome.meta$data; 65 | #imgNm <- paste(imgNm, "_dpi", dpi, ".", format, sep=""); 66 | imgNm <- paste(imgNm, ".", format, sep=""); 67 | dpi <- as.numeric(dpi); 68 | 69 | df <- data.frame(microbiome.meta$data, stringsAsFactors = FALSE); 70 | df <- stack(df); 71 | 72 | Factor <- microbiome.meta$data.lbl; 73 | 74 | conv <- data.frame(ind=colnames(microbiome.meta$data), class=Factor); 75 | conv$ind <- gsub("-", ".", conv$ind); 76 | df1 <- merge(df, conv, by="ind"); 77 | Cairo(file=imgNm, width=10, height=6, type=format, bg="white", dpi=dpi, unit="in"); 78 | g =ggplot(df1, aes(x=values)) + 79 | geom_line(aes(color=class, group=ind), stat="density", alpha=0.3) + 80 | geom_line(aes(color=class), stat="density", alpha=0.6, size=1.5) + 81 | theme_bw() 82 | print(g); 83 | dev.off(); 84 | } 85 | 86 | 87 | #'Perform batch correction of meta-analysis datasets 88 | #'@description 89 | #'@author Jeff Xia \email{jeff.xia@mcgill.ca} 90 | #'McGill University, Canada 91 | #'License: GNU GPL (>= 2) 92 | #'@export 93 | #' 94 | PerformBatchCorrection <- function(){ 95 | .prepare.batch(); 96 | .perform.computing(); 97 | return(dataSets); 98 | # no need to , already done 99 | } 100 | 101 | 102 | .prepare.batch<-function(){ 103 | my.fun <- function(){ 104 | require('MMUPHin'); 105 | require('phyloseq'); 106 | phyobj <- qs::qread("merged.data.qs"); 107 | #phyobj <- subsetPhyloseqByDataset(NA, phyobj); 108 | sam.data <- as.data.frame(as.matrix(sample_data(phyobj))); 109 | 110 | cov <- colnames(sam.data)[1]; 111 | otu.tbl <- otu_table(phyobj); 112 | #print(cov); 113 | 114 | microbiome.meta <- qs::qread("microbiome_meta.qs"); 115 | data.lbl <- microbiome.meta$data.lbl; 116 | 117 | fit_adjust_batch <- adjust_batch(feature_abd = otu.tbl, 118 | batch = "dataset", 119 | covariates = cov, 120 | data = sam.data, 121 | control = list(verbose = FALSE)) 122 | 123 | adj.otu.tbl <- fit_adjust_batch$feature_abd_adj; 124 | phyobj@otu_table <- otu_table(adj.otu.tbl, taxa_are_rows = TRUE); 125 | 126 | qs::qsave(phyobj, "merged.data.norm.qs"); 127 | microbiome.meta$data <- adj.otu.tbl; 128 | qs::qsave(microbiome.meta, "microbiome_meta.qs"); 129 | merged.data <- transform_sample_counts(phyobj, function(x) x / sum(x) ); 130 | qs::qsave(merged.data, "merged.data.qs"); 131 | } 132 | dat.in <- list(my.fun=my.fun); 133 | qs:::qsave(dat.in, file="dat.in.qs"); 134 | return(1); 135 | } 136 | 137 | -------------------------------------------------------------------------------- /R/utils_dimreduction.R: -------------------------------------------------------------------------------- 1 | ################################################## 2 | ## R script for MicrobiomeAnalyst 3 | ## Description: Compute dimension reduction 4 | ## Authors: 5 | ## G. Zhou (guangyan.zhou@mail.mcgill.ca) 6 | ## Y. Lu 7 | ## J. Xia, jeff.xia@mcgill.ca 8 | ################################################### 9 | #procrustes or diablo 10 | my.reduce.dimension <- function(mbSetObj, reductionOpt= "procrustes", method="globalscore", dimn=10,analysisVar, diabloPar=0.2){ 11 | mbSetObj <- .get.mbSetObj(mbSetObj); 12 | if(method == ""){ 13 | method="globalscore" 14 | } 15 | dimn = as.numeric(dimn); 16 | 17 | d.list = vector("list",length = 2) 18 | names(d.list) <- c("mic","met") 19 | omics.type = vector(); 20 | featureNms <- vector(); 21 | combined.res <- list() 22 | 23 | omics.type <- c("microbiome","metabolomics") 24 | 25 | if(!exists("phyloseq_objs")){ 26 | phyloseq_objs <- qs::qread("phyloseq_objs.qs") 27 | } 28 | 29 | d.list[["mic"]] = list() 30 | d.list[["mic"]][["data.proc"]] = phyloseq_objs$count_tables 31 | if(micDataType=='ko'){ 32 | d.list[["mic"]][["comp.res"]] = current.proc$mic$res_deAnal[,c(3,4,1)] 33 | names(d.list[["mic"]][["comp.res"]])[3] = "T.Stats" 34 | d.list[["mic"]][["comp.res"]] = list(OTU=d.list[["mic"]][["comp.res"]]) 35 | d.list[["mic"]][["enrich.nms"]] = list(OTU=rownames(current.proc$mic$res_deAnal)) 36 | 37 | }else{ 38 | d.list[["mic"]][["comp.res"]] = lapply(phyloseq_objs$res_deAnal, function(x){names(x)[1] ="T.Stats"; return(x[,c(3,4,1)])}) 39 | d.list[["mic"]][["enrich.nms"]] = lapply(phyloseq_objs$res_deAnal ,function(x) rownames(x)) 40 | } 41 | d.list[["mic"]][["meta"]] = data.frame(mbSetObj$dataSet$sample_data) 42 | 43 | d.list[["met"]] = list() 44 | d.list[["met"]][["data.proc"]] = current.proc$met$data.proc 45 | d.list[["met"]][["comp.res"]] = current.proc$met$res_deAnal[,c(1:3)] #comp.res 46 | d.list[["met"]][["enrich.nms"]] = rownames(current.proc$met$res_deAnal) 47 | d.list[["met"]][["meta"]] = data.frame(mbSetObj$dataSet$sample_data) 48 | 49 | newmeta <- rbind( d.list[["mic"]][["meta"]],d.list[["met"]][["meta"]]) 50 | comp.res1 = lapply( d.list[["mic"]][["comp.res"]],function(x) rbind(x, d.list[["met"]][["comp.res"]]) ) 51 | 52 | enrich.nms1 = lapply(d.list[["mic"]][["enrich.nms"]],function(x) c(x, d.list[["met"]][["enrich.nms"]]) ) 53 | comp.res.inx1 =lapply(d.list[["mic"]][["comp.res"]],function(x) c(rep(1,nrow(x)), rep(2,nrow( d.list[["met"]][["comp.res"]])) )); 54 | featureNms <- lapply( d.list[["mic"]][["data.proc"]] ,function(x) c(rownames(x), rownames(d.list[["met"]][["data.proc"]]) )); 55 | 56 | combined.res$comp.res = comp.res1 57 | combined.res$enrich_ids = enrich.nms1 58 | combined.res$comp.res.inx = comp.res.inx1 59 | combined.res$meta = newmeta 60 | if(reductionOpt == "diablo"){ 61 | library(mixOmics) 62 | diablo.meta.type <- mbSetObj$dataSet$meta.types[analysisVar] 63 | diabloPar <- as.numeric(diabloPar); #default diabloPar was 0.2 64 | diablo.res <- list() 65 | dats <- vector("list",length=length(d.list$mic$data.proc)) 66 | names(dats) <- names(d.list$mic$data.proc) 67 | 68 | res <- pos.xyz <- pos.xyz2 <- misc <- loading.pos.xyz <- loadingNames <- vector("list",length=length(d.list$mic$data.proc)) 69 | names(res) <- names(pos.xyz) <- names(pos.xyz2) <- names(misc) <- 70 | names(loading.pos.xyz) <- names(loadingNames) <- names(d.list$mic$data.proc) 71 | 72 | for(l in 1:length(dats)){ 73 | 74 | dats[[l]][["mic"]] <- d.list$mic$data.proc[[l]] 75 | dats[[l]][["met"]] <- d.list$met$data.proc 76 | dats[[l]]= lapply(dats[[l]], function(x){ 77 | x <- data.frame(x, stringsAsFactors = FALSE); 78 | x <- t(x); 79 | }) 80 | ncomp = min(ncol(dats[[l]]$mic),dimn) 81 | if(diablo.meta.type == "disc"){ 82 | Y <- current.proc$meta_para$sample_data[,analysisVar]; 83 | design = matrix(diabloPar, ncol = length(dats[[l]]), nrow = length(dats[[l]]), 84 | dimnames = list(names(dats[[l]]), names(dats[[l]]))); 85 | 86 | diag(design) = 0; 87 | res[[l]] = block.splsda(X = dats[[l]], Y = Y, ncomp = ncomp, design = design,near.zero.var = T) 88 | } else { 89 | meta.var <- current.proc$meta_para$sample_data[,analysisVar]; 90 | Y <- matrix(as.numeric(as.character(meta.var))); 91 | rownames(Y) <- rownames(current.proc$meta_para$sample_data); 92 | design = matrix(diabloPar, ncol = length(dats[[l]]), nrow = length(dats[[l]]), 93 | dimnames = list(names(dats[[l]]), names(dats[[l]]))); 94 | diag(design) = 0; 95 | res[[l]] = block.splsda(X = data.list, Y = Y, ncomp = ncomps, design = design, mode = "regression", near.zero.var = T) 96 | } 97 | 98 | pos.xyz[[l]] <- res[[l]]$variates[[1]] 99 | pos.xyz2[[l]] <- res[[l]]$variates[[2]] 100 | 101 | for(i in 1:length(res[[l]]$loadings)){ 102 | pos = as.data.frame(res[[l]]$loadings[[i]]) 103 | rn <- rownames(res[[l]]$loadings[[i]]) 104 | pos <- unitAutoScale(pos); 105 | res[[l]]$loadings[[i]] <- pos 106 | rownames(res[[l]]$loadings[[i]]) <- rn 107 | } 108 | 109 | loading.pos.xyz[[l]] <- rbind(res[[l]]$loadings[[1]], res[[l]]$loadings[[2]]) 110 | #rownames(loading.pos.xyz[[l]]) = c(rownames(d.list$mic$data.proc[[l]]), rownames(d.list$met$data.proc)) 111 | loadingNames[[l]]=rownames(loading.pos.xyz[[l]]) 112 | names = lapply(pos.xyz, function(x) rownames(x)) 113 | newmeta = current.proc$meta_para$sample_data 114 | 115 | if("prop_expl_var" %in% names(res[[l]])){ 116 | var.vec <- res[[l]]$prop_expl_var 117 | }else if("explained_variance" %in% names(res[[l]])){ 118 | var.vec <- res[[l]]$explained_variance 119 | }else{ 120 | var.vec <- 0; 121 | } 122 | 123 | misc[[l]]$pct2[["microbiome"]] = unname(signif(as.numeric(var.vec[['mic']],4)))*100 124 | misc[[l]]$pct2[["metabolomics"]] = unname(signif(as.numeric(var.vec[['met']],4)))*100 125 | 126 | } 127 | 128 | }else if(reductionOpt == "procrustes"){ 129 | library(vegan) 130 | ndat1 <- lapply(d.list$mic$data.proc,function(x) decostand(t(x), method = "standardize")) 131 | pca.dat1 <- lapply(ndat1,function(x) rda(x)) 132 | ndat2 <- decostand(t(d.list$met$data.proc), method = "standardize") 133 | pca.dat2 <- rda(ndat2) 134 | 135 | choicesVec = c(1,2,3) 136 | res= lapply(pca.dat1,function(x) procrustes(x, pca.dat2, choices=choicesVec, symmetric = T, scale = TRUE)) 137 | res2= lapply(pca.dat1,function(x) protest(X = x, Y = pca.dat2, scores = "sites", permutations = 999) ) 138 | 139 | misc <- list(`Sum of Squares`=lapply(res2,function(x) x$ss), 140 | Significance = lapply(res2,function(x) x$signif), 141 | Correlation =lapply(res2,function(x) x$scale)) 142 | 143 | 144 | pos.xyz = lapply(res,function(x) rbind(x$X, x$Yrot)) 145 | names = lapply(pos.xyz,function(x) make.unique(as.character(rownames(x)))) 146 | newmeta$omics[c(1:(length(names[[1]])/2))] = "microbiome" 147 | newmeta$omics[c( ((length(names[[1]])/2)+1) : (length(names[[1]])))] = "metabolomics" 148 | dim.res <- misc <- vector("list",length=length(res)) 149 | names(dim.res) <- names(misc) <- names(res) 150 | for(i in 1:length(dim.res)){ 151 | dim.res[[i]] <- list(res[[i]],res2[[i]]) 152 | misc[[i]] <- list(`Sum of Squares`=res2[[i]]$ss, 153 | Significance = res2[[i]]$signif, 154 | Correlation =res2[[i]]$scale) 155 | 156 | } 157 | 158 | procrustes.res <- list(misc=misc,dim.res=dim.res) 159 | procrustes.res$pos.xyz = lapply(pos.xyz,function(x) unitAutoScale(x)) 160 | procrustes.res$newmeta = newmeta 161 | combined.res$meta = newmeta 162 | qs::qsave(combined.res,"combined.res.qs") 163 | qs::qsave(procrustes.res,"procrustes.res.qs") 164 | } 165 | 166 | pos.xyz <- lapply(pos.xyz,function(x) as.data.frame(x)[,c(1:3)]); 167 | pos.xyz <- lapply(pos.xyz,function(x) unitAutoScale(x)); 168 | pos.xyz <- lapply(pos.xyz, "rownames<-", names[[1]]); 169 | 170 | if(reductionOpt %in% c("diablo")){ 171 | names2 <- lapply(pos.xyz2, function(x) rownames(x)) 172 | pos.xyz <- lapply(pos.xyz,function(x) as.data.frame(x)[,c(1:3)]); 173 | pos.xyz2 <- lapply(pos.xyz2, function(x) unitAutoScale(x)); 174 | pos.xyz2 <- lapply(pos.xyz2, "rownames<-", names2[[1]]); 175 | } 176 | 177 | 178 | 179 | 180 | if(reductionOpt != "procrustes"){ 181 | hit.inx <- mapply(function(x,y){ 182 | match(x,y) 183 | },loadingNames, combined.res$enrich_ids); 184 | loadingSymbols <- mapply(function(x,y){ 185 | y[x] 186 | },hit.inx, combined.res$enrich_ids); 187 | if(micDataType=="ko"){ 188 | loadingSymbols=list(OTU=loadingSymbols) 189 | } 190 | } 191 | if(reductionOpt == "diablo"){ 192 | loading.pos.xyz = lapply(loading.pos.xyz,as.data.frame) 193 | loading.pos.xyz <- lapply(loading.pos.xyz,unitAutoScale); 194 | 195 | diablo.res$dim.res <- res 196 | diablo.res$pos.xyz <- pos.xyz 197 | diablo.res$pos.xyz2 <- pos.xyz2 198 | diablo.res$misc <- misc 199 | diablo.res$loading.pos.xyz <- loading.pos.xyz 200 | diablo.res$loadingNames <- loadingNames 201 | diablo.res$loading.enrich = loadingSymbols 202 | diablo.res$newmeta=newmeta 203 | qs::qsave(combined.res,"combined.res.qs") 204 | qs::qsave(diablo.res,"diablo.res.qs") 205 | 206 | } 207 | reductionOptGlobal <<- reductionOpt; 208 | 209 | mbSetObj$analSet$dimrdc<-reductionOpt; 210 | 211 | .set.mbSetObj(mbSetObj); 212 | 213 | return(1) 214 | } 215 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /R/utils_fastspar.R: -------------------------------------------------------------------------------- 1 | ################################################## 2 | ## R script for MicrobiomeAnalyst 3 | ## Functions for SparCC 4 | ################################################## 5 | 6 | my.fast.spar <- function(mbSetObj, taxrank, permNum, pvalCutoff, corrCutoff, output="network", opt="corr"){ 7 | 8 | # only works for unix 9 | my.os <- tolower(GetOS()); 10 | 11 | if(my.os == "mac" | my.os == "windows"){ 12 | AddErrMsg("The built-in fastspar only works for unix system. Please visit https://github.com/scwatts/fastspar for more details."); 13 | return(0); 14 | } 15 | 16 | if(.on.public.web){ 17 | spar_home <- paste0(rpath, "lib/fastspar/"); 18 | }else if (file.exists("/home/jasmine/Downloads/fastspar/fastspar")){ #jas local 19 | spar_home <- "/home/jasmine/Downloads/fastspar/" 20 | }else{ 21 | spar_home <- "https://www.microbiomeanalyst.ca/MicrobiomeAnalyst/resources/lib/fast_spar/" 22 | } 23 | 24 | path_fastspar <- paste(spar_home, "fastspar", sep=""); 25 | path_fastspar_bs <- paste(spar_home, "fastspar_bootstrap", sep=""); 26 | path_fastspar_pvals <- paste(spar_home, "fastspar_pvalues", sep=""); 27 | 28 | # make sure they are executable 29 | my.cmd <- paste("chmod a+x", path_fastspar, path_fastspar_bs, path_fastspar_pvals); 30 | system(my.cmd); 31 | 32 | mbSetObj <- .get.mbSetObj(mbSetObj); 33 | if(.on.public.web){ 34 | load_igraph(); 35 | } 36 | 37 | if(opt == "pattern"){ 38 | data1 <- qs::qread("pattern_data.qs") 39 | }else{ 40 | # first get OTU table to BIOM TSV format 41 | if(mbSetObj$module.type=="sdp"){ 42 | data1 <- as.matrix(otu_table(mbSetObj$dataSet$norm.phyobj)); 43 | taxrank <- "OTU"; 44 | }else if(mbSetObj$module.type=="mdp"){ 45 | if(!exists("phyloseq_objs")){ 46 | phyloseq_objs <- qs::qread("phyloseq_objs.qs") 47 | } 48 | 49 | if(taxrank=="OTU"){ 50 | data1 <- phyloseq_objs$count_tables$OTU 51 | }else{ 52 | taxrank.inx <- which(names(phyloseq_objs$count_tables) %in% taxrank) 53 | data1 <- phyloseq_objs$count_tables[[taxrank.inx]] 54 | } 55 | } 56 | } 57 | 58 | if(opt=="corr"){ 59 | qs::qsave(data1, "sparcc_full_data.qs") 60 | } 61 | 62 | if(!is.null(mbSetObj$dataSet$selected.grps) & opt == "corr"){ 63 | data1 <- data1[,which(colnames(data1) %in% mbSetObj$dataSet$selected.grps)] 64 | } 65 | 66 | # filter data if necessary 67 | abund_filtered <- mbSetObj$dataSet$ab.filtered 68 | var_filtered <- mbSetObj$dataSet$var.filtered 69 | 70 | feat_num <- nrow(data1) 71 | 72 | # if number of feats is greater than 500, do filtering of poorly represented OTUs 73 | # first, do low count filtering 74 | if(feat_num > 500 & !abund_filtered){ 75 | minLen <- 0.2*ncol(data1); # filter out feats that do not have a minimum count of 4 in at least 20 percent of samples 76 | kept.inx <- apply(data1, MARGIN = 1,function(x) {sum(x >= 4) >= minLen}); 77 | data1 <- data1[kept.inx, ]; 78 | } 79 | 80 | # second, do low variance filtering 81 | if(feat_num > 500 & !var_filtered){ 82 | filter.val <- apply(data1, 1, IQR, na.rm=T); 83 | rk <- rank(-filter.val, ties.method='random'); 84 | remain <- rk < feat_num*(1-0.1); # filter out 10% of low variance feats based on IQR 85 | data1 <- data1[remain,]; 86 | } 87 | 88 | # third, if still over 500 feats, rank and keep top 500 89 | if(feat_num > 500){ 90 | filter.val <- apply(data1, 1, IQR, na.rm=T); 91 | rk <- rank(-filter.val, ties.method='random'); 92 | remain <- rk < 500; 93 | data1 <- data1[remain,]; 94 | current.msg <<- "Only the top 500 features are kept, ranked by their variance!" 95 | } 96 | 97 | # replace zeros with random numbers based on lowest non-zero count 98 | 99 | set.seed(12345) 100 | 101 | if(opt %in% c("corr", "feat")){ 102 | lowest.count <- min(apply(data1, 1, FUN = function(x) {min(x[x > 0])})) 103 | }else{ #only pattern searching 104 | lowest.count <- min(apply(data1[-nrow(data1),], 1, FUN = function(x) {min(x[x > 0])})) 105 | } 106 | 107 | # replacements 108 | replacements <- apply(data1, 1, function(x) { (sample(1:lowest.count, size=sum(x==0), replace = F))/lowest.count} ) 109 | 110 | # this works for rows 111 | replaced <- vector(length = nrow(data1), "list") 112 | 113 | for(i in 1:nrow(data1)){ 114 | replaced[[i]] <- replace(as.vector(data1[i,]), as.vector(data1[i,]==0), replacements[[i]]) 115 | } 116 | 117 | zero.output <- matrix(unlist(replaced), ncol = ncol(data1), byrow = TRUE) 118 | colnames(zero.output) <- colnames(data1) 119 | rownames(zero.output) <- rownames(data1) 120 | 121 | if(opt=="corr"){ 122 | qs::qsave(zero.output, "sparcc_data.qs") 123 | } 124 | 125 | # add header 126 | new_col <- c("#OTU ID", colnames(zero.output)) 127 | data <- cbind(rownames(zero.output), zero.output) 128 | colnames(data) <- new_col 129 | 130 | write.table(data, file="otu_table_corr.tsv", quote=FALSE, row.names = FALSE, sep="\t") 131 | 132 | otu_table <- "otu_table_corr.tsv" 133 | corr_output <- "sparcc_median_correlation.tsv" 134 | cov_output <- "sparcc_median_covariance.tsv" 135 | bootstrap_counts <- "bootstrap_counts" 136 | counts_prefix <- "bootstrap_counts/boot_data" 137 | bootstrap_correlation <- "bootstrap_correlation" 138 | corr_bs_output <- "${jnew}_median_correlation.tsv" 139 | cov_bs_output <- "${k}_median_covariance.tsv" 140 | corr_prefix <- "cor_boot_data_" 141 | test <- "text.txt" 142 | pval_output <- "sparcc_pvals.tsv" 143 | 144 | invisible(system(paste(path_fastspar, "--otu_table", otu_table, "--correlation", corr_output, "--covariance", cov_output, ";", 145 | "mkdir", bootstrap_counts, ";", 146 | path_fastspar_bs, "--otu_table", otu_table, "--number", permNum, "--prefix", counts_prefix, ";", 147 | "find", bootstrap_counts, ">>", test, ";", 148 | "cat", test, "| while read line; do echo $line; j=$(basename ${line}); jnew=$(echo cor_${j}); k=$(echo cov_${j}); jnew=$(echo ${jnew} | sed 's/\\.tsv//'); k=$(echo ${k} | sed 's/\\.tsv//');", path_fastspar, "--otu_table ${line} --correlation", 149 | corr_bs_output, "--covariance", cov_bs_output, "-i 5 ; done;", 150 | path_fastspar_pvals, "--otu_table", otu_table, "--correlation", corr_output, "--prefix", corr_prefix, "--permutations", permNum, "--outfile", pval_output, ";", 151 | "rm cor_boot_data*.tsv; rm cov_boot_data*.tsv;", "rm -rf", bootstrap_counts, "rm -rf text.txt"), intern=TRUE, ignore.stdout=TRUE)) 152 | 153 | sparcc_results <- read.table(file = "sparcc_median_correlation.tsv", sep="\t", stringsAsFactors = FALSE) 154 | names <- sparcc_results[,1] 155 | sparcc_results_new <- as.matrix(sparcc_results[,-1]) 156 | colnames(sparcc_results_new) <- rownames(sparcc_results_new) <- names 157 | 158 | sparcc_pvals <- read.table(file = "sparcc_pvals.tsv", sep="\t", stringsAsFactors = FALSE) 159 | sparcc_pvals_new <- as.matrix(sparcc_pvals[,-1]) 160 | colnames(sparcc_pvals_new) <- rownames(sparcc_pvals_new) <- names 161 | 162 | if(output == "network"){ 163 | sparcc_results_new[sparcc_results_new==0] <- .00001 164 | sparcc_corr <- igraph::as_data_frame(igraph::graph_from_adjacency_matrix(sparcc_results_new, weighted = TRUE)) 165 | sparcc_pvals_new[sparcc_pvals_new==0] <- .00001 166 | sparcc_pvals <- igraph::as_data_frame(igraph::graph_from_adjacency_matrix(sparcc_pvals_new, weighted = TRUE)) 167 | 168 | sparcc_combo <- cbind(sparcc_corr, sparcc_pvals[,3]) 169 | colnames(sparcc_combo) <- c("Taxon1", "Taxon2", "Correlation", "P.Value") 170 | qs::qsave(sparcc_combo, "network_correlation.qs") 171 | 172 | sparcc_combo <- sparcc_combo[(abs(sparcc_combo[,3]) > corrCutoff & sparcc_combo[,4] < pvalCutoff),] 173 | fast.write(sparcc_combo, "correlation_table.csv", row.names = FALSE) 174 | .set.mbSetObj(mbSetObj) 175 | return(sparcc_combo) 176 | }else if(output=="heatmap"){ 177 | .set.mbSetObj(mbSetObj) 178 | return(sparcc_results_new) 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /R/utils_mirkat.R: -------------------------------------------------------------------------------- 1 | ####Functions adapted from the MiRKAT package https://doi.org/10.1093/bioinformatics/btaa951 2 | 3 | 4 | MiRKAT <- function(y, X = NULL, Ks, out_type = "C", 5 | method = "davies", omnibus = "permutation", 6 | nperm = 999, returnKRV = FALSE, returnR2 = FALSE){ 7 | 8 | method <- match.arg(method, choices = c("davies", "permutation", "moment")) 9 | omnibus <- match.arg(tolower(omnibus), choices = c("permutation", "cauchy")) 10 | 11 | n = length(y) 12 | 13 | if (any(is.na(y))){ 14 | ids = which(is.na(y)) 15 | stop(paste("missing response for subject(s)", ids, ", please remove before proceeding \n")) 16 | } 17 | 18 | if(is.null(X)==FALSE){ 19 | if(NROW(X)!= length(y)) stop("Dimensions of X and y don't match.") 20 | } 21 | 22 | if (is.matrix(Ks)) { 23 | Ks = list(Ks) 24 | } 25 | 26 | if (is.list(Ks)) { 27 | if((any(lapply(Ks, "nrow")!= n))|(any(lapply(Ks, "ncol")!= n))){ 28 | stop("Distance matrix need to be n x n, where n is the sample size \n ") 29 | } 30 | if (!is.list(Ks)) { 31 | stop("Distance needs to be a list of n x n matrices or a single n x n matrix \n") 32 | } 33 | } 34 | 35 | 36 | if (!is.null(X)){ 37 | if (any(is.na(X))){ 38 | stop("NAs in covariates X, please impute or remove subjects with missing covariate values") 39 | } 40 | } 41 | 42 | if (method == "moment" & n < 100 & out_type == "C"){ 43 | 44 | warning("Continuous outcome: sample size < 100, p-value using moment matching can be inaccurate at tails, davies or permutation is recommended") 45 | } 46 | if (method == "moment" & n < 200 & out_type == "D"){ 47 | 48 | warning("Continuous outcome: sample size < 200, p-value using moment matching can be inaccurate at tails, davies or permutation is recommended") 49 | } 50 | 51 | if (!(out_type %in% c("C", "D"))){ 52 | stop("Only continuous and binary outcomes are supported by this function. Please choose out_type = \"C\" or \"D\", or use an alternative function for other outcome types.") 53 | } 54 | 55 | library("CompQuadForm"); 56 | if(out_type == "C"){ 57 | re = MiRKAT_continuous(y, X = X, Ks = Ks, method = method, omnibus = omnibus, nperm = nperm, returnKRV = returnKRV, returnR2 = returnR2) 58 | } 59 | 60 | if(out_type == "D"){ 61 | re = MiRKAT_binary(y, X = X, Ks = Ks, method = method, omnibus = omnibus, nperm = nperm, returnKRV = returnKRV, returnR2 = returnR2) 62 | } 63 | 64 | return(re) 65 | } 66 | 67 | MiRKAT_continuous <- function(y, X = NULL, Ks, method, omnibus, 68 | nperm = 999, returnKRV = FALSE, returnR2 = FALSE){ 69 | 70 | om <- substring(tolower(omnibus), 1, 1) 71 | n = length(y) 72 | 73 | if (is.null(X)) { 74 | X1 <- matrix(rep(1, length(y)), ncol=1) 75 | } else { 76 | X1 <- model.matrix(~. , as.data.frame(X)) 77 | } 78 | 79 | KRVs = R2 = NULL 80 | if (returnKRV | returnR2) { 81 | reskrv = scale(resid(lm(y ~ 1))) 82 | L = reskrv %*% t(reskrv) 83 | if (returnKRV) { KRVs <- unlist(lapply(Ks, FUN = function(k) calcKRVstat(k, L))) } 84 | if (returnR2) { R2 <- unlist(lapply(Ks, FUN = function(k) calcRsquared(k, L))) } 85 | } 86 | 87 | ## Prep RHS; take care of aliased variables and pivoting 88 | qX1 <- qr(X1) 89 | X1 <- X1[, qX1$pivot, drop=FALSE] 90 | X1 <- X1[, 1:qX1$rank, drop=FALSE] 91 | 92 | mod <- lm(y ~ X1-1) 93 | s2 = summary(mod)$s**2 94 | D0 = diag(n) 95 | res = resid(mod) 96 | P0 = D0 - X1%*%solve(t(X1)%*%X1)%*%t(X1) 97 | px = ncol(X1) 98 | 99 | ## Individual test statistics 100 | Qs <- c() 101 | for (i in 1:length(Ks)) { 102 | Qs <- c(Qs, getQ(K = Ks[[i]], res, s2)) 103 | } 104 | 105 | ## Permuted test stats 106 | if (method == "permutation" | (length(Ks) > 1 & om == "p")) { 107 | q_sim = sapply(1:nperm, function(i) { 108 | ind <- sample(n) 109 | sapply(1:length(Ks),function(j){ 110 | Q1 = as.numeric(res %*% Ks[[j]][ind, ind] %*% res/s2) 111 | }) 112 | }) 113 | q_sim = t(q_sim) 114 | } 115 | 116 | ## Individual p-values 117 | if (method == "davies") { 118 | lambda0 = lapply(Ks, getLambda_davies, P0) 119 | ps = rep(NA, length(Ks)) 120 | for (i in 1:length(Ks)){ 121 | ps[i] = getindivP_davies(Qs[[i]], lambda0[[i]], n, px) 122 | } 123 | out_pvs = ps 124 | } else if (method == "moment"){ 125 | parm = sapply(Ks, getParamSat, P0, px) 126 | p_sat = rep(NA, length(Ks)) 127 | for (i in 1:length(Ks)){ 128 | p_sat[i] = getSat(Qs[[i]], keppa_tlt = parm[,i]$keppa_tlt, niu_tlt = parm[,i]$niu_tlt) 129 | } 130 | out_pvs = p_sat 131 | } else if (method == substr("permutation", 1, nchar(method))) { 132 | # P = (# of statistics permutation >= observed test statistics + 1) / (#permutation + 1), 133 | # thus the smallest p value will be 1/ (# permutation + 1). 134 | if (length(Ks) > 1) { 135 | Q_all = rbind(unlist(Qs), q_sim) 136 | p_all = 1 - (apply(Q_all, 2, rank) - 1)/(nperm + 1) 137 | p_perm = p_all[1,] 138 | out_pvs = p_perm 139 | } else { 140 | Q_all <- c(unlist(Qs), q_sim) 141 | p_all <- 1 - (rank(Q_all) - 1)/(nperm + 1) 142 | p_perm = p_all[1] 143 | out_pvs <- p_perm 144 | } 145 | 146 | } 147 | 148 | ## name indiv p-values 149 | names(out_pvs) = names(Ks) 150 | 151 | if (length(out_pvs) == 1) { 152 | if (!returnKRV & !returnR2) { 153 | return(list(p_values = out_pvs)) 154 | } else if (!returnKRV & returnR2) { 155 | return(list(p_values = out_pvs, R2 = R2)) 156 | } else if (returnKRV & !returnR2) { 157 | return(list(p_values = out_pvs, KRV = KRVs)) 158 | } else { 159 | return(list(p_values = out_pvs, KRV = KRVs, R2 = R2)) 160 | } 161 | } 162 | 163 | ## calculate omnibus p-value 164 | if (om == "p") { 165 | Q_all = rbind(unlist(Qs), q_sim) 166 | p_all = 1 - (apply(Q_all, 2, rank)-1)/(nperm + 1) 167 | p_perm = p_all[1,] 168 | minP_all= apply(p_all,1, min) 169 | p_final = rank(minP_all)[1]/(nperm + 1) 170 | } else if (om == "c") { 171 | cauchy.t <- sum(tan((0.5 - out_pvs)*pi))/length(out_pvs) 172 | p_final <- 1 - pcauchy(cauchy.t) 173 | } else { 174 | stop("I don't know that omnibus option. Please choose 'permutation' or 'Cauchy'.") 175 | } 176 | 177 | 178 | ## return all 179 | if (is.null(KRVs) & is.null(R2)) { 180 | return(list(p_values = out_pvs , omnibus_p = p_final)) 181 | } else if (is.null(KRVs) & !is.null(R2)) { 182 | return(list(p_values = out_pvs , omnibus_p = p_final, R2 = R2)) 183 | } else if (!is.null(KRVs) & is.null(R2)) { 184 | return(list(p_values = out_pvs , omnibus_p = p_final, KRV = KRVs)) 185 | } else { 186 | return(list(p_values = out_pvs , omnibus_p = p_final, KRV = KRVs, R2 = R2)) 187 | } 188 | } 189 | 190 | # KRV test statistic 191 | calcKRVstat <- function(K, L) { 192 | n = nrow(K) 193 | I.n=diag(1,n) 194 | I.1=rep(1,n) 195 | H=I.n-I.1%*%t(I.1)/n 196 | K=H%*%K%*%H 197 | L=H%*%L%*%H 198 | A=K/tr(K%*%K) ## standard-version of K 199 | W=L/tr(L%*%L) 200 | Fstar=tr(A%*%W) 201 | return(Fstar) 202 | } 203 | 204 | # trace of a matrix 205 | tr<- function(x){return(sum(diag(x))) } 206 | calcRsquared <- function(K, L) { 207 | r1 <- cor(as.numeric(K), as.numeric(L)) 208 | return(r1^2) 209 | } 210 | 211 | getQ <- function(K, res, s2){ 212 | Q = c(1 / s2 * res %*% K %*% res) 213 | } 214 | 215 | getLambda_davies <- function(K, P0){ 216 | PKP = P0 %*% K %*% P0 217 | ee = eigen(PKP, symmetric = T) 218 | lambda0 = ee$values[ee$values > 1e-10] 219 | return(lambda0) 220 | } 221 | 222 | # Continuous outcome individual Davies p-values 223 | getindivP_davies <- function(Q, lambda0, n, px){ 224 | if (length(lambda0) >= n-px){ 225 | # In fact, it can not go bigger than n-p because P0 has rank n-p 226 | lambda = c(lambda0 - c(Q)/(n-px)) 227 | k = length(lambda) 228 | h = rep(1,k) 229 | }else{ 230 | lambda = c(lambda0 - c(Q)/(n-px), c(-Q)/(n-px)) 231 | k = length(lambda0) 232 | h = c(rep(1, k), n-px - k) 233 | } 234 | p_davies = davies(q = 0, lambda = lambda, h = h, acc = 1e-6)$Qq 235 | p_davies = ifelse(p_davies < 0, 0, p_davies) 236 | 237 | return(p_davies) 238 | } 239 | 240 | 241 | D2K <- function(D){ 242 | n <- nrow(D) 243 | centerM <- diag(n) - 1/n 244 | K <- -0.5*centerM %*% (D*D) %*% centerM 245 | eK <- eigen(K, symmetric=TRUE) 246 | K <- eK$vector %*% diag(pmax(0,eK$values)) %*% t(eK$vector) 247 | return(K) 248 | } -------------------------------------------------------------------------------- /R/utils_pcoa3d.R: -------------------------------------------------------------------------------- 1 | ################################################## 2 | ## R script for MicrobiomeAnalyst 3 | ## Description: Functions to create PCoA3D plot 4 | ## Author: Guangyan Zhou, guangyan.zhou@mail.mcgill.ca 5 | ################################################## 6 | 7 | my.pcoa.3d <- function(mbSetObj, ordMeth, distName, taxrank, colopt, variable, taxa, alphaopt, jsonNm){ 8 | 9 | mbSetObj <- .get.mbSetObj(mbSetObj); 10 | load_phyloseq(); 11 | load_vegan(); 12 | 13 | variable <<- variable; 14 | 15 | if(!exists("phyloseq_objs")){ 16 | 17 | phyloseq_objs <- readDataQs("phyloseq_objs.qs",mbSetObj$module.type,mbSetObj$dataSet$name) 18 | } 19 | data <- phyloseq_objs$merged_obj[[taxrank]] 20 | if(is.null(data)){ 21 | AddErrMsg("Errors in projecting to the selected taxanomy level!"); 22 | return(0); 23 | } 24 | 25 | if(colopt=="taxa"){ 26 | if(taxrank=="OTU"){ 27 | data1 <- as.matrix(otu_table(data)); 28 | feat_data <- as.numeric(data1[taxa,]); 29 | }else{ 30 | nm <- as.character(tax_table(data)[,taxrank]); 31 | #converting NA values to unassigned 32 | nm[is.na(nm)] <- "Not_Assigned"; 33 | data1 <- as.matrix(otu_table(data)); 34 | rownames(data1) <- nm; 35 | #all NA club together 36 | data1 <- as.matrix(t(sapply(by(data1,rownames(data1),colSums),identity))); 37 | feat_data <- data1[taxa,]; 38 | } 39 | sample_data(data)$taxa <- feat_data; 40 | indx <- which(colnames(sample_data(data))=="taxa"); 41 | colnames(sample_data(data))[indx] <- taxa; 42 | }else if(colopt=="alphadiv"){ 43 | data1 <- mbSetObj$dataSet$proc.phyobj; 44 | box <- plot_richness(data1, measures = alphaopt); 45 | alphaboxdata <- box$data; 46 | sam_nm <- sample_names(data); 47 | alphaboxdata <- alphaboxdata[alphaboxdata$samples %in% sam_nm,]; 48 | alphaval <- alphaboxdata$value; 49 | sample_data(data)$alphaopt <- alphaval; 50 | indx <- which(colnames(sample_data(data))=="alphaopt"); 51 | colnames(sample_data(data))[indx]<-alphaopt; 52 | }else{ 53 | data<-data; 54 | } 55 | 56 | if(distName=="wunifrac"){ 57 | pg_tree <- qs::qread("tree.qs"); 58 | pg_tb <- tax_table(data); 59 | pg_ot <- otu_table(data); 60 | pg_sd <- sample_data(data); 61 | pg_tree <- prune_taxa(taxa_names(pg_ot), pg_tree); 62 | data <- merge_phyloseq(pg_tb, pg_ot, pg_sd, pg_tree); 63 | 64 | if(!is.rooted(phy_tree(data))){ 65 | pick_new_outgroup <- function(tree.unrooted){ 66 | treeDT <- cbind(cbind(data.table(tree.unrooted$edge),data.table(length = tree.unrooted$edge.length))[1:Ntip(tree.unrooted)], 67 | data.table(id = tree.unrooted$tip.label)); 68 | new.outgroup <- treeDT[which.max(treeDT$length), ]$id 69 | return(new.outgroup); 70 | } 71 | new.outgroup <- pick_new_outgroup(phy_tree(data)); 72 | phy_tree(data) <- ape::root(phy_tree(data), 73 | outgroup = new.outgroup, 74 | resolve.root=TRUE) 75 | } 76 | if(ordMeth=="PCA"){ 77 | GP.ord <- prcomp(t(data@otu_table@.Data), center=TRUE, scale=F) 78 | }else{ 79 | 80 | GP.ord <-ordinate(data,ordMeth,"unifrac",weighted=TRUE); 81 | } 82 | } else if (distName=="unifrac"){ 83 | pg_tree <- qs::qread("tree.qs"); 84 | pg_tb <- tax_table(data); 85 | pg_ot <- otu_table(data); 86 | pg_sd <- sample_data(data); 87 | pg_tree <- prune_taxa(taxa_names(pg_ot), pg_tree); 88 | data <- merge_phyloseq(pg_tb, pg_ot, pg_sd, pg_tree); 89 | 90 | if(!is.rooted(phy_tree(data))){ 91 | pick_new_outgroup <- function(tree.unrooted){ 92 | treeDT <- cbind(cbind(data.table(tree.unrooted$edge),data.table(length = tree.unrooted$edge.length))[1:Ntip(tree.unrooted)], 93 | data.table(id = tree.unrooted$tip.label)); 94 | new.outgroup <- treeDT[which.max(treeDT$length), ]$id 95 | return(new.outgroup); 96 | } 97 | new.outgroup <- pick_new_outgroup(phy_tree(data)); 98 | phy_tree(data) <- ape::root(phy_tree(data), 99 | outgroup = new.outgroup, 100 | resolve.root=TRUE) 101 | } 102 | 103 | if(ordMeth=="PCA"){ 104 | GP.ord <- prcomp(t(data@otu_table@.Data), center=TRUE, scale=F) 105 | }else{ 106 | 107 | GP.ord <-ordinate(data,ordMeth,"unifrac",weighted=FALSE); 108 | } 109 | }else{ 110 | 111 | 112 | if(ordMeth=="PCA"){ 113 | GP.ord <- prcomp(t(data@otu_table@.Data), center=TRUE, scale=F) 114 | }else{ 115 | 116 | GP.ord <- ordinate(data,ordMeth,distName); 117 | } 118 | } 119 | 120 | # obtain variance explained 121 | 122 | if(ordMeth=="PCA"){ 123 | sum.pca <- GP.ord; 124 | sum.pca$vectors <- sum.pca$x; 125 | imp.pca <- summary(GP.ord)$importance; 126 | std.pca <- imp.pca[1,]; # standard devietation 127 | var.pca <- imp.pca[2,]; # variance explained by each PC 128 | cum.pca <- imp.pca[3,]; # cummulated variance explained 129 | 130 | 131 | }else{ 132 | sum.pca <- GP.ord; 133 | imp.pca <- sum.pca$values; 134 | std.pca <- imp.pca[1,]; # eigen values 135 | var.pca <- imp.pca[,2]; # variance explained by each PC 136 | cum.pca <- imp.pca[5,]; # cummulated variance explained 137 | } 138 | sum.pca <- append(sum.pca, list(std=std.pca, variance=var.pca, cum.var=cum.pca)); 139 | 140 | pca3d <- list(); 141 | 142 | if(ordMeth=="NMDS"){ 143 | pca3d$score$axis <- paste("NMDS", 1:3 , sep=""); 144 | coord<-sum.pca$points; 145 | fast.write(signif(coord,5), file="pcoa_score.csv"); 146 | list2 <- rep(0,nrow(coord)); 147 | coord <- cbind(coord, list2); 148 | coords <- data.frame(t(signif(coord[,1:3], 5)),check.names=FALSE); 149 | }else{ 150 | pca3d$score$axis <- paste("PC", 1:3, " (", 100*round(sum.pca$variance[1:3], 3), "%)", sep=""); 151 | coords <- data.frame(t(signif(sum.pca$vectors[,1:3], 5)),check.names=FALSE); 152 | fast.write(signif(sum.pca$vectors,5), file="pcoa_score.csv"); 153 | } 154 | 155 | colnames(coords) <- NULL; 156 | pca3d$score$xyz <- coords; 157 | pca3d$score$name <- sample_names(mbSetObj$dataSet$norm.phyobj); 158 | col.type <- "factor"; 159 | 160 | if(colopt=="taxa"){ 161 | cls <- sample_data(data)[[taxa]]; 162 | col.type <- "gradient" 163 | cols <- ComputeColorGradient(cls); 164 | }else if(colopt=="alphadiv") { 165 | cls <- sample_data(data)[[alphaopt]]; 166 | col.type <- "gradient"; 167 | cols <- ComputeColorGradient(cls); 168 | }else{ 169 | cls <- sample_data(mbSetObj$dataSet$norm.phyobj)[[variable]]; 170 | # now set color for each group 171 | cols <- unique(as.numeric(as.factor(cls))) + 1; 172 | } 173 | cls <- as.factor(cls); 174 | pca3d$score$type <- col.type; 175 | pca3d$score$facA <- cls; 176 | rgbcols <- col2rgb(cols); 177 | cols <- apply(rgbcols, 2, function(x){paste("rgb(", paste(x, collapse=","), ")", sep="")}); 178 | pca3d$score$colors <- cols; 179 | 180 | #json.obj <- rjson::toJSON(pca3d); 181 | #sink(jsonNm); 182 | #cat(json.obj); 183 | #sink(); 184 | 185 | mbSetObj$analSet$pca<-pca3d; 186 | 187 | if(!exists("my.json.scatter")){ 188 | .load.scripts.on.demand("utils_scatter3d.Rc"); 189 | } 190 | 191 | .set.mbSetObj(mbSetObj) 192 | my.json.scatter(mbSetObj, jsonNm, F); 193 | 194 | return(.set.mbSetObj(mbSetObj)); 195 | } 196 | -------------------------------------------------------------------------------- /R/utils_scatter3d.R: -------------------------------------------------------------------------------- 1 | ################################################## 2 | ## R script for MicrobiomeAnalyst 3 | ## Description: Compute json file for 3D scatter plot 4 | ## Author: Guangyan Zhou, guangyan.zhou@mail.mcgill.ca 5 | ################################################## 6 | 7 | my.json.scatter <- function(mbSetObj=NA, filenm, containsLoading=F){ 8 | library(igraph); 9 | ## 10 | mbSetObj <- .get.mbSetObj(mbSetObj); 11 | res <- mbSetObj$analSet$pca$score 12 | nodes <- vector(mode="list"); 13 | names <- res$name; 14 | if(ncol(res$xyz) > nrow(res$xyz)){ 15 | orig.pos.xyz <- t(res$xyz); 16 | }else{ 17 | orig.pos.xyz <- res$xyz; 18 | } 19 | 20 | ticksX <- pretty(range(orig.pos.xyz[,1]*1.2),10, bound=F); 21 | ticksY <- pretty(range(orig.pos.xyz[,2]*1.2),10, bound=F); 22 | ticksZ <- pretty(range(orig.pos.xyz[,3]*1.2),10, bound=F); 23 | 24 | #add two nodes, 1 with all min values and another with all max values. For scaling purposes 25 | minNode <- c(min(ticksX), min(ticksY), min(ticksZ)); 26 | maxNode <- c(max(ticksX), max(ticksY), max(ticksZ)); 27 | 28 | # Add the new rows to the data frame 29 | orig.pos.xyz.mod <- rbind(orig.pos.xyz, minNode); 30 | orig.pos.xyz.mod <- rbind(orig.pos.xyz.mod, maxNode); 31 | 32 | #scaling 33 | pos.xyz <- orig.pos.xyz.mod; 34 | pos.xyz[,1] <- scale_range(orig.pos.xyz.mod[,1], -1,1); 35 | pos.xyz[,2] <- scale_range(orig.pos.xyz.mod[,2], -1,1); 36 | pos.xyz[,3] <- scale_range(orig.pos.xyz.mod[,3], -1,1); 37 | 38 | #remove last two rows 39 | pos.xyz <- pos.xyz[1:(nrow(pos.xyz) - 2), ] 40 | 41 | metadf <- res$facA 42 | if(!is.factor(metadf)){ 43 | metadf <- as.factor(metadf); 44 | } 45 | col = vector(); 46 | 47 | meta.vec <- metadf 48 | meta.vec.num = as.integer(metadf) 49 | 50 | # Convert factor levels to numeric 51 | numeric_levels <- as.numeric(levels(meta.vec)) 52 | 53 | if(any(!is.na(numeric_levels))) { 54 | print("numeric"); 55 | sorted_unique_meta_vec <- sort(unique(as.numeric(levels(meta.vec)))) 56 | col.s <- generateColorGradient(sorted_unique_meta_vec) 57 | # Create a named vector where names are sorted unique meta.vec values and values are corresponding colors 58 | col <- generateColorGradient(meta.vec) 59 | # Prepare legend data 60 | legendData <- list(label = sorted_unique_meta_vec, color = col.s) 61 | 62 | }else{ 63 | #print("not_numeric"); 64 | 65 | col.s <- gg_color_hue(length(levels(metadf))) 66 | for(i in 1:length(meta.vec.num)){ 67 | col[i] = col.s[meta.vec.num[i]]; 68 | } 69 | legendData <- list(label=levels(as.factor(meta.vec)),color=col.s) 70 | 71 | } 72 | 73 | 74 | if("facB" %in% names(res)){ 75 | meta.vec2 <- res$facB 76 | phyobjdata <- qs::qread("merged.data.qs"); 77 | metadf <- as.matrix(sample_data(phyobjdata)); 78 | metadf <- as.data.frame(metadf); 79 | shape <- vector(); 80 | meta.vec.num <- as.integer(as.factor(meta.vec2)) 81 | shape.s <- c("circle", "triangle", "square", "diamond")[1:length(unique(meta.vec2))]; 82 | 83 | for(i in 1:length(meta.vec.num)){ 84 | shape[i] = shape.s[meta.vec.num[i]]; 85 | } 86 | legendData2 <- list(label=levels(as.factor(meta.vec2)),shape=shape.s); 87 | } 88 | 89 | nodeSize = 18; 90 | 91 | for(i in 1:length(names)){ 92 | nodes[[i]] <- list( 93 | id=names[i], 94 | label=names[i], 95 | size=nodeSize, 96 | meta=meta.vec[i], 97 | fx = unname(pos.xyz[i,1])*1000, 98 | fy = unname(pos.xyz[i,2])*1000, 99 | fz = unname(pos.xyz[i,3])*1000, 100 | origX = unname(orig.pos.xyz[i,1]), 101 | origY = unname(orig.pos.xyz[i,2]), 102 | origZ = unname(orig.pos.xyz[i,3]), 103 | colorb=col[i] 104 | ); 105 | 106 | if("facB" %in% names(res)){ 107 | nodes[[i]][["meta2"]] <- meta.vec2[i] 108 | nodes[[i]][["shape"]] <- shape[i] 109 | 110 | } 111 | } 112 | 113 | 114 | ticks <- list(x=ticksX, y=ticksY, z=ticksZ); 115 | library(RJSONIO) 116 | 117 | if(!containsLoading){ 118 | netData <- list(nodes=nodes, 119 | edges="NA", 120 | meta=metadf, 121 | loading="NA", 122 | axis=res$axis, 123 | ticks=ticks, 124 | metaCol = legendData); 125 | }else{ 126 | res2 <- qs::qread("loading3d.qs"); 127 | 128 | if(ncol(res2$xyz) > nrow(res2$xyz)){ 129 | orig.load.xyz <- t(res2$xyz); 130 | }else{ 131 | orig.load.xyz <- res2$xyz; 132 | } 133 | 134 | ticksX <- pretty(range(orig.load.xyz[,1]),10); 135 | ticksY <- pretty(range(orig.load.xyz[,2]),10); 136 | ticksZ <- pretty(range(orig.load.xyz[,3]),10); 137 | 138 | #add two nodes, 1 with all min values and another with all max values. For scaling purposes 139 | minNode <- c(min(ticksX), min(ticksY), min(ticksZ)); 140 | maxNode <- c(max(ticksX), max(ticksY), max(ticksZ)); 141 | 142 | # Add the new rows to the data frame 143 | orig.load.xyz.mod <- rbind(orig.load.xyz, minNode) 144 | orig.load.xyz.mod <- rbind(orig.load.xyz.mod, maxNode) 145 | 146 | load.xyz <- orig.load.xyz.mod; 147 | 148 | load.xyz[,1] <- scale_range(orig.load.xyz.mod[,1], -1,1); 149 | load.xyz[,2] <- scale_range(orig.load.xyz.mod[,2], -1,1); 150 | load.xyz[,3] <- scale_range(orig.load.xyz.mod[,3], -1,1); 151 | 152 | #remove last two rows 153 | load.xyz <- load.xyz[1:(nrow(load.xyz) - 2), ]; 154 | 155 | names <- res2$name; 156 | if("entrez" %in% names(res2)){ 157 | ids <- res2$entrez; 158 | }else{ 159 | ids <- res2$name; 160 | } 161 | colres <- rgba_to_hex_opacity(res2$cols); 162 | colorb <- colres[[1]]; 163 | opacity_array <- colres[[2]]; 164 | nodes2 <- vector(mode="list"); 165 | 166 | for(i in 1:length(names)){ 167 | nodes2[[i]] <- list( 168 | id=ids[i], 169 | label=names[i], 170 | size=24, 171 | opacity=opacity_array[i], 172 | fx = unname(load.xyz[i,1])*1000, 173 | fy = unname(load.xyz[i,2])*1000, 174 | fz = unname(load.xyz[i,3])*1000, 175 | origX = unname(orig.load.xyz[i,1]), 176 | origY = unname(orig.load.xyz[i,2]), 177 | origZ = unname(orig.load.xyz[i,3]), 178 | seedArr = "notSeed", 179 | colorb=colorb[i], 180 | colorw=colorb[i] 181 | ); 182 | 183 | } 184 | 185 | ticksLoading <- list(x=ticksX, y=ticksY, z=ticksZ); 186 | 187 | netData <- list(omicstype="", 188 | nodes=nodes, 189 | meta=metadf, 190 | loading=nodes2, 191 | misc="", ticks=ticks, 192 | ticksLoading=ticksLoading, 193 | axis=res$axis, 194 | axisLoading=res2$axis, 195 | metaCol = legendData); 196 | #res2$pos.xyz <- load.xyz; 197 | #qs::qsave(res2, "pca3d_loadings.qs"); 198 | } 199 | 200 | if("facB" %in% names(res)){ 201 | netData$metaShape <- legendData2; 202 | } 203 | 204 | rownames(pos.xyz) <- res$name; 205 | mbSetObj$analSet$pos.xyz <- pos.xyz; 206 | qs::qsave(pos.xyz,"pos.xyz.qs"); 207 | 208 | 209 | sink(filenm); 210 | cat(toJSON(netData)); 211 | sink(); 212 | return(.set.mbSetObj(mbSetObj)); 213 | } 214 | 215 | 216 | 217 | # Define a function to convert RGBA to Hex and opacity values 218 | rgba_to_hex_opacity <- function(rgba_array) { 219 | 220 | # Define an empty vector to store the hex color values 221 | hex_values <- vector("character", length = length(rgba_array)) 222 | 223 | # Define an empty vector to store the opacity values 224 | opacity_values <- vector("numeric", length = length(rgba_array)) 225 | 226 | # Loop through each element in the input array 227 | for (i in seq_along(rgba_array)) { 228 | rgba <- rgba_array[i] 229 | rgba <- gsub("rgba\\(", "",rgba); 230 | rgba <- gsub("\\)", "",rgba); 231 | # Convert the RGBA value to a list of numeric values 232 | rgba <- strsplit(rgba, ",")[[1]] 233 | 234 | rgba <- as.numeric(rgba) 235 | # Convert the RGB values to hexadecimal notation 236 | hex <- rgb(rgba[1], rgba[2], rgba[3], maxColorValue = 255) 237 | hex_values[i] <- hex 238 | 239 | # Extract the opacity value from the RGBA string 240 | opacity_values[i] <- rgba[4] 241 | } 242 | 243 | # Return a list containing the hex color values and opacity values 244 | return(list(hex_values = hex_values, opacity_values = opacity_values)) 245 | } 246 | 247 | 248 | scale_range <- function(x, new_min = 0, new_max = 1) { 249 | range <- pretty(x,10); 250 | old_min <- min(range); 251 | old_max <- max(range); 252 | 253 | (x - old_min) / (old_max - old_min) * (new_max - new_min) + new_min 254 | } 255 | 256 | gg_color_hue <- function(n) { 257 | hues = seq(15, 375, length = n + 1) 258 | hcl(h = hues, l = 65, c = 100)[1:n] 259 | } 260 | 261 | generateColorGradient <- function(values, low="green", high="red") { 262 | # Normalize values to the range from 0 to 1 263 | values <- as.numeric(values); 264 | normalized_values <- (values - min(values)) / (max(values) - min(values)) 265 | 266 | # Generate colors 267 | colors <- grDevices::colorRampPalette(c(low, high))(length(values)) 268 | 269 | # Map normalized values to colors 270 | return(colors[as.numeric(cut(normalized_values, breaks = length(values), labels = FALSE))]) 271 | } 272 | 273 | -------------------------------------------------------------------------------- /R/utils_sparcc.R: -------------------------------------------------------------------------------- 1 | 2 | my.sparcc.net <- function(mbSetObj=NULL, corr.net.name, networkType="static", netLayout="kk", netTextSize){ 3 | load_igraph() 4 | mbSetObj <- .get.mbSetObj(mbSetObj); 5 | abundOpt <- mbSetObj$analSet$abund.opt; 6 | edge.list <- mbSetObj$analSet$network_cor; 7 | edge.list <- edge.list[,c("Taxon1", "Taxon2"), drop=FALSE]; 8 | g <- graph_from_data_frame(edge.list, directed = FALSE, vertices = NULL); 9 | E(g)$weight <- abs(mbSetObj$analSet$network_cor[, "Correlation"]); 10 | E(g)$correlation <- mbSetObj$analSet$network_cor[, "Correlation"]; 11 | colnames(edge.list) <- c("Source", "Target"); 12 | nodes <- unique(c(edge.list[,1], edge.list[,2])); 13 | node.list <- data.frame(Id=nodes, Name=nodes,check.names=FALSE); 14 | abundance_table <- mbSetObj$analSet$boxdatacor[,-length(colnames(mbSetObj$analSet$boxdatacor))] 15 | ab <- apply(abundance_table,2,function(x){sum(x)/length(x)}) 16 | taxa <- mbSetObj$analSet$filt.taxa.table; 17 | 18 | colorOpt <- mbSetObj$analSet$corr_color_opt; 19 | # annotation 20 | nms <- V(g)$name; 21 | inx <- !nms %in% taxa[,length(colnames(taxa))] 22 | toDelete = nms[inx] 23 | g <- delete_vertices(g, toDelete); 24 | nms <- V(g)$name; 25 | taxa <- taxa[match(nms, taxa[,length(colnames(taxa))]),] 26 | if(all(c(!colorOpt %in% colnames(taxa), colorOpt != "expr"))){ 27 | 28 | current.msg <<- "Invalid taxa is selected for coloring (must be same or higher taxonomy level of selected taxa used for correlation calculation)" 29 | return(0); 30 | } 31 | hit.inx <- match(nms, node.list[,1]); 32 | lbls <- node.list[hit.inx, 2]; 33 | 34 | # setup shape (gene circle, other squares) 35 | shapes <- rep("circle", length(nms)); 36 | itypes <- rep("circle", length(nms)); 37 | seeds <- rep("circle", length(nms)); 38 | # get edge data 39 | edge.mat <- get.edgelist(g); 40 | edge.mat1 <- data.frame(edge.mat,check.names=FALSE); 41 | edge.mat1$color <- ComputeColorGradientCorr(E(g)$correlation); 42 | edge.mat1 <- as.matrix(edge.mat1) 43 | 44 | edge.mat <- cbind(id=1:nrow(edge.mat), source=edge.mat[,1], target=edge.mat[,2], color = edge.mat1[,3], weight=E(g)$weight, correlation = E(g)$correlation); 45 | # now get coords 46 | pos.xy <- PerformLayOut(g); 47 | 48 | # get the note data 49 | node.btw <- as.numeric(betweenness(g)); 50 | node.eig <- eigen_centrality(g); 51 | node.eig <- as.numeric(node.eig$vector); 52 | node.tra <- transitivity(g,type=c("local")) 53 | node.dgr <- as.numeric(igraph::degree(g)); 54 | node.exp <- as.numeric(get.vertex.attribute(g, name="abundance", index = V(g))); 55 | # node size to abundance values 56 | if(vcount(g)>500){ 57 | min.size = 1; 58 | }else if(vcount(g)>200){ 59 | min.size = 2; 60 | }else{ 61 | min.size = 2; 62 | } 63 | abundance <- unname(ab[nms]) 64 | node.sizes <- as.numeric(rescale2NewRange((log(abundance+1))^2, min.size, 15)); 65 | 66 | # update node color based on betweenness 67 | require("RColorBrewer"); 68 | topo.val <- log(node.btw+1); 69 | exp_table <- mbSetObj$analSet$diff_table; 70 | colVecNms <- rep("NA", length(topo.val)) 71 | nms2=nms 72 | 73 | if(colorOpt == "expr"){ 74 | nms1 = strsplit(nms, "__") 75 | if(length(nms1[[2]])>1){ 76 | l = unlist(lapply(nms1, function(x) unlist(x[2]))); 77 | inx = is.na(l) 78 | if(length(which(inx == T))>0){ 79 | l[inx]= paste0(nms1[[which(inx == T)]][1],"__") 80 | } 81 | nms2=l 82 | }else{ 83 | nms2 = nms 84 | } 85 | exp_table = exp_table[match(nms2, exp_table$tax_name), ] 86 | topo.colsb <- topo.colsb1 <-ComputeColorGradientCorr(exp_table$median_diff); 87 | topo.colsw <- topo.colsw1 <-ComputeColorGradientCorr(exp_table$median_diff); 88 | 89 | smpl <- data.frame(sample_data(mbSetObj$dataSet$proc.phyobj),check.names=FALSE); 90 | subsmpl <- smpl[mbSetObj$dataSet$selected.grps,,drop=FALSE] 91 | if(mbSetObj$dataSet$cor.method == "sparcc"){ 92 | abund_data <- qs::qread("sparcc_data.qs") 93 | }else if(mbSetObj$dataSet$cor.method %in% c("secom_p1","secom_p2","secom_dist")){ 94 | abund_data <- qs::qread("secom_data.qs") 95 | }else{ 96 | abund_data <- t(as.matrix(mbSetObj$analSet$netcorr_data)) 97 | } 98 | 99 | grp.vec = factor(subsmpl[,mbSetObj$dataSet$meta]) 100 | filt_data = abund_data[,mbSetObj$dataSet$selected.grps] 101 | filt_data = as.data.frame(t(filt_data),check.names=FALSE); 102 | meta_vec = rep(grp.vec, ncol(filt_data)) 103 | r = stack(filt_data) 104 | r$meta = meta_vec 105 | 106 | smp.nms = as.character(unique(r$ind)) 107 | meta.nms = as.character(unique(r$meta)) 108 | 109 | abundColor = generateColorArr(length(meta.nms)); 110 | 111 | propList = list() 112 | for(i in 1:length(smp.nms)){ 113 | smp.nm = as.character(smp.nms[i]) 114 | for(j in 1:length(meta.nms)){ 115 | meta.nm = as.character(unique(r$meta)[j]) 116 | tmp = r[which(r$ind == smp.nm),] 117 | tmp = tmp[which(tmp$meta == meta.nm),] 118 | if(abundOpt == "meanlog"){ 119 | vals = log(tmp$values, 10) 120 | average = mean(vals) 121 | }else if(abundOpt == "medianlog"){ 122 | vals = log(tmp$values, 10) 123 | average = median(vals) 124 | }else if(abundOpt == "mean"){ 125 | total = sum(tmp$values) 126 | average = total/length(tmp$values) 127 | }else{ 128 | average=median(tmp$values) 129 | } 130 | if(length(propList[[smp.nm]]) == 0){ 131 | propList[[smp.nm]] = list() 132 | } 133 | propList[[smp.nm]][[meta.nm]]=average 134 | } 135 | } 136 | 137 | }else if(colorOpt == "metadata"){ 138 | 139 | }else{ 140 | 141 | color_var <- as.character(unique(taxa[,colorOpt])); 142 | colVec=generateColorArr(length(color_var)); 143 | names(colVec) = unique(taxa[,colorOpt]) 144 | colVecNms<-names(colVec[as.character(taxa[,colorOpt])]) 145 | topo.colsb <- unname(colVec[as.character(taxa[,colorOpt])]) 146 | topo.colsw <- topo.colsb 147 | propList = "NA" 148 | abundColor = "NA" 149 | } 150 | # color based on expression 151 | bad.inx <- is.na(node.exp) | node.exp==0; 152 | 153 | if(!all(bad.inx)){ 154 | exp.val <- node.exp; 155 | node.colsb.exp <- ComputeColorGradientCorr(exp.val); 156 | node.colsw.exp <- ComputeColorGradientCorr(exp.val); 157 | node.colsb.exp[bad.inx] <- "#d3d3d3"; 158 | node.colsw.exp[bad.inx] <- "#c6c6c6"; 159 | }else{ 160 | node.colsb.exp <- rep("#D3D3D3",length(node.dgr)); 161 | node.colsw.exp <- rep("#C6C6C6",length(node.dgr)); 162 | } 163 | 164 | network_prop = list(); 165 | for(i in 1:length(node.sizes)){ 166 | network_prop[[i]] <- list( 167 | eigen = node.eig[i], 168 | transitivity = node.tra[i] 169 | ) 170 | } 171 | 172 | type <- rep(FALSE,length(node.dgr)); 173 | node_attr <- list.vertex.attributes(g); 174 | node_attr <- node_attr[which(node_attr!="names")] 175 | 176 | # now create the json object 177 | nodes <- vector(mode="list"); 178 | 179 | for(i in 1:length(node.sizes)){ 180 | nodes[[i]] <- list( 181 | id=nms[i], 182 | idx=i, 183 | label=nms2[i], 184 | size=node.sizes[i], 185 | tsize=node.sizes[i], 186 | type="gene", 187 | itype=itypes[i], 188 | taxon=colVecNms[i], 189 | color=topo.colsb[i], 190 | colorb=topo.colsb[i], 191 | colorw=topo.colsw[i], 192 | topocolb=topo.colsb[i], 193 | topocolw=topo.colsw[i], 194 | expcolb=node.colsb.exp[i], 195 | expcolw=node.colsw.exp[i], 196 | x=pos.xy[i,1], 197 | y= pos.xy[i,2], 198 | user =network_prop[[i]], 199 | attributes=list( 200 | degree=node.dgr[i], 201 | between=node.btw[i], 202 | expr = exp_table$mean_diff[i], 203 | eigen = node.eig[i], 204 | transitivity = node.tra[i] 205 | ) 206 | ); 207 | } 208 | 209 | if(!.on.public.web){ 210 | if(networkType == "static"){ 211 | 212 | # static plot 213 | load_ggraph() 214 | 215 | p <- ggraph(g, layout = netLayout) + theme_void() + 216 | geom_edge_fan(color="gray20", width=0.5, alpha=0.5) + 217 | geom_node_point(color=topo.colsb, size=node.sizes, alpha = 0.95) + 218 | geom_node_text(aes(label = V(g)$name), size = netTextSize, repel=TRUE, nudge_y = 0.05, nudge_x = 0.05, check_overlap = TRUE) + 219 | # 10% space above/to the side of x 220 | scale_y_continuous(expand = expansion(mult = c(.1, .1))) + 221 | scale_x_continuous(expand = expansion(mult = c(.1, .1))) 222 | 223 | filename <- paste0(gsub(".json", "", corr.net.name), ".png") 224 | ggsave(p, file=filename, width = 7, height = 7) 225 | 226 | }else{ 227 | 228 | # interactive plot 229 | load_visNetwork() 230 | 231 | data <- toVisNetworkData(g) 232 | data[["nodes"]]$color <- topo.colsb 233 | data[["nodes"]]$size <- node.sizes 234 | network <- visNetwork(nodes = data$nodes, edges = data$edges, 235 | idToLabel = TRUE, height = "900px", width = "100%") %>% 236 | visEdges(color = list(color = "lightgrey", highlight = "red")) 237 | filename <- paste0(gsub(".json", "", corr.net.name), ".html") 238 | visSave(network, file = filename) 239 | } 240 | } 241 | # save node table 242 | nd.tbl <- data.frame(Id=nms, Label=lbls, Degree=node.dgr, Betweenness=round(node.btw,2),check.names=FALSE); 243 | # order 244 | ord.inx <- order(nd.tbl[,3], nd.tbl[,4], decreasing = TRUE) 245 | nd.tbl <- nd.tbl[ord.inx, ]; 246 | fast.write(nd.tbl, file="node_table.csv", row.names=FALSE); 247 | 248 | if(.on.public.web){ 249 | # covert to json 250 | taxNodes <- list(tax=colVecNms,colors=topo.colsb); 251 | netData <- list(nodes=nodes,edges=edge.mat, abund=propList, abundColor=abundColor, taxa=taxa, taxaNodes = taxNodes) 252 | sink(corr.net.name); 253 | cat(RJSONIO::toJSON(netData)); 254 | sink(); 255 | } 256 | return(.set.mbSetObj(mbSetObj)); 257 | } 258 | -------------------------------------------------------------------------------- /docs/microbiomeanalystr_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xia-lab/MicrobiomeAnalystR/741fa04cb29d5197b48d31b68cb56f00d1d58ad7/docs/microbiomeanalystr_logo.png -------------------------------------------------------------------------------- /man/AddErrMsg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_misc.R 3 | \name{AddErrMsg} 4 | \alias{AddErrMsg} 5 | \title{Adds an error message} 6 | \usage{ 7 | AddErrMsg(msg) 8 | } 9 | \arguments{ 10 | \item{msg}{Error message to print} 11 | } 12 | \description{ 13 | The error message will be printed in all cases. 14 | Used in higher functions. 15 | } 16 | -------------------------------------------------------------------------------- /man/ApplyAbundanceFilter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{ApplyAbundanceFilter} 4 | \alias{ApplyAbundanceFilter} 5 | \title{Function to filter uploaded data} 6 | \usage{ 7 | ApplyAbundanceFilter(mbSetObj, filt.opt, count, smpl.perc) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{filt.opt}{Character, input the low count filter option. "prevalence" to 13 | filter based on prevalence in samples, "mean" to filter by the mean abundance value, and 14 | "median" to filter by median abundance value.} 15 | 16 | \item{count}{Numeric, input the minimum count. Set to 0 to disable the low count filter.} 17 | 18 | \item{smpl.perc}{Numeric, input the percentage of samples for which to filter low counts.} 19 | } 20 | \description{ 21 | This function filters data based on low counts in high percentage samples. 22 | Note, first is abundance, followed by variance. 23 | } 24 | \author{ 25 | Jeff Xia \email{jeff.xia@mcgill.ca} 26 | McGill University, Canada 27 | License: GNU GPL (>= 2) 28 | } 29 | -------------------------------------------------------------------------------- /man/ApplyAbundanceFilterMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{ApplyAbundanceFilterMeta} 4 | \alias{ApplyAbundanceFilterMeta} 5 | \title{Function to filter uploaded data in meta-analysis module} 6 | \usage{ 7 | ApplyAbundanceFilterMeta(mbSetObj, dataName, filt.opt, count, smpl.perc) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dataName}{Input the name of selected dataset data file} 13 | 14 | \item{filt.opt}{Character, input the low count filter option. "prevalence" to 15 | filter based on prevalence in samples, "mean" to filter by the mean abundance value, and 16 | "median" to filter by median abundance value.} 17 | 18 | \item{count}{Numeric, input the minimum count. Set to 0 to disable the low count filter.} 19 | 20 | \item{smpl.perc}{Numeric, input the percentage of samples for which to filter low counts.} 21 | } 22 | \description{ 23 | This function filters data based on low counts in high percentage samples. 24 | Note, first is abundance, followed by variance. 25 | } 26 | \author{ 27 | Jeff Xia \email{jeff.xia@mcgill.ca} 28 | McGill University, Canada 29 | License: GNU GPL (>= 2) 30 | } 31 | -------------------------------------------------------------------------------- /man/ApplyMetaboFilter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{ApplyMetaboFilter} 4 | \alias{ApplyMetaboFilter} 5 | \title{Function to filter uploaded metabolomic data} 6 | \usage{ 7 | ApplyMetaboFilter(mbSetObj = NA, filter, rsd) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{filtopt}{Character, input the low variance filter option. "iqr" for 13 | inter-quantile range, "sd" for standard deviation, and "cov" for coefficient of variation.} 14 | 15 | \item{filtPerct}{Numeric, input the percentage cutoff for low variance.} 16 | } 17 | \description{ 18 | . 19 | Note, this is applied after abundance filter. 20 | } 21 | \author{ 22 | Jeff Xia \email{jeff.xia@mcgill.ca} 23 | McGill University, Canada 24 | License: GNU GPL (>= 2) 25 | } 26 | -------------------------------------------------------------------------------- /man/ApplyVarianceFilter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{ApplyVarianceFilter} 4 | \alias{ApplyVarianceFilter} 5 | \title{Function to filter uploaded data} 6 | \usage{ 7 | ApplyVarianceFilter(mbSetObj, filtopt, filtPerct) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{filtopt}{Character, input the low variance filter option. "iqr" for 13 | inter-quantile range, "sd" for standard deviation, and "cov" for coefficient of variation.} 14 | 15 | \item{filtPerct}{Numeric, input the percentage cutoff for low variance.} 16 | } 17 | \description{ 18 | This function filters data based on low abundace or variance. 19 | Note, this is applied after abundance filter. 20 | } 21 | \author{ 22 | Jeff Xia \email{jeff.xia@mcgill.ca} 23 | McGill University, Canada 24 | License: GNU GPL (>= 2) 25 | } 26 | -------------------------------------------------------------------------------- /man/ApplyVarianceFilterMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{ApplyVarianceFilterMeta} 4 | \alias{ApplyVarianceFilterMeta} 5 | \title{Function to filter uploaded data} 6 | \usage{ 7 | ApplyVarianceFilterMeta(mbSetObj, dataName, filtopt, filtPerct) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dataName}{Input the name of selected dataset data file} 13 | 14 | \item{filtopt}{Character, input the low variance filter option. "iqr" for 15 | inter-quantile range, "sd" for standard deviation, and "cov" for coefficient of variation.} 16 | 17 | \item{filtPerct}{Numeric, input the percentage cutoff for low variance.} 18 | } 19 | \description{ 20 | This function filters data based on low abundace or variance. 21 | Note, this is applied after abundance filter. 22 | } 23 | \author{ 24 | Jeff Xia \email{jeff.xia@mcgill.ca} 25 | McGill University, Canada 26 | License: GNU GPL (>= 2) 27 | } 28 | -------------------------------------------------------------------------------- /man/CalculateHyperScore.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{CalculateHyperScore} 4 | \alias{CalculateHyperScore} 5 | \title{Calculate enrichment score.} 6 | \usage{ 7 | CalculateHyperScore(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function calculates the enrichment score for TSEA. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/CheckMetaDataIntegrity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{CheckMetaDataIntegrity} 4 | \alias{CheckMetaDataIntegrity} 5 | \title{Check if data are ready for meta-analysis} 6 | \usage{ 7 | CheckMetaDataIntegrity(mbSetObj, taxo_type, sample_var) 8 | } 9 | \description{ 10 | This function determines if all annotated data are ready for meta-analysis 11 | } 12 | \author{ 13 | Jeff Xia\email{jeff.xia@mcgill.ca} 14 | McGill University, Canada 15 | License: GNU GPL (>= 2) 16 | } 17 | -------------------------------------------------------------------------------- /man/CleanData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{CleanData} 4 | \alias{CleanData} 5 | \title{Perform data cleaning} 6 | \usage{ 7 | CleanData(bdata, removeNA = T, removeNeg = T, removeConst = T) 8 | } 9 | \arguments{ 10 | \item{bdata}{Input data to clean} 11 | 12 | \item{removeNA}{Logical, T to remove NAs, F to not.} 13 | 14 | \item{removeNeg}{Logical, T to remove negative numbers, F to not.} 15 | 16 | \item{removeConst}{Logical, T to remove samples/features with 0s, F to not.} 17 | } 18 | \description{ 19 | Cleans data and removes -Inf, Inf, NA, negative and 0s. 20 | } 21 | \author{ 22 | Jeff Xia\email{jeff.xia@mcgill.ca} 23 | McGill University, Canada 24 | License: MIT License 25 | } 26 | -------------------------------------------------------------------------------- /man/CompareSummaryStats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_methods.R 3 | \name{CompareSummaryStats} 4 | \alias{CompareSummaryStats} 5 | \title{Perform alpha diversity meta-analysis} 6 | \usage{ 7 | CompareSummaryStats( 8 | mbSetObj = NA, 9 | fileName = "abc", 10 | sel.meta = "", 11 | taxrank = "Family", 12 | view.mode = "ratio", 13 | format = "png", 14 | dpi = 72 15 | ) 16 | } 17 | \arguments{ 18 | \item{mbSetObj}{Input the name of the mbSetObj.} 19 | 20 | \item{fileName}{File name of output summary image} 21 | 22 | \item{sel.meta}{Selected metadata} 23 | 24 | \item{taxrank}{Selected taxonomy rank} 25 | 26 | \item{view.mode}{Type of plot to output (ratio or box)} 27 | 28 | \item{format}{File format of output image (default to png)} 29 | 30 | \item{dpi}{dots per inch resolution of image (default 72)} 31 | } 32 | \description{ 33 | Compute alpha diversity indices of datasets and plot summary figure, adapted from work of Jordan Bisanz 34 | } 35 | \author{ 36 | Jeff Xia \email{jeff.xia@mcgill.ca} 37 | McGill University, Canada 38 | License: GNU GPL (>= 2) 39 | } 40 | -------------------------------------------------------------------------------- /man/CoreMicrobeAnalysis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{CoreMicrobeAnalysis} 4 | \alias{CoreMicrobeAnalysis} 5 | \title{Perform core microbiome analysis} 6 | \usage{ 7 | CoreMicrobeAnalysis( 8 | mbSetObj, 9 | imgName, 10 | preval, 11 | detection, 12 | taxrank, 13 | palette, 14 | viewOpt, 15 | analOpt, 16 | expFact, 17 | group, 18 | format = "png", 19 | dpi = 72, 20 | width = NA, 21 | interactive = FALSE 22 | ) 23 | } 24 | \arguments{ 25 | \item{mbSetObj}{Input the name of the mbSetObj.} 26 | 27 | \item{imgName}{Input the name of the core microbiome analysis plot.} 28 | 29 | \item{preval}{Numeric, input the sample prevalence cutoff. This is 30 | the minimum number of samples that share this microbe.} 31 | 32 | \item{detection}{Numeric, input the relative abundance cutoff. This 33 | is the minimum detection threshold of X percent relative abundance.} 34 | 35 | \item{palette}{Character, input the color palette. 36 | "bwm" for the default color palette /(blue, white, red/), "gbr" 37 | for the red and green color palette, "heat" for the yellow to red color 38 | palette, "topo" for the blue, green, and yellow color palette, 39 | "gray" for the gray color palette, "byr" for the blue, yellow and red color 40 | palette, "viridis" for the viridis default color palette and "plasma" 41 | for the plasma viridis color palette.} 42 | 43 | \item{format}{Character, input the preferred 44 | format of the plot. By default it is set to "png".} 45 | 46 | \item{dpi}{Numeric, input the dots per inch. By default 47 | it is set to 72.} 48 | 49 | \item{interactive}{Boolean, if set to TRUE, saves the plot 50 | as an interactive html plot.} 51 | } 52 | \description{ 53 | This functions performs core microbiome analysis. 54 | } 55 | \author{ 56 | Jeff Xia \email{jeff.xia@mcgill.ca} 57 | McGill University, Canada 58 | License: GNU GPL (>= 2) 59 | } 60 | -------------------------------------------------------------------------------- /man/CreateFooter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_reporter.R 3 | \name{CreateFooter} 4 | \alias{CreateFooter} 5 | \title{Create report of analyses (Met Enrichment)} 6 | \usage{ 7 | CreateFooter(mbSetObj) 8 | } 9 | \description{ 10 | Report generation using Sweave 11 | } 12 | \author{ 13 | Jeff Xia \email{jeff.xia@mcgill.ca} 14 | McGill University, Canada 15 | License: GNU GPL (>= 2) 16 | } 17 | -------------------------------------------------------------------------------- /man/CreateMDPRnwReport.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_reporter.R 3 | \name{CreateMDPRnwReport} 4 | \alias{CreateMDPRnwReport} 5 | \title{Function to create PDF report for MDP module} 6 | \usage{ 7 | CreateMDPRnwReport(mbSetObj, usrName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{usrName}{Input the preferred user name for the Analysis Report.} 13 | } 14 | \description{ 15 | This function creates a PDF report 16 | for the MDP module - writes .Rnw file template. 17 | } 18 | \author{ 19 | Jeff Xia \email{jeff.xia@mcgill.ca} 20 | McGill University, Canada 21 | License: GNU GPL (>= 2) 22 | } 23 | -------------------------------------------------------------------------------- /man/CreatePhyloseqObj.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{CreatePhyloseqObj} 4 | \alias{CreatePhyloseqObj} 5 | \title{Function to recreate phyloseq object} 6 | \usage{ 7 | CreatePhyloseqObj(mbSetObj, type, taxa_type, taxalabel, isNormInput) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{type}{Input the format of the uploaded files. "text" for 13 | .txt or .csv files, "biom" for .biom, and "mothur" for mothur files.} 14 | 15 | \item{taxa_type}{Input the taxonomy labels. "SILVA" for SILVA taxonomy, 16 | "Greengenes" for Greengenes taxonomy, "QIIME" for QIIME taxonomy, 17 | "GreengenesID" for Greengenes OTU IDs, and "Others/Not_specific" for others.} 18 | 19 | \item{taxalabel}{Logical, T if taxonomy labels were already included in 20 | the OTU table and F if not.} 21 | } 22 | \description{ 23 | This function recreates the phyloseq object. 24 | } 25 | \author{ 26 | Jeff Xia \email{jeff.xia@mcgill.ca} 27 | McGill University, Canada 28 | License: GNU GPL (>= 2) 29 | } 30 | -------------------------------------------------------------------------------- /man/CreatePhyloseqObjMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{CreatePhyloseqObjMeta} 4 | \alias{CreatePhyloseqObjMeta} 5 | \title{Function to recreate phyloseq object in meta-analysis module} 6 | \usage{ 7 | CreatePhyloseqObjMeta( 8 | mbSetObj, 9 | dataName, 10 | type, 11 | taxa_type, 12 | taxalabel, 13 | isNormInput 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{dataName}{Input the file name of selected dataset} 20 | 21 | \item{type}{Input the format of the uploaded files. "text" for 22 | .txt or .csv files, "biom" for .biom, and "mothur" for mothur files.} 23 | 24 | \item{taxa_type}{Input the taxonomy labels. "SILVA" for SILVA taxonomy, 25 | "Greengenes" for Greengenes taxonomy, "QIIME" for QIIME taxonomy, 26 | "GreengenesID" for Greengenes OTU IDs, and "Others/Not_specific" for others.} 27 | 28 | \item{taxalabel}{Logical, T if taxonomy labels were already included in 29 | the OTU table and F if not.} 30 | } 31 | \description{ 32 | This function recreates the phyloseq object. 33 | } 34 | \author{ 35 | Jeff Xia \email{jeff.xia@mcgill.ca} 36 | McGill University, Canada 37 | License: GNU GPL (>= 2) 38 | } 39 | -------------------------------------------------------------------------------- /man/CreateRHistAppendix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_reporter.R 3 | \name{CreateRHistAppendix} 4 | \alias{CreateRHistAppendix} 5 | \title{Create report of analyses} 6 | \usage{ 7 | CreateRHistAppendix() 8 | } 9 | \description{ 10 | Report generation using Sweave 11 | Create footer 12 | } 13 | \author{ 14 | Jeff Xia \email{jeff.xia@mcgill.ca} 15 | McGill University, Canada 16 | License: GNU GPL (>= 2) 17 | } 18 | -------------------------------------------------------------------------------- /man/CreateSDPRnwReport.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_reporter.R 3 | \name{CreateSDPRnwReport} 4 | \alias{CreateSDPRnwReport} 5 | \title{Function to create PDF report for SDP module} 6 | \usage{ 7 | CreateSDPRnwReport(mbSetObj, usrName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{usrName}{Input the preferred user name for the Analysis Report.} 13 | } 14 | \description{ 15 | This function creates a PDF report 16 | for the SDP module - writes .Rnw file template. 17 | } 18 | \author{ 19 | Jeff Xia \email{jeff.xia@mcgill.ca} 20 | McGill University, Canada 21 | License: GNU GPL (>= 2) 22 | } 23 | -------------------------------------------------------------------------------- /man/CrossReferencing.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{CrossReferencing} 4 | \alias{CrossReferencing} 5 | \title{Perform cross referencing.} 6 | \usage{ 7 | CrossReferencing(mbSetObj, q.type) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function performs cross referencing of user's data 14 | with the MicrobiomeAnalyst database. Given a list of species names or ids, 15 | it finds matched names or ids from selected internal databases. 16 | } 17 | \author{ 18 | Jeff Xia \email{jeff.xia@mcgill.ca} 19 | McGill University, Canada 20 | License: GNU GPL (>= 2) 21 | } 22 | -------------------------------------------------------------------------------- /man/FeatureCorrelation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{FeatureCorrelation} 4 | \alias{FeatureCorrelation} 5 | \title{Main function to calculate correlation of all other feature to a given feature name} 6 | \usage{ 7 | FeatureCorrelation(mbSetObj, dist.name, taxrank, feat) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dist.name}{Input the distance measure. Input "pearson" for 13 | Pearson R, "spearman" for Spearman rank correlation, and "kendall" 14 | for Kendall rank correlation.} 15 | 16 | \item{taxrank}{Character, input the taxonomic level to use.} 17 | 18 | \item{taxa}{If the pattern is defined by using a specific taxon, input the name 19 | of that taxa here.} 20 | 21 | \item{variable}{Input the name of the experimental factor.} 22 | 23 | \item{datatype}{If the data is marker gene, input "16S". If the 24 | data is metagenomic, use "metageno".} 25 | 26 | \item{shotfeat}{Only valid for SDP module, set to "null".} 27 | 28 | \item{shotgunid}{Only valid for SDP module, set to "NA".} 29 | } 30 | \description{ 31 | This functions calculate correlation of all other feature to a given feature name. 32 | This is used in the Pattern Search analysis. 33 | } 34 | \author{ 35 | Jeff Xia \email{jeff.xia@mcgill.ca} 36 | McGill University, Canada 37 | License: GNU GPL (>= 2) 38 | } 39 | -------------------------------------------------------------------------------- /man/GenerateTemplates.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GenerateTemplates} 4 | \alias{GenerateTemplates} 5 | \title{Function to generate templates} 6 | \usage{ 7 | GenerateTemplates(mbSetObj, variable) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This functions generate templates 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetColorSchema.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_graphics.R 3 | \name{GetColorSchema} 4 | \alias{GetColorSchema} 5 | \title{Function to get color palette for graphics.} 6 | \usage{ 7 | GetColorSchema(mbSetObj, grayscale = F) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{grayscale}{Logical, default set to F.} 13 | } 14 | \description{ 15 | This function is called to create a color palette 16 | based on the number of groups. It returns a vector of color 17 | hex codes based on the number of groups. 18 | } 19 | \author{ 20 | Jeff Xia \email{jeff.xia@mcgill.ca} 21 | McGill University, Canada 22 | License: GNU GPL (>= 2) 23 | } 24 | -------------------------------------------------------------------------------- /man/GetDataForPie.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{GetDataForPie} 4 | \alias{GetDataForPie} 5 | \title{Utility function to exract data for piechart.} 6 | \usage{ 7 | GetDataForPie(data_n, datataxa, txlvl, OtuIdType, feat_cnt) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function extracts necessary data to create a piechart. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetErrMsg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_misc.R 3 | \name{GetErrMsg} 4 | \alias{GetErrMsg} 5 | \title{Gets the error message} 6 | \usage{ 7 | GetErrMsg() 8 | } 9 | \arguments{ 10 | \item{msg}{Error message to print} 11 | } 12 | \description{ 13 | The error message will be printed in all cases. 14 | Used in higher functions. 15 | } 16 | -------------------------------------------------------------------------------- /man/GetFinalNameMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{GetFinalNameMap} 4 | \alias{GetFinalNameMap} 5 | \title{Getter to return final map} 6 | \usage{ 7 | GetFinalNameMap(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function returns the final (after user selection) map as a dataframe. 14 | Consists of two columns, original name and strain. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/GetGeneListStat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{GetGeneListStat} 4 | \alias{GetGeneListStat} 5 | \title{Function to get gene list statistics} 6 | \usage{ 7 | GetGeneListStat(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function gets the gene list stats. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetMapTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetMapTable} 4 | \alias{GetMapTable} 5 | \title{Getter function} 6 | \usage{ 7 | GetMapTable(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetORATable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{GetORATable} 4 | \alias{GetORATable} 5 | \title{Getter function} 6 | \usage{ 7 | GetORATable(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetRFConf.Table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetRFConf.Table} 4 | \alias{GetRFConf.Table} 5 | \title{Getter function} 6 | \usage{ 7 | GetRFConf.Table(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetSigTable.Corr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetSigTable.Corr} 4 | \alias{GetSigTable.Corr} 5 | \title{Getter function} 6 | \usage{ 7 | GetSigTable.Corr(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetSigTable.LEFSE.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetSigTable.LEFSE} 4 | \alias{GetSigTable.LEFSE} 5 | \title{Getter function} 6 | \usage{ 7 | GetSigTable.LEFSE(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetSigTable.METAGENOSEQ.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetSigTable.METAGENOSEQ} 4 | \alias{GetSigTable.METAGENOSEQ} 5 | \title{Getter function} 6 | \usage{ 7 | GetSigTable.METAGENOSEQ(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetSigTable.RNASeq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetSigTable.RNASeq} 4 | \alias{GetSigTable.RNASeq} 5 | \title{Getter function} 6 | \usage{ 7 | GetSigTable.RNASeq(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/GetSigTable.UNIVAR.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{GetSigTable.UNIVAR} 4 | \alias{GetSigTable.UNIVAR} 5 | \title{Getter function} 6 | \usage{ 7 | GetSigTable.UNIVAR(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function retrieves table from mbSetObj. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/Init.DataMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{Init.DataMeta} 4 | \alias{Init.DataMeta} 5 | \title{Init resources & global settings & variables.} 6 | \usage{ 7 | Init.DataMeta() 8 | } 9 | \value{ 10 | mbSetObj object, Input the name of the mbSetObj. By default, 11 | } 12 | \description{ 13 | Init resources & global settings & variables. 14 | } 15 | -------------------------------------------------------------------------------- /man/Init.mbSetObj.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_io.R 3 | \name{Init.mbSetObj} 4 | \alias{Init.mbSetObj} 5 | \title{Constructs a mbSet object for storing data} 6 | \usage{ 7 | Init.mbSetObj() 8 | } 9 | \description{ 10 | This functions handles the construction of a mbSetObj object for storing data 11 | produced by MicrobiomeAnalystR for further processing and analysis. 12 | } 13 | \author{ 14 | Jeff Xia \email{jeff.xia@mcgill.ca} 15 | McGill University, Canada 16 | License: GNU GPL (>= 2) 17 | } 18 | -------------------------------------------------------------------------------- /man/Match.Pattern.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{Match.Pattern} 4 | \alias{Match.Pattern} 5 | \title{Match Patterns Function} 6 | \usage{ 7 | Match.Pattern( 8 | mbSetObj, 9 | dist.name = "pearson", 10 | pattern = NULL, 11 | taxrank, 12 | variable, 13 | appendname 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{dist.name}{Input the distance measure. Input "pearson" for 20 | Pearson R, "spearman" for Spearman rank correlation, "kendall" 21 | for Kendall rank correlation and "sparcc" for SparCC.} 22 | 23 | \item{pattern}{Character, input the specified pattern.} 24 | 25 | \item{taxrank}{Character, input the taxonomic level to use.} 26 | 27 | \item{variable}{Input the name of the experimental factor.} 28 | 29 | \item{taxa}{If the pattern is defined by using a specific taxon, input the name 30 | of that taxa here.} 31 | 32 | \item{datatype}{If the data is marker gene, input "16S". If the 33 | data is metagenomic, use "metageno".} 34 | 35 | \item{shotfeat}{Only valid for SDP module, set to "null".} 36 | 37 | \item{shotgunid}{Only valid for SDP module, set to "NA".} 38 | } 39 | \description{ 40 | This functions matches patterns (when 41 | the defined pattern is set to a predefined profile or custom 42 | profile) in the Pattern Search analysis. 43 | } 44 | \author{ 45 | Jeff Xia \email{jeff.xia@mcgill.ca} 46 | McGill University, Canada 47 | License: GNU GPL (>= 2) 48 | } 49 | -------------------------------------------------------------------------------- /man/MergeDatasets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{MergeDatasets} 4 | \alias{MergeDatasets} 5 | \title{Merge two or more datasets into merged phyloseq object} 6 | \usage{ 7 | MergeDatasets(mbSetObj, taxo_type, sample_var) 8 | } 9 | \description{ 10 | Merge two or more datasets into merged phyloseq object 11 | } 12 | \author{ 13 | Jeff Xia\email{jeff.xia@mcgill.ca} 14 | McGill University, Canada 15 | License: GNU GPL (>= 2) 16 | } 17 | -------------------------------------------------------------------------------- /man/PCoA3D.Anal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_graphics.R 3 | \name{PCoA3D.Anal} 4 | \alias{PCoA3D.Anal} 5 | \title{Main function to perform PCoA analysis} 6 | \usage{ 7 | PCoA3D.Anal( 8 | mbSetObj, 9 | ordMeth, 10 | distName, 11 | taxrank, 12 | colopt, 13 | variable, 14 | taxa, 15 | alphaopt, 16 | jsonNm 17 | ) 18 | } 19 | \arguments{ 20 | \item{mbSetObj}{Input the name of the mbSetObj.} 21 | 22 | \item{ordMeth}{Character, input the name 23 | of the ordination method. "PCoA" for principal coordinate analysis and "NMDS" for 24 | non-metric multidimensional scaling.} 25 | 26 | \item{distName}{Character, input the name of the distance method.} 27 | 28 | \item{taxrank}{Character, input the taxonomic 29 | level for beta-diversity analysis.} 30 | 31 | \item{colopt}{Character, color the data points by the experimental factor, 32 | the taxon abundance of a selected taxa, or alpha diversity.} 33 | 34 | \item{variable}{Character, input the name of the experimental factor.} 35 | 36 | \item{taxa}{Character, if the data points are colored by taxon abundance, 37 | input the name of the selected taxa.} 38 | 39 | \item{alphaopt}{Character, if the data points are colored by alpha-diversity, 40 | input the preferred alpha-diversity measure.} 41 | 42 | \item{jsonNm}{Character, input the name of the json file to output.} 43 | 44 | \item{datatype}{Character, input "16S" if the data is marker 45 | gene data and "metageno" if it is metagenomic data.} 46 | } 47 | \description{ 48 | This functions creates a 3D PCoA plot from the microbiome data. 49 | This is used by the Beta-Diversity analysis. 50 | The 3D interactive visualization is on the web. 51 | } 52 | \author{ 53 | Jeff Xia \email{jeff.xia@mcgill.ca} 54 | McGill University, Canada 55 | License: GNU GPL (>= 2) 56 | } 57 | -------------------------------------------------------------------------------- /man/PCoA3DAnal.16SRef.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ppd_utils.R 3 | \name{PCoA3DAnal.16SRef} 4 | \alias{PCoA3DAnal.16SRef} 5 | \title{Function to create PCoA} 6 | \usage{ 7 | PCoA3DAnal.16SRef( 8 | mbSetObj, 9 | barplotNm, 10 | ordMeth, 11 | distName, 12 | taxrank, 13 | metadata, 14 | format = "png", 15 | dpi = 72 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | } 21 | \description{ 22 | This function creates data for plotting PCoA. 23 | } 24 | \author{ 25 | Jeff Xia \email{jeff.xia@mcgill.ca} 26 | McGill University, Canada 27 | License: GNU GPL (>= 2) 28 | } 29 | -------------------------------------------------------------------------------- /man/Perform16FunAnot_mem.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{Perform16FunAnot_mem} 4 | \alias{Perform16FunAnot_mem} 5 | \title{Main function to perform 16S functional annotation} 6 | \usage{ 7 | Perform16FunAnot_mem(mbSetObj, type, pipeline, ggversion) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This is the main function to perform either PICRUSt or 14 | SILVA for functional annotation on the mbSetObj. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/PerformAlphaDiversityComp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PerformAlphaDiversityComp} 4 | \alias{PerformAlphaDiversityComp} 5 | \title{Perform alpha diversity} 6 | \usage{ 7 | PerformAlphaDiversityComp(mbSetObj, opt, metadata) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{opt}{Character, input the name of the statistical method 13 | used to calculate the significance of the alpha diversity measure. 14 | "tt" for T-test or ANOVA, and "nonpar" for Mann-Whitney or 15 | Kruskall-Wallis.} 16 | 17 | \item{metadata}{Character, input the name of the experimental factor 18 | to group the samples.} 19 | } 20 | \description{ 21 | This functions performs alpha diversity. 22 | } 23 | \author{ 24 | Jeff Xia \email{jeff.xia@mcgill.ca} 25 | McGill University, Canada 26 | License: GNU GPL (>= 2) 27 | } 28 | -------------------------------------------------------------------------------- /man/PerformBatchCorrection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_qc.R 3 | \name{PerformBatchCorrection} 4 | \alias{PerformBatchCorrection} 5 | \title{Perform batch correction of meta-analysis datasets} 6 | \usage{ 7 | PerformBatchCorrection() 8 | } 9 | \description{ 10 | Perform batch correction of meta-analysis datasets 11 | } 12 | \author{ 13 | Jeff Xia \email{jeff.xia@mcgill.ca} 14 | McGill University, Canada 15 | License: GNU GPL (>= 2) 16 | } 17 | -------------------------------------------------------------------------------- /man/PerformBetaDiversity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PerformBetaDiversity} 4 | \alias{PerformBetaDiversity} 5 | \title{Function to plot beta diversity.} 6 | \usage{ 7 | PerformBetaDiversity( 8 | mbSetObj, 9 | plotNm, 10 | ordmeth, 11 | distName, 12 | colopt, 13 | metadata, 14 | showlabel, 15 | taxrank, 16 | taxa, 17 | alphaopt, 18 | ellopt, 19 | comp.method, 20 | format = "png", 21 | dpi = 72, 22 | custom_col = "none", 23 | interactive = FALSE 24 | ) 25 | } 26 | \arguments{ 27 | \item{mbSetObj}{Input the name of the mbSetObj.} 28 | 29 | \item{plotNm}{Character, input the name of the beta-diversity score plot.} 30 | 31 | \item{ordmeth}{Ordination method. Character, input "PCoA" to create a PCoA plot and 32 | "NMDS" to create a NMDS plot.} 33 | 34 | \item{distName}{Character, input the name of the distance method. "bray" for 35 | Bray-Curtis Index, "jsd" for Jensen-Shannon Divergence, "jaccard" for Jaccard Index, 36 | "unifrac" for Unweighted Unifrac Distance and "wunifrac" for Weighted Unifrac Distance.} 37 | 38 | \item{colopt}{Character, input whether the data points should be colored by 39 | experimental factor with "expfac", taxon abundance with "taxa" or alpha diversity 40 | with "alphadiv".} 41 | 42 | \item{metadata}{Input the name of the preferred experimental factor, only used if 43 | colopt is "expfac".} 44 | 45 | \item{showlabel}{Character, input whether or not to label samples in the plot. 46 | "none" to label no samples, "samnm" to label samples by their name, and "Class" for 47 | their group classification.} 48 | 49 | \item{taxrank}{Character, input the taxonomic level to calculate 50 | beta-diversity.} 51 | 52 | \item{taxa}{Character, input the specific taxon used to color the data points. Only 53 | used if colopt is set to "taxa".} 54 | 55 | \item{alphaopt}{Character, input the name of the alpha-diversity metric. "Chao1", 56 | "Observed", "ACE", "Shannon", "Simpson", or "Fisher".} 57 | 58 | \item{ellopt}{Character, input "yes" to show ellipses and "no" to not.} 59 | 60 | \item{format}{Character, input the preferred 61 | format of the plot. By default it is set to "png".} 62 | 63 | \item{dpi}{Numeric, input the dots per inch. By default 64 | it is set to 72.} 65 | 66 | \item{custom_col}{Set to "none" to use the default color palette, "viridis" to use the 67 | default viridis color palette, "plasma" to use the plasma viridis color palette and 68 | "magma" to use the magma color palette.} 69 | 70 | \item{interactive}{Boolean, if set to TRUE, saves the plot 71 | as an interactive html plot.} 72 | } 73 | \description{ 74 | This functions creates beta diversity plots. 75 | } 76 | \author{ 77 | Jeff Xia \email{jeff.xia@mcgill.ca} 78 | McGill University, Canada 79 | License: GNU GPL (>= 2) 80 | } 81 | -------------------------------------------------------------------------------- /man/PerformCategoryComp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PerformCategoryComp} 4 | \alias{PerformCategoryComp} 5 | \title{Function to perform categorical comparison.} 6 | \usage{ 7 | PerformCategoryComp( 8 | mbSetObj, 9 | taxaLvl, 10 | method, 11 | distnm, 12 | variable, 13 | covariates = FALSE, 14 | cov.vec = NA, 15 | model.additive = TRUE 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | 21 | \item{taxaLvl}{Input the name of the taxonomic level to calculate Beta-diversity comparison.} 22 | 23 | \item{method}{Statistical method to calculate 24 | beta-diversity significance. Use "adonis" for Permutational MANOVA, "anosim" for 25 | Analysis of Group Similarities and "permdisp" for 26 | Homogeneity of Group Dispersions.} 27 | 28 | \item{distnm}{Character, input the name of the distance method. "bray" for 29 | Bray-Curtis Index, "jsd" for Jensen-Shannon Divergence, "jaccard" for Jaccard Index, 30 | "unifrac" for Unweighted Unifrac Distance and "wunifrac" for Weighted Unifrac Distance.} 31 | 32 | \item{variable}{Input the name of the experimental factor to group the samples.} 33 | 34 | \item{covariates}{Boolean. TRUE to consider covariates, FALSE to only consider the 35 | main effect. Only valid for PERMANOVA.} 36 | 37 | \item{cov.vec}{Character vector. Input the names of the covariates to consider in the 38 | PERMANOVA model.} 39 | 40 | \item{model.additive}{Boolean. If TRUE, the model will be additive (i.e. data ~ var1 + var2), 41 | making the assumption that the two factor variables are independent. 42 | However, if FALSE, the model will consider the synergistic effects of the variables - interaction (i.e. data ~ var1*var2). 43 | "Different explanatory variables the effects on the outcome of a change in one variable may either not depend on the 44 | level of the other variable (additive model) or it may depend on the level of the other variable (interaction model)."} 45 | } 46 | \description{ 47 | This functions performs categorical comparisons. 48 | } 49 | \author{ 50 | Jeff Xia \email{jeff.xia@mcgill.ca} 51 | McGill University, Canada 52 | License: GNU GPL (>= 2) 53 | } 54 | -------------------------------------------------------------------------------- /man/PerformDEAnalyse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mmp_utils.R 3 | \name{PerformDEAnalyse} 4 | \alias{PerformDEAnalyse} 5 | \title{Perform differential analysis} 6 | \usage{ 7 | PerformDEAnalyse( 8 | mbSetObj, 9 | taxalvl = "Genus", 10 | netType = "gem", 11 | overlay, 12 | initDE = 1, 13 | analysisVar = "CLASS", 14 | adjustedVar, 15 | alg = "limma", 16 | plvl = 0.05, 17 | fc.lvl = 1, 18 | selected = "NA", 19 | nonpar = FALSE 20 | ) 21 | } 22 | \arguments{ 23 | \item{mbSetObj}{Input the name of the mbSetObj.} 24 | 25 | \item{taxalvl}{Character, input taxonomy level} 26 | 27 | \item{metadata}{Character, input the name of the experimental factor 28 | to group the samples.} 29 | } 30 | \description{ 31 | This functions performs alpha diversity. 32 | } 33 | \author{ 34 | Jeff Xia \email{jeff.xia@mcgill.ca} 35 | McGill University, Canada 36 | License: GNU GPL (>= 2) 37 | } 38 | -------------------------------------------------------------------------------- /man/PerformKOEnrichAnalysis_KO01100.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{PerformKOEnrichAnalysis_KO01100} 4 | \alias{PerformKOEnrichAnalysis_KO01100} 5 | \title{Function to prepare KO enrichment analysis.} 6 | \usage{ 7 | PerformKOEnrichAnalysis_KO01100(mbSetObj, category, file.nm) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function performs KO enrichment analysis 14 | using the KO01100 map. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/PerformKOProjection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{PerformKOProjection} 4 | \alias{PerformKOProjection} 5 | \title{Function to perform KO projection} 6 | \usage{ 7 | PerformKOProjection(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function projects user-uploaded 14 | KOs onto the KEGG Global Metabolic Network. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/PerformKOmapping.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{PerformKOmapping} 4 | \alias{PerformKOmapping} 5 | \title{Function to perform KO mapping.} 6 | \usage{ 7 | PerformKOmapping(mbSetObj, geneIDs, type) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function performs KO mapping. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PerformLefseAnal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PerformLefseAnal} 4 | \alias{PerformLefseAnal} 5 | \title{Main function to perform LEfSe analysis} 6 | \usage{ 7 | PerformLefseAnal( 8 | mbSetObj, 9 | p.lvl, 10 | pvalOpt = "fdr", 11 | lda.lvl, 12 | variable, 13 | isfunc, 14 | shotgunid, 15 | taxrank 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | 21 | \item{p.lvl}{Numeric, input the adjusted p-value cutoff.} 22 | 23 | \item{lda.lvl}{Numeric, input the Log LDA score cutoff.} 24 | 25 | \item{variable}{Character, input the name of the experimental factor.} 26 | 27 | \item{isfunc}{Logical, default set to "F".} 28 | 29 | \item{shotgunid}{Only valid for SDP module, set to "NA".} 30 | 31 | \item{taxrank}{Character, input the taxonomic level to perform 32 | univariate analysis.} 33 | 34 | \item{datatype}{Character, input whether the data is marker gene 35 | data ("16S") or metagenomic data ("metageno").} 36 | } 37 | \description{ 38 | This functions performs LEfSe analysis on the microbiome data. 39 | } 40 | \author{ 41 | Jeff Xia \email{jeff.xia@mcgill.ca} 42 | McGill University, Canada 43 | License: GNU GPL (>= 2) 44 | } 45 | -------------------------------------------------------------------------------- /man/PerformMetaEffectSize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_methods.R 3 | \name{PerformMetaEffectSize} 4 | \alias{PerformMetaEffectSize} 5 | \title{Perform differential abundance analysis on individual dataset and apply combine effect size meta-analysis method on the results} 6 | \usage{ 7 | PerformMetaEffectSize( 8 | mbSetObj = NA, 9 | imgName = "", 10 | taxrank = "OTU", 11 | selMeta, 12 | BHth = 0.05, 13 | de.method = "LM", 14 | ef.method = "REML", 15 | format = "png", 16 | dpi = 72 17 | ) 18 | } 19 | \arguments{ 20 | \item{imgName}{File name of output bar plot image} 21 | 22 | \item{selMeta}{selected metadata} 23 | 24 | \item{BHth}{P-value threshold} 25 | 26 | \item{de.method}{Differential abundance method} 27 | 28 | \item{ef.method}{Effect size model} 29 | 30 | \item{format}{file format of output image} 31 | 32 | \item{dpi}{dots per inch resolution of image (default 72)} 33 | 34 | \item{method}{Method used, either "rem" or "fem"} 35 | 36 | \item{taxRank}{selected taxa rank which to perform analysis} 37 | } 38 | \description{ 39 | Perform differential abundance analysis on individual dataset and apply combine effect size meta-analysis method on the results 40 | } 41 | \author{ 42 | Jeff Xia \email{jeff.xia@mcgill.ca} 43 | McGill University, Canada 44 | License: GNU GPL (>= 2) 45 | } 46 | -------------------------------------------------------------------------------- /man/PerformMetaboNormalization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{PerformMetaboNormalization} 4 | \alias{PerformMetaboNormalization} 5 | \title{Function to perform normalization on metabolomics data} 6 | \usage{ 7 | PerformMetaboNormalization( 8 | mbSetObj, 9 | rowNorm, 10 | transNorm, 11 | scaleNorm, 12 | isAutoScale 13 | ) 14 | } 15 | \arguments{ 16 | \item{transNorm}{Select option to transform the data, "LogNorm" for Log Normalization, 17 | and "CrNorm" for Cubic Root Transformation.} 18 | 19 | \item{scaleNorm}{Select option for scaling the data, "MeanCenter" for Mean Centering, 20 | "AutoNorm" for Autoscaling, "ParetoNorm" for Pareto Scaling, amd "RangeNorm" for Range Scaling.} 21 | 22 | \item{ref}{Input the name of the reference sample or the reference feature, use " " around the name.} 23 | 24 | \item{ratio}{This option is only for biomarker analysis.} 25 | 26 | \item{ratioNum}{Relevant only for biomarker analysis.} 27 | } 28 | \description{ 29 | This function performs normalization on the uploaded metabolomics 30 | data. 31 | "SumNorm" for Normalization to constant sum, 32 | "MedianNorm" for Normalization to sample median, and 33 | } 34 | \author{ 35 | Jeff Xia \email{jeff.xia@mcgill.ca} 36 | McGill University, Canada 37 | License: GNU GPL (>= 2) 38 | } 39 | -------------------------------------------------------------------------------- /man/PerformMetagenomeSeqAnal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PerformMetagenomeSeqAnal} 4 | \alias{PerformMetagenomeSeqAnal} 5 | \title{Main function to perform metagenome seq analysis} 6 | \usage{ 7 | PerformMetagenomeSeqAnal(mbSetObj, variable, p.lvl, shotgunid, taxrank, model) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{variable}{Character, input the name of the experimental factor.} 13 | 14 | \item{p.lvl}{Numeric, input the adjusted p-value cutoff.} 15 | 16 | \item{shotgunid}{Only valid for SDP module, set to "NA".} 17 | 18 | \item{taxrank}{Character, input the taxonomic level to perform 19 | univariate analysis.} 20 | 21 | \item{model}{Character, input the name of the statistical 22 | model to fit the data. Use "zigfit" for zero-inflated Gaussian fit 23 | and "ffm" for the fitFeatureModel.} 24 | 25 | \item{datatype}{Character, input whether the data is marker gene 26 | data ("16S") or metagenomic data ("metageno").} 27 | } 28 | \description{ 29 | This functions performs metagenome seq analysis on the microbiome data. 30 | } 31 | \author{ 32 | Jeff Xia \email{jeff.xia@mcgill.ca} 33 | McGill University, Canada 34 | License: GNU GPL (>= 2) 35 | } 36 | -------------------------------------------------------------------------------- /man/PerformNetworkCorrelation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PerformNetworkCorrelation} 4 | \alias{PerformNetworkCorrelation} 5 | \title{Function to call for correlation network} 6 | \usage{ 7 | PerformNetworkCorrelation( 8 | mbSetObj, 9 | taxrank, 10 | cor.method = "pearson", 11 | colorOpt = "expr", 12 | permNum = 100, 13 | pvalCutoff = 0.05, 14 | corrCutoff = 0.3, 15 | abundOpt = "mean", 16 | corr.net.name, 17 | plotNet = FALSE, 18 | netType = "static", 19 | netLayout = "kk", 20 | netTextSize = 2.5 21 | ) 22 | } 23 | \arguments{ 24 | \item{mbSetObj}{Input the name of the mbSetObj.} 25 | 26 | \item{taxrank}{Character, input the taxonomic level 27 | to perform partial correlation analysis.} 28 | 29 | \item{cor.method}{Character, input the correlation method. 30 | Supported methods are pearson, spearman, kendall and sparcc.} 31 | 32 | \item{colorOpt}{Character, input what to color the nodes by. Default 33 | the nodes will be colored by their expression levels.} 34 | 35 | \item{permNum}{Numeric, input the number of permutations to perform. Default 36 | is set to 100.} 37 | 38 | \item{pvalCutoff}{Numeric, input the p-value cutoff. Default is set to 0.05.} 39 | 40 | \item{corrCutoff}{Numeric, input the correlation cutoff. Default is set to 0.3.} 41 | 42 | \item{abundOpt}{Character, default is set to "mean".} 43 | 44 | \item{corr.net.name}{Character, input the name of the plot to save.} 45 | 46 | \item{plotNet}{Boolean. Set to TRUE if you would like a network visualization 47 | outputted to your current working directory.} 48 | 49 | \item{netLayout}{Character, layout from ggraph. "kk" for the spring-based algorithm by Kamada and Kawai 50 | as default. "drl" for force directed algorithm from the DrL toolbox. "lgl" for Large Graph Layout. "fr" for 51 | force-directed of Fruchterman and Reingold.} 52 | 53 | \item{netTextSize}{Numeric, input the preferred font size to be used in the network 54 | plot.} 55 | 56 | \item{networkType}{Character, "static" to create a static image or 57 | "interactive" to create an interactive network saved as an html 58 | in your working directory.} 59 | } 60 | \description{ 61 | This function runs the fastspar or cor.test 62 | } 63 | -------------------------------------------------------------------------------- /man/PerformNormalization.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{PerformNormalization} 4 | \alias{PerformNormalization} 5 | \title{Function to perform normalization} 6 | \usage{ 7 | PerformNormalization( 8 | mbSetObj, 9 | rare.opt, 10 | scale.opt, 11 | transform.opt, 12 | isAutoScale = F 13 | ) 14 | } 15 | \arguments{ 16 | \item{mbSetObj}{Input the name of the mbSetObj.} 17 | 18 | \item{rare.opt}{Character, "rarewi" to rarefy the data and 19 | "none" to not.} 20 | 21 | \item{scale.opt}{Character, input the name of the data scaling option. 22 | "colsum" for total sum scaling, "CSS" for cumulative sum scaling, 23 | "upperquartile" for upper-quartile normalization, and "none" to none.} 24 | 25 | \item{transform.opt}{Character, input the name of the data transformation 26 | to be applied. "rle" for relative log expression, "TMM" for trimmed mean of 27 | M-values, "clr" for centered log ratio, and "none" for none.} 28 | } 29 | \description{ 30 | This function performs normalization on the uploaded 31 | data. 32 | } 33 | \author{ 34 | Jeff Xia \email{jeff.xia@mcgill.ca} 35 | McGill University, Canada 36 | License: GNU GPL (>= 2) 37 | } 38 | -------------------------------------------------------------------------------- /man/PerformNormalizationMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{PerformNormalizationMeta} 4 | \alias{PerformNormalizationMeta} 5 | \title{Function to perform normalization} 6 | \usage{ 7 | PerformNormalizationMeta( 8 | mbSetObj, 9 | dataName, 10 | rare.opt, 11 | scale.opt, 12 | transform.opt 13 | ) 14 | } 15 | \arguments{ 16 | \item{mbSetObj}{Input the name of the mbSetObj.} 17 | 18 | \item{dataName}{Input the name of selected dataset data file} 19 | 20 | \item{rare.opt}{Character, "rarewi" to rarefy the data and 21 | "none" to not.} 22 | 23 | \item{scale.opt}{Character, input the name of the data scaling option. 24 | "colsum" for total sum scaling, "CSS" for cumulative sum scaling, 25 | "upperquartile" for upper-quartile normalization, and "none" to none.} 26 | 27 | \item{transform.opt}{Character, input the name of the data transformation 28 | to be applied. "rle" for relative log expression, "TMM" for trimmed mean of 29 | M-values, "clr" for centered log ratio, and "none" for none.} 30 | } 31 | \description{ 32 | This function performs normalization on the uploaded 33 | data. 34 | } 35 | \author{ 36 | Jeff Xia \email{jeff.xia@mcgill.ca} 37 | McGill University, Canada 38 | License: GNU GPL (>= 2) 39 | } 40 | -------------------------------------------------------------------------------- /man/PerformPartialCorr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_multivar.R 3 | \name{PerformPartialCorr} 4 | \alias{PerformPartialCorr} 5 | \title{Perform Partial Correlation Analysis} 6 | \usage{ 7 | PerformPartialCorr( 8 | mbSetObj, 9 | taxa.lvl = "Phylum", 10 | variable = NA, 11 | alg = "pearson", 12 | pval.cutoff = 0.05 13 | ) 14 | } 15 | \arguments{ 16 | \item{mbSetObj}{Input the name of the mbSetObj.} 17 | 18 | \item{taxa.lvl}{Character, input the taxonomic level 19 | to perform partial correlation analysis.} 20 | 21 | \item{variable}{Character, input the selected variable.} 22 | 23 | \item{alg}{Use "kendall" or "spearman" for non-parametric and 24 | "pearson" for parametric.} 25 | } 26 | \description{ 27 | Function to perform and plot 28 | partial correlations between all taxonomic features, 29 | the outcome, and selected confounders. 30 | NOTE: All metadata must be numeric 31 | } 32 | -------------------------------------------------------------------------------- /man/PerformRNAseqDE.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PerformRNAseqDE} 4 | \alias{PerformRNAseqDE} 5 | \title{Main function to perform RNAseq analysis} 6 | \usage{ 7 | PerformRNAseqDE(mbSetObj, opts, p.lvl, variable, shotgunid, taxrank) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{opts}{Character, input "EdgeR" to use the edgeR algorithm and 13 | "DESeq2" to use the DESeq2 algorithm.} 14 | 15 | \item{p.lvl}{Numeric, input the adjusted p-value cutoff.} 16 | 17 | \item{variable}{Character, input the experimental factor.} 18 | 19 | \item{shotgunid}{Only valid for SDP module, set to "NA".} 20 | 21 | \item{taxrank}{Character, input the taxonomic level 22 | to use for RNAseq analysis.} 23 | 24 | \item{datatype}{Character, input "16S" if the data is marker gene 25 | data and "metageno" if it is metagenomic data.} 26 | } 27 | \description{ 28 | This functions performs RNAseq analysis on the microbiome data. 29 | } 30 | \author{ 31 | Jeff Xia \email{jeff.xia@mcgill.ca} 32 | McGill University, Canada 33 | License: GNU GPL (>= 2) 34 | } 35 | -------------------------------------------------------------------------------- /man/PerformRarefaction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{PerformRarefaction} 4 | \alias{PerformRarefaction} 5 | \title{Utility function to perform rarefraction (used by PerformNormalization)} 6 | \usage{ 7 | PerformRarefaction(mbSetObj, data, rare.opt) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{data}{Input the data.} 13 | 14 | \item{rare.opt}{Input the option for rarefying the microbiome data. 15 | "rarewi" to rarefy with replacement to the minimum library depth and 16 | "rarewo" to rarefy without replacemet to the minimum library depth.} 17 | } 18 | \description{ 19 | This function performs rarefraction on the uploaded 20 | data. 21 | } 22 | \author{ 23 | Jeff Xia \email{jeff.xia@mcgill.ca} 24 | McGill University, Canada 25 | License: GNU GPL (>= 2) 26 | } 27 | -------------------------------------------------------------------------------- /man/PerformRefDataMapping.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ppd_utils.R 3 | \name{PerformRefDataMapping} 4 | \alias{PerformRefDataMapping} 5 | \title{Function to perform reference data mapping.} 6 | \usage{ 7 | PerformRefDataMapping(mbSetObj, refdataNm, taxo_type, sample_var, biome) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function performs reference data mapping. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PerformUnivarTest.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PerformUnivarTest} 4 | \alias{PerformUnivarTest} 5 | \title{Main function to perform classical univariate analysis.} 6 | \usage{ 7 | PerformUnivarTest(mbSetObj, variable, p.lvl, shotgunid, taxrank, statOpt) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{variable}{Character, input the name of the experimental factor.} 13 | 14 | \item{p.lvl}{Numeric, input the adjusted p-value cutoff.} 15 | 16 | \item{shotgunid}{If 16S, it is set to "NA".} 17 | 18 | \item{taxrank}{Character, input the taxonomic level to perform 19 | univariate analysis.} 20 | 21 | \item{statOpt}{Character, input "nonpar" to use non-paramentric tests including 22 | Mann-Whitney for two-group comparisons or Kruskall-Wallis for multiple group comparisons. 23 | Input "tt" to use parametric tests including T-tests for two-group comparisons and ANOVA 24 | for multiple group comparisons.} 25 | 26 | \item{datatype}{Character, input whether the data is marker gene 27 | data ("16S") or metagenomic data ("metageno").} 28 | } 29 | \description{ 30 | This functions performs classical univariate analysis 31 | on the normalized microbiome data. 32 | } 33 | \author{ 34 | Jeff Xia \email{jeff.xia@mcgill.ca} 35 | McGill University, Canada 36 | License: GNU GPL (>= 2) 37 | } 38 | -------------------------------------------------------------------------------- /man/PlotAlphaBoxData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotAlphaBoxData} 4 | \alias{PlotAlphaBoxData} 5 | \title{Function to create box plots for alpha diversity analysis} 6 | \usage{ 7 | PlotAlphaBoxData( 8 | mbSetObj, 9 | boxplotName, 10 | distName, 11 | metadata, 12 | colors = "default", 13 | format = "png", 14 | dpi = 72 15 | ) 16 | } 17 | \arguments{ 18 | \item{mbSetObj}{Input the name of the mbSetObj.} 19 | 20 | \item{boxplotName}{Character, input the name of the boxplot.} 21 | 22 | \item{distName}{Character, input the diversity measure 23 | to calculate alpha-diversity. "Chao1", "Observed", "ACE", "Shannon", 24 | "Simpson", or "Fisher".} 25 | 26 | \item{metadata}{Input the name of the experimental factor to group the samples.} 27 | 28 | \item{colors}{Use "default", "viridis" to 29 | use the viridis color palette, "plasma" to use the plasma 30 | color palette, "magma" to use the magma color palette, or 31 | "magma" to use the magma color palette.} 32 | 33 | \item{format}{Character, input the preferred 34 | format of the plot. By default it is set to "png".} 35 | 36 | \item{dpi}{Numeric, input the dots per inch. By default 37 | it is set to 72.} 38 | } 39 | \description{ 40 | This functions performs metagenome seq analysis on the microbiome data. 41 | } 42 | \author{ 43 | Jeff Xia \email{jeff.xia@mcgill.ca} 44 | McGill University, Canada 45 | License: GNU GPL (>= 2) 46 | } 47 | -------------------------------------------------------------------------------- /man/PlotAlphaData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotAlphaData} 4 | \alias{PlotAlphaData} 5 | \title{Function to plot alpha-diversity analysis.} 6 | \usage{ 7 | PlotAlphaData( 8 | mbSetObj, 9 | data.src, 10 | bargraphName, 11 | distName, 12 | metadata, 13 | taxrank, 14 | colors = "default", 15 | format = "png", 16 | dpi = 72, 17 | interactive = FALSE 18 | ) 19 | } 20 | \arguments{ 21 | \item{mbSetObj}{Input the name of the mbSetObj.} 22 | 23 | \item{data.src}{Character, input whether alpha diversity 24 | is calculated using the filtered /("filt"/) or raw data /("orig"/).} 25 | 26 | \item{bargraphName}{Character, input the name of the plot.} 27 | 28 | \item{distName}{Character, input the diversity measure 29 | to calculate alpha-diversity. "Chao1", "Observed", "ACE", "Shannon", 30 | "Simpson", or "Fisher".} 31 | 32 | \item{metadata}{Character, input the name of the experimental 33 | factor to group the samples.} 34 | 35 | \item{taxrank}{Character, input the taxonomic level to calculate 36 | alpha-diversity. "Phylum", "Class", "Order", 37 | "Family", "Genus", "Species" or "OTU".} 38 | 39 | \item{colors}{Character, set to "default" to use the default colors, 40 | "viridis" to use the viridis color palette, "plasma" to use the plasma 41 | color palette, "magma" to use the magma color palette, or 42 | "magma" to use the magma color palette.} 43 | 44 | \item{format}{Character, input the preferred 45 | format of the plot. By default it is set to "png".} 46 | 47 | \item{dpi}{Numeric, input the dots per inch. By default 48 | it is set to 72.} 49 | 50 | \item{group}{Boolean, input whether or not to group the samples in the 51 | dot plot. 0 or 1.} 52 | } 53 | \description{ 54 | This functions creates a plot for alpha-diversity. 55 | } 56 | \author{ 57 | Jeff Xia \email{jeff.xia@mcgill.ca} 58 | McGill University, Canada 59 | License: GNU GPL (>= 2) 60 | } 61 | -------------------------------------------------------------------------------- /man/PlotBetaSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_methods.R 3 | \name{PlotBetaSummary} 4 | \alias{PlotBetaSummary} 5 | \title{Perform beta diversity meta-analysis} 6 | \usage{ 7 | PlotBetaSummary( 8 | mbSetObj, 9 | plotNm, 10 | taxalvl, 11 | sel.meta, 12 | alg, 13 | format = "png", 14 | dpi = 72 15 | ) 16 | } 17 | \arguments{ 18 | \item{mbSetObj}{Input the name of the mbSetObj.} 19 | 20 | \item{plotNm}{File name of output summary image} 21 | 22 | \item{taxalvl}{Selected taxonomy rank} 23 | 24 | \item{sel.meta}{Selected metadata} 25 | 26 | \item{alg}{statistical comparison algorithm to detect significant different between metadata groups} 27 | 28 | \item{format}{File format of output image (default to png)} 29 | 30 | \item{dpi}{dots per inch resolution of image (default 72)} 31 | } 32 | \description{ 33 | Compute beta diversity indices of datasets and plot summary figure, adapted from work of Jordan Bisanz 34 | } 35 | \author{ 36 | Jeff Xia \email{jeff.xia@mcgill.ca} 37 | McGill University, Canada 38 | License: GNU GPL (>= 2) 39 | } 40 | -------------------------------------------------------------------------------- /man/PlotBoxData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_graphics.R 3 | \name{PlotBoxData} 4 | \alias{PlotBoxData} 5 | \title{Function to create box plots of important features} 6 | \usage{ 7 | PlotBoxData(mbSetObj, boxplotName, feat, format = "png", dpi = 72) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{boxplotName}{Character, input the name of the 13 | box plot.} 14 | 15 | \item{feat}{Character, input the name of the selected 16 | feature.} 17 | 18 | \item{format}{Character, by default the plot format 19 | is "png".} 20 | 21 | \item{dpi}{Dots per inch. Numeric, by default 22 | it is set to 72.} 23 | } 24 | \description{ 25 | This functions plots box plots of a selected feature. 26 | } 27 | \author{ 28 | Jeff Xia \email{jeff.xia@mcgill.ca} 29 | McGill University, Canada 30 | License: GNU GPL (>= 2) 31 | } 32 | -------------------------------------------------------------------------------- /man/PlotBoxDataCorr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotBoxDataCorr} 4 | \alias{PlotBoxDataCorr} 5 | \title{Function to create box plots of important features} 6 | \usage{ 7 | PlotBoxDataCorr( 8 | mbSetObj, 9 | boxplotName, 10 | feat, 11 | format = "png", 12 | sel.meta = "", 13 | dpi = 72 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{boxplotName}{Character, input the name of the 20 | box plot.} 21 | 22 | \item{feat}{Character, input the name of the selected 23 | feature.} 24 | 25 | \item{format}{Character, by default the plot format 26 | is "png".} 27 | 28 | \item{dpi}{Dots per inch. Numeric, by default 29 | it is set to 72.} 30 | } 31 | \description{ 32 | This functions plots box plots of a selected feature. 33 | } 34 | \author{ 35 | Jeff Xia \email{jeff.xia@mcgill.ca} 36 | McGill University, Canada 37 | License: GNU GPL (>= 2) 38 | } 39 | -------------------------------------------------------------------------------- /man/PlotCorr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PlotCorr} 4 | \alias{PlotCorr} 5 | \title{Plot Pattern Search} 6 | \usage{ 7 | PlotCorr(mbSetObj, imgName, format = "png", dpi = 72, appendnm, width = NA) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{imgName}{Character, input the name 13 | of the plot.} 14 | 15 | \item{format}{Character, input the preferred 16 | format of the plot. By default it is set to "png".} 17 | 18 | \item{dpi}{Numeric, input the dots per inch. By default 19 | it is set to 72.} 20 | 21 | \item{width}{Numeric, input the width of the plot. By 22 | default it is set to NA.} 23 | } 24 | \description{ 25 | This functions plots a bargraph of the 26 | correlation between a specific taxon to other taxa in the Pattern 27 | Search analysis. 28 | } 29 | \author{ 30 | Jeff Xia \email{jeff.xia@mcgill.ca} 31 | McGill University, Canada 32 | License: GNU GPL (>= 2) 33 | } 34 | -------------------------------------------------------------------------------- /man/PlotDataPieFromPie.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotDataPieFromPie} 4 | \alias{PlotDataPieFromPie} 5 | \title{Function to plot pie-chart data.} 6 | \usage{ 7 | PlotDataPieFromPie(mbSetObj, taxalvl, metadata, clslevel, taxaposn, lowtaxa) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{taxalvl}{Character, input the taxonomic level to perform 13 | classification. For instance, "Genus" to use the Genus level.} 14 | } 15 | \description{ 16 | This functions plots pie charts of microbiome data. 17 | } 18 | \author{ 19 | Jeff Xia \email{jeff.xia@mcgill.ca} 20 | McGill University, Canada 21 | License: GNU GPL (>= 2) 22 | } 23 | -------------------------------------------------------------------------------- /man/PlotEnrichNet.Overview.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{PlotEnrichNet.Overview} 4 | \alias{PlotEnrichNet.Overview} 5 | \title{Create network for enrichmnet overview} 6 | \usage{ 7 | PlotEnrichNet.Overview(hits, pvals) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function creates the plot 14 | for the enrichent network overview. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/PlotFunAnotSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotFunAnotSummary} 4 | \alias{PlotFunAnotSummary} 5 | \title{Plot functional annotation summary} 6 | \usage{ 7 | PlotFunAnotSummary(mbSetObj, imgName, format = "png", funanno, dpi = 72) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{format}{Character, input the preferred 13 | format of the plot. By default it is set to "png".} 14 | 15 | \item{dpi}{Numeric, input the dots per inch. By default 16 | it is set to 72.} 17 | } 18 | \description{ 19 | This functions plots the functional annotation summary. 20 | } 21 | \author{ 22 | Jeff Xia \email{jeff.xia@mcgill.ca} 23 | McGill University, Canada 24 | License: GNU GPL (>= 2) 25 | } 26 | -------------------------------------------------------------------------------- /man/PlotFunctionStack.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{PlotFunctionStack} 4 | \alias{PlotFunctionStack} 5 | \title{Function to plot stacked bar chart of functional data.} 6 | \usage{ 7 | PlotFunctionStack( 8 | mbSetObj, 9 | summaryplot, 10 | functionlvl, 11 | abundcal, 12 | geneidtype, 13 | metadata, 14 | colpalopt, 15 | format = "png", 16 | dpi = 72 17 | ) 18 | } 19 | \arguments{ 20 | \item{mbSetObj}{Input the name of the mbSetObj.} 21 | } 22 | \description{ 23 | This function plots stacked bar charts of functional data. 24 | } 25 | \author{ 26 | Jeff Xia \email{jeff.xia@mcgill.ca} 27 | McGill University, Canada 28 | License: GNU GPL (>= 2) 29 | } 30 | -------------------------------------------------------------------------------- /man/PlotGroupPieGraph.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotGroupPieGraph} 4 | \alias{PlotGroupPieGraph} 5 | \title{Main function to plot pie graphs of microbiome data.} 6 | \usage{ 7 | PlotGroupPieGraph( 8 | mbSetObj, 9 | taxalvl, 10 | metadata, 11 | clslevel, 12 | feat_cnt, 13 | calcmeth, 14 | toptaxapie, 15 | pietoptaxaopt 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | 21 | \item{taxalvl}{Character, input the taxonomic level to perform 22 | classification. For instance, "Genus" to use the Genus level.} 23 | 24 | \item{metadata}{Character, select which grouping to use.} 25 | 26 | \item{clslevel}{Character, input which group to plot.} 27 | 28 | \item{feat_cnt}{Set the minimum feature count that is used to "bin" 29 | together small taxa.} 30 | 31 | \item{calcmeth}{Merge small taxa based on the sum /("sum"/) 32 | or median /("med"/) counts across all samples or groups.} 33 | } 34 | \description{ 35 | This functions plots pie graphs of microbiome data. 36 | } 37 | \author{ 38 | Jeff Xia \email{jeff.xia@mcgill.ca} 39 | McGill University, Canada 40 | License: GNU GPL (>= 2) 41 | } 42 | -------------------------------------------------------------------------------- /man/PlotHeatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_graphics.R 3 | \name{PlotHeatmap} 4 | \alias{PlotHeatmap} 5 | \title{Main function to plot heatmap.} 6 | \usage{ 7 | PlotHeatmap( 8 | mbSetObj, 9 | plotNm, 10 | dataOpt = "norm", 11 | scaleOpt = "row", 12 | smplDist, 13 | clstDist, 14 | palette, 15 | metadata, 16 | taxrank, 17 | viewOpt, 18 | doclust, 19 | format = "png", 20 | colname, 21 | rowname, 22 | fontsize_col, 23 | fontsize_row, 24 | annoPer, 25 | fzAnno, 26 | appendnm = "F", 27 | rowV = F, 28 | colV = T, 29 | var.inx = NA, 30 | border = T, 31 | width = NA, 32 | dpi = 72 33 | ) 34 | } 35 | \arguments{ 36 | \item{mbSetObj}{Input the name of the mbSetObj.} 37 | 38 | \item{plotNm}{Character, input the name 39 | of the plot.} 40 | 41 | \item{smplDist}{Input the distance measure. "euclidean" for 42 | Euclidean distance, "correlation" for Pearson, and "minkowski" 43 | for Minkowski.} 44 | 45 | \item{clstDist}{Character, input the name of the 46 | selected clustering algorithm. "ward" for Ward, "average" for Average, 47 | "complete" for Complete, and "single" for Single.} 48 | 49 | \item{palette}{Set the colors of the heatmap. By default it 50 | is set to "bwm", blue, white, to red. Use "gbr" for green, black, red, use 51 | "heat" for red to yellow, "topo" for blue to yellow, "gray" for 52 | white to black, and "byr" for blue, yellow, red.} 53 | 54 | \item{metadata}{Character, input the name of the experimental factor 55 | to cluster samples by.} 56 | 57 | \item{taxrank}{Character, input the taxonomic level to perform 58 | classification. For instance, "OTU-level" to use OTUs.} 59 | 60 | \item{viewOpt}{Character, "overview" to view an overview 61 | of the heatmap, and "detail" to iew a detailed view of the 62 | heatmap (< 1500 features).} 63 | 64 | \item{doclust}{Logicial, default set to "F".} 65 | 66 | \item{format}{Character, input the preferred 67 | format of the plot. By default it is set to "png".} 68 | 69 | \item{colname}{Logical, specify the if column name is shown, default set to "T",} 70 | 71 | \item{rowname}{Logical, specify the if row name is shown, default set to "T",} 72 | 73 | \item{fontsize_col}{Numeric, fontsize for colnames} 74 | 75 | \item{fontsize_row}{Numeric, fontsize for rownames} 76 | 77 | \item{appendnm}{Logical, "T" to prepend higher taxon names.} 78 | 79 | \item{rowV}{Logical, default set to "F".} 80 | 81 | \item{colV}{Logical, default set to "T".} 82 | 83 | \item{var.inx}{Default set to NA.} 84 | 85 | \item{width}{Numeric, input the width of the plot. By 86 | default it is set to NA.} 87 | 88 | \item{dpi}{Numeric, input the dots per inch. By default 89 | it is set to 72.} 90 | } 91 | \description{ 92 | This functions plots a heatmap from the mbSetObj. 93 | } 94 | \author{ 95 | Jeff Xia \email{jeff.xia@mcgill.ca} 96 | McGill University, Canada 97 | License: GNU GPL (>= 2) 98 | } 99 | -------------------------------------------------------------------------------- /man/PlotImpVar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PlotImpVar} 4 | \alias{PlotImpVar} 5 | \title{Helper function to plot variable importance (for RF and LEfSe)} 6 | \usage{ 7 | PlotImpVar(mbSetObj, imp.vec, xlbl, feature, color.BW = FALSE) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This functions plots the variable importance 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PlotImpVarLEfSe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PlotImpVarLEfSe} 4 | \alias{PlotImpVarLEfSe} 5 | \title{Plot LEfSe summary} 6 | \usage{ 7 | PlotImpVarLEfSe( 8 | mbSetObj, 9 | imp.vec, 10 | layoutOptlf, 11 | meta, 12 | colOpt = "default", 13 | color.BW = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | } 19 | \description{ 20 | This functions graphically summarizes the LEfSe results 21 | using a bargraph. 22 | } 23 | \author{ 24 | Jeff Xia \email{jeff.xia@mcgill.ca} 25 | McGill University, Canada 26 | License: GNU GPL (>= 2) 27 | } 28 | -------------------------------------------------------------------------------- /man/PlotLEfSeSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PlotLEfSeSummary} 4 | \alias{PlotLEfSeSummary} 5 | \title{Plot LEfSe summary} 6 | \usage{ 7 | PlotLEfSeSummary( 8 | mbSetObj, 9 | ldaFeature, 10 | layoutOptlf, 11 | imgName, 12 | format = "png", 13 | width = NA, 14 | dpi = 72, 15 | colOpt = "default" 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | 21 | \item{ldaFeature}{Numeric, input the number of top 22 | features to include in the plot.} 23 | 24 | \item{layoutOptlf}{Character, input "dot" to create the VIP plot 25 | and "bar" to create the bar graph.} 26 | 27 | \item{imgName}{Character, input the name 28 | of the plot.} 29 | 30 | \item{format}{Character, input the preferred 31 | format of the plot. By default it is set to "png".} 32 | 33 | \item{width}{Numeric, input the width of the plot. By 34 | default it is set to NA.} 35 | 36 | \item{dpi}{Numeric, input the dots per inch. By default 37 | it is set to 72.} 38 | 39 | \item{colOpt}{Character, "default", "viridis", 40 | "cividis", or "plasma".} 41 | } 42 | \description{ 43 | This functions graphically summarizes the LEfSe results 44 | in a VIP plot. 45 | } 46 | \author{ 47 | Jeff Xia \email{jeff.xia@mcgill.ca} 48 | McGill University, Canada 49 | License: GNU GPL (>= 2) 50 | } 51 | -------------------------------------------------------------------------------- /man/PlotLibSizeView.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{PlotLibSizeView} 4 | \alias{PlotLibSizeView} 5 | \title{Function to plot library size} 6 | \usage{ 7 | PlotLibSizeView(mbSetObj, imgName, format = "png", dpi = 72, dataName = "") 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{imgName}{Character, input the name 13 | of the plot.} 14 | 15 | \item{format}{Character, input the preferred 16 | format of the plot. By default it is set to "png".} 17 | 18 | \item{dpi}{Numeric, input the dots per inch. By default 19 | it is set to 72.} 20 | } 21 | \description{ 22 | This function creates a plot summarizing the library 23 | size of microbiome dataset. 24 | } 25 | \author{ 26 | Jeff Xia \email{jeff.xia@mcgill.ca} 27 | McGill University, Canada 28 | License: GNU GPL (>= 2) 29 | } 30 | -------------------------------------------------------------------------------- /man/PlotMetaDensity.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_qc.R 3 | \name{PlotMetaDensity} 4 | \alias{PlotMetaDensity} 5 | \title{Plot density plot of datasets in meta-analysis module} 6 | \usage{ 7 | PlotMetaDensity(imgNm, dpi = 72, format = "png", factor = "") 8 | } 9 | \arguments{ 10 | \item{imgNm}{name of the image to output} 11 | 12 | \item{dpi}{dots per inch resolution of image (default 72)} 13 | 14 | \item{format}{File format of output image (default to png)} 15 | } 16 | \description{ 17 | Plot density plot of datasets in meta-analysis module 18 | } 19 | \author{ 20 | Jeff Xia \email{jeff.xia@mcgill.ca} 21 | McGill University, Canada 22 | License: GNU GPL (>= 2) 23 | } 24 | -------------------------------------------------------------------------------- /man/PlotMetaPCA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_qc.R 3 | \name{PlotMetaPCA} 4 | \alias{PlotMetaPCA} 5 | \title{Plot PCA plot for meta-analysis samples} 6 | \usage{ 7 | PlotMetaPCA(imgNm, dpi, format, factor = "NA") 8 | } 9 | \arguments{ 10 | \item{imgNm}{name of the image to output} 11 | } 12 | \description{ 13 | Plot PCA plot for meta-analysis samples 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PlotOverallPieGraph.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotOverallPieGraph} 4 | \alias{PlotOverallPieGraph} 5 | \title{Main function to plot pie graphs of microbiome data.} 6 | \usage{ 7 | PlotOverallPieGraph( 8 | mbSetObj, 9 | taxalvl, 10 | feat_cnt, 11 | calcmeth, 12 | toptaxapie, 13 | pietoptaxaopt 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{taxalvl}{Character, input the taxonomic level to perform 20 | classification. For instance, "Genus" to use the Genus level.} 21 | 22 | \item{feat_cnt}{Set the minimum feature count that is used to "bin" 23 | together small taxa.} 24 | 25 | \item{calcmeth}{Merge small taxa based on the sum /("sum"/) 26 | or median /("med"/) counts across all samples or groups.} 27 | } 28 | \description{ 29 | This functions plots pie graphs of microbiome data. 30 | In particular, it plots the overall pie chart (all samples). The 31 | data used to calculate the pie-chart is saved in your working 32 | directory as ""piechart_abundances.csv". 33 | } 34 | \author{ 35 | Jeff Xia \email{jeff.xia@mcgill.ca} 36 | McGill University, Canada 37 | License: GNU GPL (>= 2) 38 | } 39 | -------------------------------------------------------------------------------- /man/PlotPCAView.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{PlotPCAView} 4 | \alias{PlotPCAView} 5 | \title{Plot PCA plot for multi-omics samples} 6 | \usage{ 7 | PlotPCAView(imgName, format = "png", dpi = 72, init) 8 | } 9 | \arguments{ 10 | \item{imgNm}{name of the image to output} 11 | } 12 | \description{ 13 | Plot PCA plot for multi-omics samples 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PlotPhylogeneticTree.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotPhylogeneticTree} 4 | \alias{PlotPhylogeneticTree} 5 | \title{Function to prepare data for phylogenetic tree.} 6 | \usage{ 7 | PlotPhylogeneticTree( 8 | mbSetObj, 9 | color, 10 | shape, 11 | taxa, 12 | treeshape, 13 | imgName, 14 | format = "png", 15 | dpi = 72 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | 21 | \item{format}{Character, input the preferred 22 | format of the plot. By default it is set to "png".} 23 | 24 | \item{dpi}{Numeric, input the dots per inch. By default 25 | it is set to 72.} 26 | } 27 | \description{ 28 | This functions prepares the data to plot the phylogenetic tree. 29 | } 30 | \author{ 31 | Jeff Xia \email{jeff.xia@mcgill.ca} 32 | McGill University, Canada 33 | License: GNU GPL (>= 2) 34 | } 35 | -------------------------------------------------------------------------------- /man/PlotPiechart.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotPiechart} 4 | \alias{PlotPiechart} 5 | \title{Function to create pie-chart plot.} 6 | \usage{ 7 | PlotPiechart(mbSetObj, rel_perct, pieName, format = "png", dpi = 72) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{format}{Character, input the preferred 13 | format of the plot. By default it is set to "png".} 14 | 15 | \item{dpi}{Numeric, input the dots per inch. By default 16 | it is set to 72.} 17 | } 18 | \description{ 19 | This functions creates the pie chart plot. 20 | } 21 | \author{ 22 | Jeff Xia \email{jeff.xia@mcgill.ca} 23 | McGill University, Canada 24 | License: GNU GPL (>= 2) 25 | } 26 | -------------------------------------------------------------------------------- /man/PlotRF.Classify.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PlotRF.Classify} 4 | \alias{PlotRF.Classify} 5 | \title{Plot Random Forest Classification} 6 | \usage{ 7 | PlotRF.Classify( 8 | mbSetObj, 9 | feature, 10 | imgName, 11 | format = "png", 12 | dpi = 72, 13 | width = NA 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{feature}{Numeric, input the number of important features. 20 | This is more for RF.VIP to make the sizes of the plot consistent.} 21 | 22 | \item{imgName}{Character, input the name of the plot.} 23 | 24 | \item{format}{Character, by default the plot is .png format.} 25 | 26 | \item{dpi}{The dots per inch. Numeric, by default it is set to 72.} 27 | 28 | \item{width}{Width of the plot. Numeric, by default it is set to NA.} 29 | } 30 | \description{ 31 | This functions plots the classification of samples 32 | from the Random Forest analysis. 33 | } 34 | \author{ 35 | Jeff Xia \email{jeff.xia@mcgill.ca} 36 | McGill University, Canada 37 | License: GNU GPL (>= 2) 38 | } 39 | -------------------------------------------------------------------------------- /man/PlotRF.VIP.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{PlotRF.VIP} 4 | \alias{PlotRF.VIP} 5 | \title{Plot variable importance ranked by MeanDecreaseAccuracy} 6 | \usage{ 7 | PlotRF.VIP(mbSetObj, feature, imgName, format = "png", dpi = 72, width = NA) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{feature}{Numeric, input the number of important features. 13 | This is more for RF.VIP to make the sizes of the plot consistent.} 14 | 15 | \item{imgName}{Character, input the name of the plot.} 16 | 17 | \item{format}{Character, by default the plot is .png format.} 18 | 19 | \item{dpi}{The dots per inch. Numeric, by default it is set to 72.} 20 | 21 | \item{width}{Width of the plot. Numeric, by default it is set to NA.} 22 | } 23 | \description{ 24 | This functions plot variable importance ranked by MeanDecreaseAccuracy 25 | from the random forest analysis. 26 | } 27 | \author{ 28 | Jeff Xia \email{jeff.xia@mcgill.ca} 29 | McGill University, Canada 30 | License: GNU GPL (>= 2) 31 | } 32 | -------------------------------------------------------------------------------- /man/PlotRareCurve.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{PlotRareCurve} 4 | \alias{PlotRareCurve} 5 | \title{Function to plot rarefraction curves} 6 | \usage{ 7 | PlotRareCurve(mbSetObj, graphName, variable) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{graphName}{Input the name of the plot.} 13 | 14 | \item{variable}{Input the experimental factor.} 15 | } 16 | \description{ 17 | This function plots rarefraction curves from the uploaded 18 | data for both sample-wise or group-wise 19 | } 20 | \author{ 21 | Jeff Xia \email{jeff.xia@mcgill.ca} 22 | McGill University, Canada 23 | License: GNU GPL (>= 2) 24 | } 25 | -------------------------------------------------------------------------------- /man/PlotRarefactionCurve.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotRarefactionCurve} 4 | \alias{PlotRarefactionCurve} 5 | \title{Function to create rarefraction curves of microbiome data} 6 | \usage{ 7 | PlotRarefactionCurve( 8 | mbSetObj, 9 | data.src, 10 | linecolor, 11 | linetype, 12 | facet, 13 | step = 5, 14 | imgName, 15 | format = "png", 16 | dpi = 72, 17 | interactive = FALSE 18 | ) 19 | } 20 | \arguments{ 21 | \item{mbSetObj}{Input the name of the mbSetObj.} 22 | 23 | \item{data.src}{Character, use "orig" to use the original data or 24 | "proc" to use the processed data.} 25 | 26 | \item{linecolor}{Character, input the metadata you wish to 27 | group the sample line colors.} 28 | 29 | \item{linetype}{Character, input the metadata you wish to 30 | group the sample line types.} 31 | 32 | \item{facet}{Character, input the metadata you wish to 33 | group the samples.} 34 | 35 | \item{step}{Numeric, input the step number. Default is set to 5.} 36 | 37 | \item{imgName}{Character, input the name of the plot to be saved.} 38 | 39 | \item{format}{Character, input the type of plot to be saved. Default is 40 | set to png.} 41 | 42 | \item{dpi}{Numeric, input the dpi for the plot to be saved. Default 43 | is set to 72.} 44 | 45 | \item{interactive}{Boolean, if set to TRUE, saves the plot 46 | as an interactive html plot.} 47 | } 48 | \description{ 49 | This functions plots rarefraction curves. 50 | } 51 | \author{ 52 | Jeff Xia \email{jeff.xia@mcgill.ca} 53 | McGill University, Canada 54 | License: GNU GPL (>= 2) 55 | } 56 | -------------------------------------------------------------------------------- /man/PlotSamplePieGraph.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotSamplePieGraph} 4 | \alias{PlotSamplePieGraph} 5 | \title{Main function to plot sample-wise pie graphs of microbiome data.} 6 | \usage{ 7 | PlotSamplePieGraph( 8 | mbSetObj, 9 | taxalvl, 10 | smplnm, 11 | feat_cnt, 12 | toptaxapie, 13 | pietoptaxaopt 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{taxalvl}{Character, input the taxonomic level to perform 20 | classification. For instance, "Genus" to use the Genus level.} 21 | 22 | \item{feat_cnt}{Set the minimum feature count that is used to "bin" 23 | together small taxa.} 24 | } 25 | \description{ 26 | This functions plots sample-wise pie graphs of microbiome data. 27 | } 28 | \author{ 29 | Jeff Xia \email{jeff.xia@mcgill.ca} 30 | McGill University, Canada 31 | License: GNU GPL (>= 2) 32 | } 33 | -------------------------------------------------------------------------------- /man/PlotSampleTaxaAundanceBar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotSampleTaxaAundanceBar} 4 | \alias{PlotSampleTaxaAundanceBar} 5 | \title{Function to create bar plots of selected taxa level.} 6 | \usage{ 7 | PlotSampleTaxaAundanceBar( 8 | mbSetObj, 9 | barplotName, 10 | taxalvl, 11 | samplnm, 12 | imgOpt, 13 | feat_cnt, 14 | toptaxa, 15 | abunTopTaxaOpt, 16 | appendnm, 17 | format = "png", 18 | dpi = 72 19 | ) 20 | } 21 | \arguments{ 22 | \item{mbSetObj}{Input the name of the mbSetObj.} 23 | 24 | \item{barplotName}{Character, input the name of the bar plot.} 25 | 26 | \item{taxalvl}{Character, input the taxonomic level to perform 27 | classification. For instance, "Genus" to use the Genus level.} 28 | 29 | \item{format}{Character, input the preferred 30 | format of the plot. By default it is set to "png".} 31 | 32 | \item{dpi}{Numeric, input the dots per inch. By default 33 | it is set to 72.} 34 | } 35 | \description{ 36 | This functions creates bar plots of a selected taxa level. 37 | } 38 | \author{ 39 | Jeff Xia \email{jeff.xia@mcgill.ca} 40 | McGill University, Canada 41 | License: GNU GPL (>= 2) 42 | } 43 | -------------------------------------------------------------------------------- /man/PlotSelectedSample.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{PlotSelectedSample} 4 | \alias{PlotSelectedSample} 5 | \title{Function to create a summary of a sample using a piechart at different tax level.} 6 | \usage{ 7 | PlotSelectedSample( 8 | mbSetObj, 9 | imgNm, 10 | smplID, 11 | OtuIdType, 12 | rel_perct, 13 | format = "png", 14 | dpi = 72 15 | ) 16 | } 17 | \arguments{ 18 | \item{mbSetObj}{Input the name of the mbSetObj.} 19 | } 20 | \description{ 21 | This function creates a piechart summary of a sample at a specific 22 | taxonomic level. Used by PPD and MDP modules. 23 | } 24 | \author{ 25 | Jeff Xia \email{jeff.xia@mcgill.ca} 26 | McGill University, Canada 27 | License: GNU GPL (>= 2) 28 | } 29 | -------------------------------------------------------------------------------- /man/PlotTaxaAbundanceArea.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotTaxaAbundanceArea} 4 | \alias{PlotTaxaAbundanceArea} 5 | \title{Plot functional annotation summary} 6 | \usage{ 7 | PlotTaxaAbundanceArea( 8 | mbSetObj, 9 | barplotName, 10 | viewOpt, 11 | taxalvl, 12 | metadata, 13 | feat_cnt, 14 | colpalopt, 15 | calcmeth, 16 | toptaxa, 17 | abunTopTaxaOpt, 18 | appendnm = FALSE, 19 | format = "png", 20 | dpi = 72 21 | ) 22 | } 23 | \arguments{ 24 | \item{mbSetObj}{Input the name of the mbSetObj.} 25 | 26 | \item{barplotName}{Character, input the name of the barplot.} 27 | 28 | \item{viewOpt}{Character.} 29 | 30 | \item{taxalvl}{Character, input the taxonomic level to perform 31 | classification. For instance, "Genus" to use the Genus level.} 32 | 33 | \item{metadata}{If users wish to merge samples to groups in the stacked bar plot, 34 | set this to the preferred grouping.} 35 | 36 | \item{feat_cnt}{Set the minimum feature count that is used to "bin" 37 | together small taxa.} 38 | 39 | \item{colpalopt}{Select the color palette options. "set3", 40 | which is the Set3 from the R Color Brewer, "cont21" which is 41 | a set of 21 colors, "cont28" which is a set of 28 colors, and 42 | "cont42" which is a set of 42 colors. For users who wish to use 43 | a color palette robust to colorblindness 44 | /(https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html/), 45 | use "viridis", "magma", "plasma", or "inferno".} 46 | 47 | \item{calcmeth}{Merge small taxa based on the sum /("sum"/) 48 | or median /("med"/) counts across all samples or groups.} 49 | 50 | \item{format}{Character, input the preferred 51 | format of the plot. By default it is set to "png".} 52 | 53 | \item{dpi}{Numeric, input the dots per inch. By default 54 | it is set to 72.} 55 | } 56 | \description{ 57 | This functions plots the functional annotation summary. 58 | } 59 | \author{ 60 | Jeff Xia \email{jeff.xia@mcgill.ca} 61 | McGill University, Canada 62 | License: GNU GPL (>= 2) 63 | } 64 | -------------------------------------------------------------------------------- /man/PlotTaxaAbundanceBarSamGrp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotTaxaAbundanceBarSamGrp} 4 | \alias{PlotTaxaAbundanceBarSamGrp} 5 | \title{Function to plot group-wise bar charts.} 6 | \usage{ 7 | PlotTaxaAbundanceBarSamGrp( 8 | mbSetObj, 9 | barplotName, 10 | taxalvl, 11 | metadata, 12 | facet2, 13 | imgOpt, 14 | feat_cnt, 15 | colpalopt, 16 | calcmeth, 17 | toptaxa, 18 | abunTopTaxaOpt, 19 | appendnm, 20 | format = "png", 21 | dpi = 72, 22 | interactive = FALSE 23 | ) 24 | } 25 | \arguments{ 26 | \item{mbSetObj}{Input the name of the mbSetObj.} 27 | } 28 | \description{ 29 | This functions plots group-wise bar charts of a specified 30 | taxa for alpha diversity analysis. 31 | } 32 | \author{ 33 | Jeff Xia \email{jeff.xia@mcgill.ca} 34 | McGill University, Canada 35 | License: GNU GPL (>= 2) 36 | } 37 | -------------------------------------------------------------------------------- /man/PlotTaxaAundanceBar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PlotTaxaAundanceBar} 4 | \alias{PlotTaxaAundanceBar} 5 | \title{Function to plot bar charts for alpha diversity} 6 | \usage{ 7 | PlotTaxaAundanceBar( 8 | mbSetObj, 9 | barplotName, 10 | taxalvl, 11 | facet, 12 | facet2, 13 | imgOpt, 14 | feat_cnt, 15 | colpalopt, 16 | calcmeth, 17 | toptaxa, 18 | abunTopTaxaOpt, 19 | appendnm, 20 | format = "png", 21 | dpi = 72, 22 | interactive = FALSE 23 | ) 24 | } 25 | \arguments{ 26 | \item{mbSetObj}{Input the name of the mbSetObj.} 27 | 28 | \item{barplotName}{Character, input the name of the barplot.} 29 | 30 | \item{taxalvl}{Character, input the taxonomic level to perform 31 | classification. For instance, "Genus" to use the Genus level.} 32 | 33 | \item{facet}{Character, set the group to separate the bar plots.} 34 | 35 | \item{imgOpt}{Character, set the graph type. Stacked bar 36 | using the actual abundance, use "barraw". Stacked bar using 37 | the percentage abundance, use "barnorm".} 38 | 39 | \item{feat_cnt}{Set the minimum feature count that is used to "bin" 40 | together small taxa.} 41 | 42 | \item{colpalopt}{Select the color palette options. "set3", 43 | which is the Set3 from the R Color Brewer, "cont21" which is 44 | a set of 21 colors, "cont28" which is a set of 28 colors, and 45 | "cont42" which is a set of 42 colors. For users who wish to use 46 | a color palette robust to colorblindness 47 | /(https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html/), 48 | use "viridis", "magma", "plasma", or "inferno".} 49 | 50 | \item{calcmeth}{Merge small taxa based on the sum /("sum"/) 51 | or median /("med"/) counts across all samples or groups.} 52 | 53 | \item{format}{Character, input the preferred 54 | format of the plot. By default it is set to "png".} 55 | 56 | \item{dpi}{Numeric, input the dots per inch. By default 57 | it is set to 72.} 58 | 59 | \item{interactive}{Boolean, if TRUE, will save an interactive 60 | version of the Stacked Bar plot using plotly.} 61 | 62 | \item{metadata}{If users wish to merge samples to groups in the stacked bar plot, 63 | set this to the preferred grouping.} 64 | } 65 | \description{ 66 | This functions plots bar charts of different taxonomic levels 67 | for alpha diversity. 68 | } 69 | \author{ 70 | Jeff Xia \email{jeff.xia@mcgill.ca} 71 | McGill University, Canada 72 | License: GNU GPL (>= 2) 73 | } 74 | -------------------------------------------------------------------------------- /man/PlotTreeGraph.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_graphics.R 3 | \name{PlotTreeGraph} 4 | \alias{PlotTreeGraph} 5 | \title{Function to plot tree graphics for dendogram.} 6 | \usage{ 7 | PlotTreeGraph( 8 | mbSetObj, 9 | plotNm, 10 | distnm, 11 | clstDist, 12 | metadata, 13 | taxrank, 14 | colorOpts, 15 | format = "png", 16 | dpi = 72, 17 | width = NA, 18 | plotType = "rectangle" 19 | ) 20 | } 21 | \arguments{ 22 | \item{mbSetObj}{Input the name of the mbSetObj.} 23 | 24 | \item{plotNm}{Character, input the name of the plot.} 25 | 26 | \item{distnm}{Character, input the name of the selected 27 | distance measure. "bray" for Bray-Curtis Index, "jsd" for 28 | Jensen-Shannon Divergence, "jaccard" for Jaccard Index, 29 | "unifrac" for Unweighted Unifrac Distance, and "wunifrac" for weighted 30 | unifrac distance.} 31 | 32 | \item{clstDist}{Character, input the name of the 33 | selected clustering algorithm. "ward" for Ward, "average" for Average, 34 | "complete" for Complete, and "single" for Single.} 35 | 36 | \item{metadata}{Character, input the name of the experimental factor.} 37 | 38 | \item{taxrank}{Character, input the taxonomic level to perform 39 | classification. For instance, "OTU-level" to use OTUs.} 40 | 41 | \item{colorOpts}{Character, "default" or "viridis".} 42 | 43 | \item{format}{Character, by default the plot is .png format.} 44 | 45 | \item{dpi}{The dots per inch. Numeric, by default it is set to 72.} 46 | 47 | \item{width}{Width of the plot. Numeric, by default it is set to NA.} 48 | 49 | \item{plotType}{Character, default is set to "rectangle". Alternative is 50 | "triangle".} 51 | 52 | \item{datatype}{Character, "16S" if marker gene data and 53 | "metageno" if shotgun metagenomic data.} 54 | } 55 | \description{ 56 | This functions creates dendogram tree plots. 57 | } 58 | \author{ 59 | Jeff Xia \email{jeff.xia@mcgill.ca} 60 | McGill University, Canada 61 | License: GNU GPL (>= 2) 62 | } 63 | -------------------------------------------------------------------------------- /man/PlotUsrRefPCoA3DScore.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ppd_utils.R 3 | \name{PlotUsrRefPCoA3DScore} 4 | \alias{PlotUsrRefPCoA3DScore} 5 | \title{Function to plot 3D score plot.} 6 | \usage{ 7 | PlotUsrRefPCoA3DScore( 8 | mbSetObj, 9 | imgName, 10 | format = "json", 11 | inx1, 12 | inx2, 13 | inx3, 14 | variable 15 | ) 16 | } 17 | \arguments{ 18 | \item{mbSetObj}{Input the name of the mbSetObj.} 19 | } 20 | \description{ 21 | This function plots a 3D PCoA score plot. 22 | } 23 | \author{ 24 | Jeff Xia \email{jeff.xia@mcgill.ca} 25 | McGill University, Canada 26 | License: GNU GPL (>= 2) 27 | } 28 | -------------------------------------------------------------------------------- /man/PrepareEnrichNet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{PrepareEnrichNet} 4 | \alias{PrepareEnrichNet} 5 | \title{Function to prepare data for enrichment network.} 6 | \usage{ 7 | PrepareEnrichNet(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function prepares data for enrichment network. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PrepareHeatTreePlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PrepareHeatTreePlot} 4 | \alias{PrepareHeatTreePlot} 5 | \title{Function to plot heat tree} 6 | \usage{ 7 | PrepareHeatTreePlot( 8 | mbSetObj, 9 | meta, 10 | taxalvl, 11 | color, 12 | layoutOpt, 13 | comparison, 14 | wilcox.cutoff, 15 | switchCmpDirection, 16 | imgName, 17 | format = "png", 18 | dpi = 72 19 | ) 20 | } 21 | \arguments{ 22 | \item{mbSetObj}{Input the name of the mbSetObj.} 23 | 24 | \item{meta}{Input the name of the group.} 25 | 26 | \item{taxalvl}{Character, input the taxonomic level to perform 27 | classification. For instance, "Genus" to use the Genus level.} 28 | 29 | \item{color}{Character, input the color palette code. "dbgr" 30 | for dark blue, grey and red. "bgy" for greenblue, grey and yellow. 31 | "ggr" for green, grey and red. "pgy" for purple, gray and yellow. 32 | "tgr" for teal, grey and red. "ggg" for green, grey and gold. Additionally, 33 | the viridis R package can be used to generate color schemes. "plasma" for 34 | the plasma color scheme, "viridis" for the default viridis color scheme and 35 | "cividis" for the cividis color scheme.} 36 | 37 | \item{layoutOpt}{Character, input the layout of the heat tree. "dft" 38 | for the default layout and "reda" for reingold-tilford.} 39 | 40 | \item{comparison}{Character, input the group comparisons.} 41 | 42 | \item{wilcox.cutoff}{Numeric, input the Wilcoxan p-value cutoff 43 | for significant node labels.} 44 | 45 | \item{imgName}{Character, input the name of the heat tree plot.} 46 | 47 | \item{format}{Character, input the preferred 48 | format of the plot. By default it is set to "png".} 49 | 50 | \item{dpi}{Numeric, input the dots per inch. By default 51 | it is set to 72.} 52 | } 53 | \description{ 54 | This functions plots the heat tree. 55 | } 56 | \author{ 57 | Jeff Xia \email{jeff.xia@mcgill.ca} 58 | McGill University, Canada 59 | License: GNU GPL (>= 2) 60 | } 61 | -------------------------------------------------------------------------------- /man/PrepareHeatTreePlotDataParse_cmf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PrepareHeatTreePlotDataParse_cmf} 4 | \alias{PrepareHeatTreePlotDataParse_cmf} 5 | \title{Function to prepare heat tree data} 6 | \usage{ 7 | PrepareHeatTreePlotDataParse_cmf(dm_otu_cmf, dm_samples_cmf, meta) 8 | } 9 | \arguments{ 10 | \item{meta}{Input the name of the group.} 11 | } 12 | \description{ 13 | This functions plots the heat tree. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PrepareHeatTreePlotDataParse_cmf_diff_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PrepareHeatTreePlotDataParse_cmf_diff_table} 4 | \alias{PrepareHeatTreePlotDataParse_cmf_diff_table} 5 | \title{Function to prepare heat tree data} 6 | \usage{ 7 | PrepareHeatTreePlotDataParse_cmf_diff_table( 8 | PrepareHeatTreePlotDataParse_cmf_res 9 | ) 10 | } 11 | \description{ 12 | This functions plots the heat tree. 13 | } 14 | \author{ 15 | Jeff Xia \email{jeff.xia@mcgill.ca} 16 | McGill University, Canada 17 | License: GNU GPL (>= 2) 18 | } 19 | -------------------------------------------------------------------------------- /man/PrepareHeatTreePlotDataParse_cmf_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{PrepareHeatTreePlotDataParse_cmf_plot} 4 | \alias{PrepareHeatTreePlotDataParse_cmf_plot} 5 | \title{Function to prepare heat tree data} 6 | \usage{ 7 | PrepareHeatTreePlotDataParse_cmf_plot( 8 | mbSetObj, 9 | color, 10 | layoutOpt, 11 | comparison, 12 | wilcox.cutoff, 13 | imgName, 14 | format, 15 | dpi = 72 16 | ) 17 | } 18 | \arguments{ 19 | \item{mbSetObj}{Input the name of the mbSetObj.} 20 | 21 | \item{color}{Character, input the color palette code. "dbgr" 22 | for dark blue, grey and red. "bgy" for greenblue, grey and yellow. 23 | "ggr" for green, grey and red. "pgy" for purple, gray and yellow. 24 | "tgr" for teal, grey and red. "ggg" for green, grey and gold. Additionally, 25 | the viridis R package can be used to generate color schemes. "plasma" for 26 | the plasma color scheme, "viridis" for the default viridis color scheme and 27 | "cividis" for the cividis color scheme.} 28 | 29 | \item{layoutOpt}{Character, input the layout of the heat tree. "dft" 30 | for the default layout and "reda" for reingold-tilford.} 31 | 32 | \item{comparison}{Character, input the group comparisons.} 33 | 34 | \item{wilcox.cutoff}{Numeric, input the Wilcoxan p-value cutoff 35 | for significant node labels.} 36 | 37 | \item{imgName}{Character, input the name of the heat tree plot.} 38 | 39 | \item{format}{Character, input the preferred 40 | format of the plot. By default it is set to "png".} 41 | 42 | \item{dpi}{Numeric, input the dots per inch. By default 43 | it is set to 72.} 44 | } 45 | \description{ 46 | This functions plots the heat tree. 47 | } 48 | \author{ 49 | Jeff Xia \email{jeff.xia@mcgill.ca} 50 | McGill University, Canada 51 | License: GNU GPL (>= 2) 52 | } 53 | -------------------------------------------------------------------------------- /man/PrepareMergedData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ppd_utils.R 3 | \name{PrepareMergedData} 4 | \alias{PrepareMergedData} 5 | \title{Function to merge user data with public data.} 6 | \usage{ 7 | PrepareMergedData(mbSetObj, metadata, keepfeat) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function is used to merge microbiome data. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/PreparePCA4Shotgun.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{PreparePCA4Shotgun} 4 | \alias{PreparePCA4Shotgun} 5 | \title{Function to prepare shotgun data for PCA.} 6 | \usage{ 7 | PreparePCA4Shotgun( 8 | mbSetObj, 9 | imgName, 10 | imgName2, 11 | format = "json", 12 | inx1, 13 | inx2, 14 | inx3, 15 | variable, 16 | showlabel, 17 | format2d = "png", 18 | dpi = 72 19 | ) 20 | } 21 | \arguments{ 22 | \item{mbSetObj}{Input the name of the mbSetObj.} 23 | } 24 | \description{ 25 | This function formats shotgun data for PCA. 26 | } 27 | \author{ 28 | Jeff Xia \email{jeff.xia@mcgill.ca} 29 | McGill University, Canada 30 | License: GNU GPL (>= 2) 31 | } 32 | -------------------------------------------------------------------------------- /man/PreparePDFReport.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_reporter.R 3 | \name{PreparePDFReport} 4 | \alias{PreparePDFReport} 5 | \title{Function to create PDF report} 6 | \usage{ 7 | PreparePDFReport(mbSetObj, usrName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{usrName}{Input the preferred user name for the Analysis Report.} 13 | } 14 | \description{ 15 | This function creates a PDF report. 16 | } 17 | \author{ 18 | Jeff Xia \email{jeff.xia@mcgill.ca} 19 | McGill University, Canada 20 | License: GNU GPL (>= 2) 21 | } 22 | -------------------------------------------------------------------------------- /man/PrepareQueryJson.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{PrepareQueryJson} 4 | \alias{PrepareQueryJson} 5 | \title{Function to prepare query for JSON.} 6 | \usage{ 7 | PrepareQueryJson(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function prepares the data for JSON. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/RF.Anal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{RF.Anal} 4 | \alias{RF.Anal} 5 | \title{Performs Random Forest Analysis} 6 | \usage{ 7 | RF.Anal(mbSetObj, treeNum, tryNum, randomOn, variable, taxrank) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj. By default, 11 | the name should be mbSet.} 12 | 13 | \item{treeNum}{Numeric, input the number of trees to grow.} 14 | 15 | \item{tryNum}{Numeric, input the number of predictors to try.} 16 | 17 | \item{randomOn}{Randomness setting. 1 is on, 0 is off.} 18 | 19 | \item{variable}{Character, input the experimental factor for classification.} 20 | 21 | \item{taxrank}{Character, input the taxonomic level to perform 22 | classification. For instance, "OTU-level" to use OTUs.} 23 | 24 | \item{datatype}{Character, "16S" if performing RF on 16S rRNA 25 | marker gene data and "metageno" if performing RF on shotgun metagenomic data.} 26 | } 27 | \description{ 28 | This functions performs the Random Forest (RF) analysis. 29 | } 30 | \author{ 31 | Jeff Xia \email{jeff.xia@mcgill.ca} 32 | McGill University, Canada 33 | License: GNU GPL (>= 2) 34 | } 35 | -------------------------------------------------------------------------------- /man/Read16SAbundData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{Read16SAbundData} 4 | \alias{Read16SAbundData} 5 | \title{Main function to read 16S data} 6 | \usage{ 7 | Read16SAbundData( 8 | mbSetObj, 9 | dataName, 10 | format, 11 | taxa_type, 12 | ismetafile, 13 | is.normalized 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | } 19 | \description{ 20 | This is the main function read in the 16S data 21 | into the mbSetObj. 22 | } 23 | \author{ 24 | Jeff Xia \email{jeff.xia@mcgill.ca} 25 | McGill University, Canada 26 | License: GNU GPL (>= 2) 27 | } 28 | -------------------------------------------------------------------------------- /man/Read16SAbundDataMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{Read16SAbundDataMeta} 4 | \alias{Read16SAbundDataMeta} 5 | \title{Function to read 16S Abundance data in meta-analysis module} 6 | \usage{ 7 | Read16SAbundDataMeta( 8 | mbSetObj, 9 | dataName, 10 | format, 11 | taxa_type, 12 | ismetafile, 13 | is.normalized = F 14 | ) 15 | } 16 | \arguments{ 17 | \item{mbSetObj}{Input the name of the mbSetObj.} 18 | 19 | \item{dataName}{File name of selected dataset} 20 | 21 | \item{format}{File type, only supports ".txt"} 22 | 23 | \item{taxa_type}{Taxonomy type (i.e.} 24 | 25 | \item{ismetafile}{Whether meta-data is given (for BIOM format only)} 26 | 27 | \item{is.normalized}{Specify whether uploaded data is normalized or raw counts} 28 | } 29 | \description{ 30 | This is the main function read in the 16S data 31 | into the mbSetObj. 32 | } 33 | \author{ 34 | Jeff Xia \email{jeff.xia@mcgill.ca} 35 | McGill University, Canada 36 | License: GNU GPL (>= 2) 37 | } 38 | -------------------------------------------------------------------------------- /man/Read16SBiomData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{Read16SBiomData} 4 | \alias{Read16SBiomData} 5 | \title{Function to read 16S data in biom format} 6 | \usage{ 7 | Read16SBiomData(mbSetObj, dataName, taxa_type, ismetadata) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function reads in the 16S data from biom format 14 | into the mbSetObj. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/Read16STabData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{Read16STabData} 4 | \alias{Read16STabData} 5 | \title{Function to read 16S data} 6 | \usage{ 7 | Read16STabData(mbSetObj, dataName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This is the main function read in the 16S data in txt format 14 | into the mbSetObj. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/Read16STaxaTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{Read16STaxaTable} 4 | \alias{Read16STaxaTable} 5 | \title{Function to read 16S taxonomy table from txt format} 6 | \usage{ 7 | Read16STaxaTable(mbSetObj, dataName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function reads in the 16S taxonomy table from txt format 14 | into the mbSetObj. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/Read16STaxaTableMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{Read16STaxaTableMeta} 4 | \alias{Read16STaxaTableMeta} 5 | \title{Function to read 16S taxonomy table from txt format in meta-analysis module} 6 | \usage{ 7 | Read16STaxaTableMeta(mbSetObj, fileName, dataName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of selected dataset's taxa file} 11 | 12 | \item{dataName}{Input the name of selected dataset data file} 13 | } 14 | \description{ 15 | This function reads in the 16S taxonomy table from txt format 16 | into the mbSetObj. 17 | } 18 | \author{ 19 | Jeff Xia \email{jeff.xia@mcgill.ca} 20 | McGill University, Canada 21 | License: GNU GPL (>= 2) 22 | } 23 | -------------------------------------------------------------------------------- /man/ReadMetabolicTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{ReadMetabolicTable} 4 | \alias{ReadMetabolicTable} 5 | \title{Main function to read metabolomics table} 6 | \usage{ 7 | ReadMetabolicTable(mbSetObj, dataName, metType, idType) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{metType}{whether a peak or metabolite intensity table} 13 | 14 | \item{idType}{One of compound name,KEGG or HMDB ID. Only applicable when the metType is metabolite. 15 | McGill University, Canada 16 | License: GNU GPL (>= 2)} 17 | } 18 | \description{ 19 | This is the main function read in the metabolomics data 20 | into the mbSetObj. 21 | } 22 | \author{ 23 | Jeff Xia \email{jeff.xia@mcgill.ca} 24 | } 25 | -------------------------------------------------------------------------------- /man/ReadMothurData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_io.R 3 | \name{ReadMothurData} 4 | \alias{ReadMothurData} 5 | \title{Function to read 16S data in mothur format} 6 | \usage{ 7 | ReadMothurData(mbSetObj, dataName, taxdataNm, taxa_type) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function reads in the 16S data from mothur format 14 | into the mbSetObj. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/ReadSampleTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_io.R 3 | \name{ReadSampleTable} 4 | \alias{ReadSampleTable} 5 | \title{Function to read in sample data} 6 | \usage{ 7 | ReadSampleTable(mbSetObj, fileName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dataName}{Input the sample data file name.} 13 | } 14 | \description{ 15 | This functions reads in sample data. 16 | } 17 | \author{ 18 | Jeff Xia \email{jeff.xia@mcgill.ca} 19 | McGill University, Canada 20 | License: GNU GPL (>= 2) 21 | } 22 | -------------------------------------------------------------------------------- /man/ReadSampleTableMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{ReadSampleTableMeta} 4 | \alias{ReadSampleTableMeta} 5 | \title{Function to read in sample data in meta-analysis module (merged metadata file)} 6 | \usage{ 7 | ReadSampleTableMeta(mbSetObj, fileName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{fileName}{Input the name of merged metadata file} 13 | } 14 | \description{ 15 | This functions reads in sample data. 16 | } 17 | \author{ 18 | Jeff Xia \email{jeff.xia@mcgill.ca} 19 | McGill University, Canada 20 | License: GNU GPL (>= 2) 21 | } 22 | -------------------------------------------------------------------------------- /man/ReadSampleTableMetaInd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{ReadSampleTableMetaInd} 4 | \alias{ReadSampleTableMetaInd} 5 | \title{Function to read in sample data in meta-analysis module} 6 | \usage{ 7 | ReadSampleTableMetaInd(mbSetObj, dataName, metaName) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dataName}{Input the file name of selected dataset} 13 | 14 | \item{metaName}{Input the file name of meta-data file name.} 15 | } 16 | \description{ 17 | This functions reads in sample data. 18 | } 19 | \author{ 20 | Jeff Xia \email{jeff.xia@mcgill.ca} 21 | McGill University, Canada 22 | License: GNU GPL (>= 2) 23 | } 24 | -------------------------------------------------------------------------------- /man/ReadShotgunBiomData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{ReadShotgunBiomData} 4 | \alias{ReadShotgunBiomData} 5 | \title{Main function to read in shotgun data} 6 | \usage{ 7 | ReadShotgunBiomData(mbSetObj, dataName, geneidtype, module.type, ismetadata) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function reads in shotgun data 14 | in biom format. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/ReadShotgunTabData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{ReadShotgunTabData} 4 | \alias{ReadShotgunTabData} 5 | \title{Main function to read in shotgun data} 6 | \usage{ 7 | ReadShotgunTabData(mbSetObj, dataName, geneidtype, datatype) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function reads in shotgun data 14 | in a tabular format. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/ReadTreeFile.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_io.R 3 | \name{ReadTreeFile} 4 | \alias{ReadTreeFile} 5 | \title{Function to read in tree files.} 6 | \usage{ 7 | ReadTreeFile(mbSetObj, fileName, dataName = "", module.type) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dataName}{Input the tree file name.} 13 | } 14 | \description{ 15 | This functions reads in tree files. 16 | } 17 | \author{ 18 | Jeff Xia \email{jeff.xia@mcgill.ca} 19 | McGill University, Canada 20 | License: GNU GPL (>= 2) 21 | } 22 | -------------------------------------------------------------------------------- /man/RunFastSpar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_anal.R 3 | \name{RunFastSpar} 4 | \alias{RunFastSpar} 5 | \title{Function to call FastSpar} 6 | \usage{ 7 | RunFastSpar( 8 | mbSetObj, 9 | taxrank, 10 | permNum, 11 | pvalCutoff, 12 | corrCutoff, 13 | output = "network", 14 | opt = "corr" 15 | ) 16 | } 17 | \arguments{ 18 | \item{mbSetObj}{Input the name of the mbSetObj.} 19 | } 20 | \description{ 21 | This function runs the fastspar 22 | } 23 | -------------------------------------------------------------------------------- /man/SanityCheckData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{SanityCheckData} 4 | \alias{SanityCheckData} 5 | \title{Main function to sanity check on uploaded microbiome data} 6 | \usage{ 7 | SanityCheckData(mbSetObj, filetype, disableFilter = FALSE) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{filetype}{Character, "biom" if the uploaded data 13 | was .biom format, "mothur" if mothur format, or "txt" if 14 | as .txt or .csv format.} 15 | 16 | \item{disableFilter}{Boolean. Set to TRUE to bypass the hard-coded filter 17 | to remove features occuring in <2 samples.} 18 | } 19 | \description{ 20 | This function performs a sanity check on the uploaded 21 | user data. It checks the grouping of samples, if a phylogenetic tree 22 | was uploaded. 23 | } 24 | \author{ 25 | Jeff Xia \email{jeff.xia@mcgill.ca} 26 | McGill University, Canada 27 | License: GNU GPL (>= 2) 28 | } 29 | -------------------------------------------------------------------------------- /man/SanityCheckDataMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{SanityCheckDataMeta} 4 | \alias{SanityCheckDataMeta} 5 | \title{Individual sanity check on selected datase in meta-analysis module} 6 | \usage{ 7 | SanityCheckDataMeta(mbSetObj, dataName, filetype, disableFilter = FALSE) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{dataName}{Input the name of selected dataset data file} 13 | 14 | \item{filetype}{Character, "biom" if the uploaded data 15 | was .biom format, "mothur" if mothur format, or "txt" if 16 | as .txt or .csv format.} 17 | 18 | \item{disableFilter}{Boolean. Set to TRUE to bypass the hard-coded filter 19 | to remove features occuring in <2 samples.} 20 | } 21 | \description{ 22 | This function performs a sanity check on the uploaded 23 | user data. 24 | } 25 | \author{ 26 | Jeff Xia \email{jeff.xia@mcgill.ca} 27 | McGill University, Canada 28 | License: GNU GPL (>= 2) 29 | } 30 | -------------------------------------------------------------------------------- /man/SanityCheckMetData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{SanityCheckMetData} 4 | \alias{SanityCheckMetData} 5 | \title{Function to sanity check on uploaded metabolomics data} 6 | \usage{ 7 | SanityCheckMetData(mbSetObj, isNormMetInput, disableFilter = FALSE) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{disableFilter}{Booleanmetabo. Set to TRUE to bypass the hard-coded filter 13 | to remove features occuring in <2 samples.} 14 | } 15 | \description{ 16 | This function performs a sanity check on the uploaded 17 | user data. It checks the grouping of samples, if a phylogenetic tree 18 | was uploaded. 19 | } 20 | \author{ 21 | Jeff Xia \email{jeff.xia@mcgill.ca} 22 | McGill University, Canada 23 | License: GNU GPL (>= 2) 24 | } 25 | -------------------------------------------------------------------------------- /man/SanityCheckSampleData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multifac_metadata.R 3 | \name{SanityCheckSampleData} 4 | \alias{SanityCheckSampleData} 5 | \title{SanityCheckSampleData} 6 | \usage{ 7 | SanityCheckSampleData(mbSetObj = NA) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{microbiomeanalyst object, initialized by InitDataObjects("pktable", "mf", FALSE)} 11 | } 12 | \description{ 13 | SanityCheckSampleData 14 | } 15 | -------------------------------------------------------------------------------- /man/SanityCheckSampleDataMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meta_proc.R 3 | \name{SanityCheckSampleDataMeta} 4 | \alias{SanityCheckSampleDataMeta} 5 | \title{SanityCheckSampleData} 6 | \usage{ 7 | SanityCheckSampleDataMeta(mbSetObj = NA, dataName = "") 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{microbiomeanalyst object, initialized by InitDataObjects("pktable", "mf", FALSE)} 11 | 12 | \item{dataName}{File name of selected dataset} 13 | } 14 | \description{ 15 | SanityCheckSampleData 16 | } 17 | -------------------------------------------------------------------------------- /man/SavePiechartImg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{SavePiechartImg} 4 | \alias{SavePiechartImg} 5 | \title{Function to save pie-chart} 6 | \usage{ 7 | SavePiechartImg(mbSetObj, taxalvl, pieName, format = "png", dpi = 72) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | 12 | \item{taxalvl}{Character, input the taxonomic level to perform 13 | classification. For instance, "Genus" to use the Genus level.} 14 | 15 | \item{pieName}{Character, input the name of the pie chart plot.} 16 | 17 | \item{format}{Character, input the preferred 18 | format of the plot. By default it is set to "png".} 19 | 20 | \item{dpi}{Numeric, input the dots per inch. By default 21 | it is set to 72.} 22 | } 23 | \description{ 24 | This functions saves created pie chart plot. 25 | } 26 | \author{ 27 | Jeff Xia \email{jeff.xia@mcgill.ca} 28 | McGill University, Canada 29 | License: GNU GPL (>= 2) 30 | } 31 | -------------------------------------------------------------------------------- /man/SetDataTypeOfMeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multifac_metadata.R 3 | \name{SetDataTypeOfMeta} 4 | \alias{SetDataTypeOfMeta} 5 | \title{SetDataTypeOfMeta} 6 | \usage{ 7 | SetDataTypeOfMeta(mbSetObj = NA) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{microbiomeanalyst object} 11 | } 12 | \description{ 13 | SetDataTypeOfMeta 14 | } 15 | -------------------------------------------------------------------------------- /man/SetMetaAttributes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multifac_metadata.R 3 | \name{SetMetaAttributes} 4 | \alias{SetMetaAttributes} 5 | \title{SetMetaAttributes'} 6 | \usage{ 7 | SetMetaAttributes(mbSetObj = NA, init = 1) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{microbiomeanalyst object} 11 | 12 | \item{init}{can be 0 or 1} 13 | } 14 | \description{ 15 | SetMetaAttributes' 16 | } 17 | -------------------------------------------------------------------------------- /man/SetModuleType.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_io.R 3 | \name{SetModuleType} 4 | \alias{SetModuleType} 5 | \title{Function to set analysis type} 6 | \usage{ 7 | SetModuleType(mbSetObj, nm) 8 | } 9 | \arguments{ 10 | \item{analType}{Input the analysis type. If the data is marker gene data, 11 | use "mdp", if the data is shotgun metagenomics or transcriptomics data, 12 | use ""sdp". If performing the Projection with Public Data module, use "ppd". 13 | If performing Taxon Set Enrichment Analysis, use "tsea".} 14 | } 15 | \description{ 16 | This functions sets the module name. 17 | } 18 | \author{ 19 | Jeff Xia \email{jeff.xia@mcgill.ca} 20 | McGill University, Canada 21 | License: GNU GPL (>= 2) 22 | } 23 | -------------------------------------------------------------------------------- /man/SetTaxonSetLib.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{SetTaxonSetLib} 4 | \alias{SetTaxonSetLib} 5 | \title{Set the microbe set library} 6 | \usage{ 7 | SetTaxonSetLib(mbSetObj, tset.type) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function sets the microbe 14 | set library for TSEA. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/Setup.MapData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tsea_utils.R 3 | \name{Setup.MapData} 4 | \alias{Setup.MapData} 5 | \title{Function to set up data for TSEA} 6 | \usage{ 7 | Setup.MapData(mbSetObj, qvec) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function sets up data for TSEA. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/UpdateConfItems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_multivar.R 3 | \name{UpdateConfItems} 4 | \alias{UpdateConfItems} 5 | \title{Function to update confounders used for partial correlation} 6 | \usage{ 7 | UpdateConfItems(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function updates which confounders will be 14 | used to calculate partial correlation. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/UpdateListInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sdp_utils.R 3 | \name{UpdateListInput} 4 | \alias{UpdateListInput} 5 | \title{Function to filter list data based on a minimum count} 6 | \usage{ 7 | UpdateListInput(mbSetObj, minL, maxL = Inf) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function filters the inputted list data 14 | based on a minimum count. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/UpdatePieData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mdp_utils.R 3 | \name{UpdatePieData} 4 | \alias{UpdatePieData} 5 | \title{Function to update pie-chart data.} 6 | \usage{ 7 | UpdatePieData(mbSetObj, lowtaxa) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This functions updates pie chart data. 14 | } 15 | \author{ 16 | Jeff Xia \email{jeff.xia@mcgill.ca} 17 | McGill University, Canada 18 | License: GNU GPL (>= 2) 19 | } 20 | -------------------------------------------------------------------------------- /man/UpdateSampleItems.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_proc.R 3 | \name{UpdateSampleItems} 4 | \alias{UpdateSampleItems} 5 | \title{Function to update samples} 6 | \usage{ 7 | UpdateSampleItems(mbSetObj) 8 | } 9 | \arguments{ 10 | \item{mbSetObj}{Input the name of the mbSetObj.} 11 | } 12 | \description{ 13 | This function prunes samples to be included 14 | for downstream analysis. 15 | } 16 | \author{ 17 | Jeff Xia \email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /man/case_when.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_misc.R 3 | \name{case_when} 4 | \alias{case_when} 5 | \title{https://github.com/s-fleck/lest/tree/master/R} 6 | \usage{ 7 | case_when(...) 8 | } 9 | \description{ 10 | https://github.com/s-fleck/lest/tree/master/R 11 | } 12 | -------------------------------------------------------------------------------- /man/condenseOTUs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_misc.R 3 | \name{condenseOTUs} 4 | \alias{condenseOTUs} 5 | \title{Helper Function that will take the OTU Table (as a data.frame()) 6 | to which column representing taxa has been added. 7 | There is some munging to handle rownames and 8 | the tax column but the basic idea is there.} 9 | \usage{ 10 | condenseOTUs(otutable, splitcol) 11 | } 12 | \description{ 13 | Helper Function that will take the OTU Table (as a data.frame()) 14 | to which column representing taxa has been added. 15 | There is some munging to handle rownames and 16 | the tax column but the basic idea is there. 17 | } 18 | -------------------------------------------------------------------------------- /man/dot-read.microbiomeanalyst.lib.rds.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_io.R 3 | \name{.read.microbiomeanalyst.lib.rds} 4 | \alias{.read.microbiomeanalyst.lib.rds} 5 | \title{Read RDS files from the internet} 6 | \usage{ 7 | .read.microbiomeanalyst.lib.rds(filenm, sub.dir = NULL, ref = NA) 8 | } 9 | \arguments{ 10 | \item{filenm}{Input the name of the file to download.} 11 | 12 | \item{ref}{Default set to "NA".} 13 | 14 | \item{opt}{Default set to "none".} 15 | } 16 | \description{ 17 | Function downloads the required file and reads it only if not already in working directory. 18 | Need to specify the file URL and the destfile. 19 | } 20 | -------------------------------------------------------------------------------- /man/dot-readDataTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/general_misc.R 3 | \name{.readDataTable} 4 | \alias{.readDataTable} 5 | \title{Read data table} 6 | \usage{ 7 | .readDataTable(fileName) 8 | } 9 | \arguments{ 10 | \item{fileName}{Input filename} 11 | } 12 | \description{ 13 | Function to read in a data table. First, it will try to use fread, however, it has issues with 14 | some windows 10 files. In such case, use the slower read.table method. 15 | } 16 | \author{ 17 | Jeff Xia\email{jeff.xia@mcgill.ca} 18 | McGill University, Canada 19 | License: GNU GPL (>= 2) 20 | } 21 | -------------------------------------------------------------------------------- /src/Makevars: -------------------------------------------------------------------------------- 1 | INITOBJECT=init.o 2 | 3 | STATISOBJECT=rowttests.o util.o 4 | 5 | OBJECTS= $(INITOBJECT) $(STATISOBJECT) 6 | 7 | all: clean $(SHLIB) 8 | 9 | clean: 10 | rm -f $(OBJECTS) 11 | -------------------------------------------------------------------------------- /src/Makevars.win: -------------------------------------------------------------------------------- 1 | INITOBJECT=init.o 2 | 3 | STATISOBJECT=rowttests.o util.o 4 | 5 | OBJECTS= $(INITOBJECT) $(STATISOBJECT) 6 | 7 | 8 | all: $(SHLIB) 9 | 10 | # Hack found at 11 | # http://r.789695.n4.nabble.com/suppressing-quot-global-quot-cppflags-in-an-individual-package-td910894.html 12 | MINGWBUILDBROKENWITHOPTIMIZATION2FLAGS=-fno-inline 13 | 14 | %.o: %.c 15 | $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(MINGWBUILDBROKENWITHOPTIMIZATION2FLAGS) -c $< -o $@ 16 | 17 | clean: 18 | rm -f $(OBJECTS) 19 | -------------------------------------------------------------------------------- /src/init.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include // for NULL 4 | #include 5 | 6 | /* .C calls */ 7 | extern void DescendMin(void *, void *, void *, void *, void *); 8 | extern void FindEqualGreaterM(void *, void *, void *, void *, void *); 9 | extern void RectUnique(void *, void *, void *, void *, void *, void *, void *); 10 | 11 | 12 | 13 | /* .Call calls */ 14 | extern SEXP rowcolttests(SEXP, SEXP, SEXP, SEXP, SEXP); 15 | 16 | static const R_CMethodDef CEntries[] = { 17 | {"DescendMin", (DL_FUNC) &DescendMin, 5}, 18 | {"FindEqualGreaterM", (DL_FUNC) &FindEqualGreaterM, 5}, 19 | {"RectUnique", (DL_FUNC) &RectUnique, 7}, 20 | {NULL, NULL, 0} 21 | }; 22 | 23 | static const R_CallMethodDef CallEntries[] = { 24 | {"rowcolttests", (DL_FUNC) &rowcolttests, 5}, 25 | {NULL, NULL, 0} 26 | }; 27 | 28 | void R_init_MicrobiomeAnalystR(DllInfo *dll) 29 | { 30 | R_registerRoutines(dll, CEntries, CallEntries,NULL,NULL); 31 | R_useDynamicSymbols(dll, FALSE); 32 | } 33 | 34 | //void R_init_MetaboAnalystR(DllInfo *info) { 35 | // R_RegisterCCallable("MetaboAnalystR", "add", (DL_FUNC) &CEntries); 36 | //} -------------------------------------------------------------------------------- /src/rowttests.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright W. Huber 2005 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | /* #define DEBUG */ 13 | 14 | char errmsg[256]; 15 | 16 | /*----------------------------------------------------------------- 17 | which=0: t-test by row 18 | which=1: t-test by column 19 | -----------------------------------------------------------------*/ 20 | void rowcolttests_c(double *x, int *fac, int nr, int nc, int no, int nt, 21 | int which, int nrgrp, int na_rm, 22 | double *statistic, double *dm, double *df) { 23 | 24 | int i, j, grp; 25 | double z, delta, newmean, factor; 26 | 27 | /* Currently the following provides for one- and two-sample t-tests (nrgrp=1 or 2), 28 | but it should be possible to generalize this code to more samples 29 | (F-test) without too many changes */ 30 | 31 | int *n[2]; 32 | double* s[2]; 33 | double* ss[2]; 34 | 35 | if(nrgrp>2) 36 | error("Please do not use 'nrgrp' >2 with 'rowcolttests'"); 37 | 38 | /* allocate and initialize storage for intermediate quantities 39 | (namely first and second moments for each group) */ 40 | for(grp=0; grp=0)&&(fac[i]=0 and < 'nrgrp'."); 202 | 203 | 204 | /* check input argument na_rm */ 205 | if (!isLogical(_na_rm) || length(_na_rm) != 1 || LOGICAL(_na_rm)[0] == R_NaInt) 206 | error("'na.rm' must be TRUE or FALSE"); 207 | na_rm = LOGICAL(_na_rm)[0]; 208 | 209 | PROTECT(statistic = allocVector(REALSXP, nt)); 210 | PROTECT(dm = allocVector(REALSXP, nt)); 211 | PROTECT(df = allocVector(REALSXP, nt)); 212 | 213 | /* Do it */ 214 | rowcolttests_c( 215 | x, fac, nr, nc, no, nt, which, nrgrp, na_rm, 216 | REAL(statistic), REAL(dm), REAL(df)); 217 | 218 | /* return value: a list with two elements, statistic and df */ 219 | PROTECT(res = allocVector(VECSXP, 3)); 220 | SET_VECTOR_ELT(res, 0, statistic); 221 | SET_VECTOR_ELT(res, 1, dm); 222 | SET_VECTOR_ELT(res, 2, df); 223 | 224 | PROTECT(namesres = allocVector(STRSXP, 3)); 225 | SET_STRING_ELT(namesres, 0, mkChar("statistic")); 226 | SET_STRING_ELT(namesres, 1, mkChar("dm")); 227 | SET_STRING_ELT(namesres, 2, mkChar("df")); 228 | setAttrib(res, R_NamesSymbol, namesres); 229 | 230 | UNPROTECT(5); /* done with res, namesres, statistic, dm, df */ 231 | return(res); 232 | } 233 | 234 | -------------------------------------------------------------------------------- /src/util.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "util.h" 4 | 5 | 6 | void DescendMin(double *yvals, int *numin, int *istart, 7 | int *ilower, int *iupper) { 8 | 9 | int i; 10 | 11 | for (i = *istart; i > 0; i--) 12 | if (yvals[i-1] >= yvals[i]) 13 | break; 14 | *ilower = i; 15 | 16 | for (i = *istart; i < *numin-1; i++) 17 | if (yvals[i+1] >= yvals[i]) 18 | break; 19 | *iupper = i; 20 | } 21 | 22 | void FindEqualGreaterM(const double *in, const int *size, const double *values, 23 | const int *valsize, int *index) { 24 | 25 | int i, idx = 0; 26 | 27 | for (i = 0; i < *valsize; i++) { 28 | while (idx < *size && in[idx] < values[i]) 29 | idx++; 30 | index[i] = idx; 31 | } 32 | } 33 | 34 | void RectUnique(const double *m, const int *order, const int *nrow, 35 | const int *ncol, const double *xdiff, const double *ydiff, 36 | int *keep) { 37 | 38 | int i, j, io, jo; 39 | int x1 = 0, x2 = *nrow, y1 = *nrow*2, y2 = *nrow*3; 40 | 41 | for (i = 0; i < *nrow; i++) { 42 | io = order[i]; 43 | keep[io] = 1; 44 | for (j = 0; j < i; j++) { 45 | jo = order[j]; 46 | if (keep[jo] && 47 | !(m[x1+io] - m[x2+jo] > *xdiff || m[x1+jo] - m[x2+io] > *xdiff || 48 | m[y1+io] - m[y2+jo] > *ydiff || m[y1+jo] - m[y2+io] > *ydiff)) { 49 | keep[io] = 0; 50 | /* Debuging Code 51 | printf("%i\t%3.1f\t%3.1f\t%4.0f\t%4.0f\t%i\t%3.1f\t%3.1f\t%4.0f\t%4.0f\n", 52 | i, m[x1+io], m[x2+io], m[y1+io], m[y2+io], 53 | j, m[x1+jo], m[x2+jo], m[y1+jo], m[y2+jo]); 54 | */ 55 | break; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/util.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void DescendMin(double *yvals, int *numin, int *istart, 4 | int *ilower, int *iupper); 5 | 6 | void FindEqualGreaterM(const double *in, const int *size, const double *values, 7 | const int *valsize, int *index); 8 | 9 | 10 | void RectUnique(const double *m, const int *order, const int *nrow, 11 | const int *ncol, const double *xdiff, const double *ydiff, 12 | int *keep); 13 | -------------------------------------------------------------------------------- /vignettes/MicrobiomeAnalystR_dada2_processing_raw_data.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "MicrobiomeAnalystR_dada2_processing_raw_data" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{MicrobiomeAnalystR_dada2_processing_raw_data} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | Hello this is where you type. 11 | 12 | ```{r} 13 | knitr::opts_chunk$set( 14 | collapse = TRUE, 15 | comment = "#>" 16 | ) 17 | ``` 18 | 19 | ```{r setup} 20 | ``` 21 | -------------------------------------------------------------------------------- /vignettes/Projection_with_Public_Data.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Projection_with_Public_Data" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{Projection_with_Public_Data} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | With the increasing number of public data sets, meta-analysis has become a powerful approach for hypothesis generation and validation (27-30). The PPD module is therefore intended for users to visually explore their own 16S rRNA dataset within the context of public datasets. These public datasets are mainly obtained from Qiita (31). Datasets selected by users for meta-analysis must share at least 20% taxonomic similarity for meaningful comparisons. In this module, user’s and public data are co-projected into an interactive 3D PCoA plot. Several distance measures are available to calculate dissimilarity between samples. With this visualization, users can contextualize their own dataset and compare the taxonomic compositions of samples with pie-charts to explore which taxa are driving group separations. This enables users to gain a global perspective of their data, such as identifying compositional differences across different countries (32) and environments (33). -------------------------------------------------------------------------------- /vignettes/Shotgun_Data_Profiling.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Shotgun_Data_Profiling" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{Shotgun_Data_Profiling} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | MicrobiomeAnalyst offers a similar set of methods for comparative analysis and visualization for gene-level data (gene list or gene abundance table) produced from either predictive functional profiling or outputs from shotgun metagenomics or meta-transcriptomics. It also implements methods to obtain a functional overview based on different functional annotations based on KEGG pathways or modules (25), functional enrichment analysis (26), and interactive network-based visual exploration of the result. 11 | 12 | Of the available methods for profiling the microbiome, marker-gene surveys are the most common for its low cost and ability to taxonomically sample an entire microbial community. Despite these advantages, marker-gene data does not provide any functional information. Meanwhile, shotgun metagenomics does quantify all functional genes from samples, but its high cost, obscenely high requisite read-coverage, and lack of complete genomes is a deterrent (78, 79). Inferring potential function directly from 16S rRNA sequencing data is thus greatly appealing. Two commonly used methods for predictive functional profiling are available in MicrobiomeAnalyst, PICRUSt (23) and Tax4Fun (24). PICRUSt was the first tool that popularized the method of inferring microbiome function from 16S rRNA data. It leverages the idea that phylogenetically related organisms likely share a similar set of functional genes (23, 80). From 16S rRNA data, the PICRUSt algorithm searches for the most closely related organisms with sequenced genomes and assumes that their functional information is also present in the data. Apart from within MicrobiomeAnalyst, PICRUSt is available from the command line as a python package or online as a Galaxy implementation. On the other hand, Tax4Fun is an R package that combines precomputed functional profiles from KEGG prokaryotic organisms and normalized taxonomic abundances. To use Tax4Fun, the input 16S rRNA sequencing data must be annotated using the SILVA (81) reference database while for PICRUSt the Greengenes database must be used (82). The limitations to these methods are that only organisms that are related to reference organisms will be included in the functional prediction. Despite this, predictive functional profiling is an important strategy to gain further mechanistic insights from amplicon sequencing data. 13 | 14 | ```{r, eval=FALSE} 15 | # Create a dendogram of the microbiome data at the OTU level. 16 | 17 | ``` 18 | 19 | ```{r, eval=FALSE} 20 | # Create a dendogram of the microbiome data at the OTU level. 21 | 22 | ``` 23 | 24 | ```{r, eval=FALSE} 25 | # Create a dendogram of the microbiome data at the OTU level. 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /vignettes/Taxon_Set_Enrichment_Analysis.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Taxon_Set_Enrichment_ANalysis" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{Taxon_Set_Enrichment_ANalysis} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | Following comparative analysis, users will produce a list of differentially abundant microbes associated with their phenotype of interest. However, such a list lacks context and structure. Enrichment analysis, a popular method already used for the interpretation of lists of genes (34) and metabolites (35), can be applied to provide valuable insight into a list of taxa. Here, the list of taxa is evaluated for the enrichment of taxon sets, which are groups of microbes/taxa that share certain characteristics such as phenotypic traits (e.g. shape, motility), or are associated with same factors (diets, diseases, genetic variations, etc.). MicrobiomeAnalyst currently contains 2393 manually curated taxon sets categorized into the following categories: (i) Host genetics which contains taxon sets associated with host SNP variations, (ii) Host-intrinsic which consists of taxon sets associated with host-intrinsic factors (e.g. diseases), (iii) Host-extrinsic which contains taxon sets associated with host-extrinsic factors (e.g. diet and lifestyle), (iv) Environmental taxon sets which is comprised of taxon sets associated with environmental factors (e.g. chemical exposures), and (v) Microbiome-intrinsic which is made of taxon sets associated with microbiome-intrinsic factors (e.g. mobility and shape). --------------------------------------------------------------------------------