Featured image of post R微生物组分析流程(pctax包)

R微生物组分析流程(pctax包)

pctax

pctax provides a comprehensive suite of tools for analyzing microbiome data.

Install

1
2
3
4
install.packages("devtools")
devtools::install_github('Asa12138/pcutils',dependencies=T)

devtools::install_github('Asa12138/pctax',dependencies=T)

Usage

It includes functionalities for α-diversity analysis, β-diversity analysis, differential analysis, community assembly, visualization of phylogenetic tree and functional enrichment analysis…

Look at the test data:

1
2
3
4
5
6
7
8
library(pctax)
library(pcutils)
data(otutab,package = "pcutils")
#help(otutab)

head(otutab)
head(metadata)
head(taxonomy)

α-diversity analysis

Calculate a_diversity of otutab then link to experiment group or environment variable.

1
2
3
a_diversity(otutab)->a_res
plot(a_res,metadata,"Group")
plot(a_res,metadata,"env1")

β-diversity analysis

There are a range of dimensionality reduction methods available for analysis, including Constrained and non-Constrained.

Like PCA, PCoA, NMDS, RDA, CCA… For example:

PCA:

1
2
3
b_analyse(otutab,method = "pca")->b_res
plot(b_res,"Group",metadata,bi = T,rate=0.5)
plot(b_res,"Group",metadata,mode = 3)

RDA:

1
2
3
4
env=metadata[,6:10]
#RDA
myRDA(otutab,env)->phy.rda
RDA_plot(phy.rda,"Group",metadata)

Differential analysis

There are also lots of statistic methods for differential analysis: ALDEX, ANCOM2, randomForest, t.test, wilcox.test… or deseq2, limma…(Commonly used in transcriptome)

1
2
3
diff_da(otutab,metadata["Group"])->res
volcano_p(res)
volcano_p(res,mode=2)

Community assembly

Community assembly in microbiome refers to the processes that shape the composition, diversity, and structure of microbial communities in a particular environment or host. Microbiome consist of diverse microbial populations that interact with each other and their surroundings, and understanding how these communities assemble is crucial for comprehending their ecological dynamics and functional implications.

1
2
ncm(otutab)->ncm_res
plot(ncm_res)

Phylogenetic tree

1
2
ann_tree(taxonomy,otutab)->tree
easy_tree(tree,add_abundance=FALSE)

Cite

Please cite:

Chen P (2023). pctax: Professional Comprehensive Microbiome Data Analysis. R package, https://github.com/Asa12138/pctax.

Email: pengchen2001@zju.edu.cn
Built with Hugo
Theme Stack designed by Jimmy