README.md

microbiomeViz -- An R package for visualizing microbiome data

Authors:

Chenhao Li, Guangchuang Yu, Chenghao Zhu

Description:

Showcase:

Example:

Install:

## ## run the following command first if you don't have ggtree installed.
## setRepositories(ind=1:2)
devtools::install_github("lch14forever/microbiomeViz")

Parse a MetaPhlAn table

library(microbiomeViz)
data("SRS014459_Stool_profile")
tr <- parseMetaphlanTSV(SRS014459_Stool_profile)

Create a backbone

p <- tree.backbone(tr)
p

Add annotation

anno.data <- data.frame(node=c("g__Roseburia", "c__Clostridia", "s__Bacteroides_ovatus"),
                       color='red', stringsAsFactors = FALSE)
p <- clade.anno(p, anno.data)
p

From phyloseq objects

library(phyloseq)
data("GlobalPatterns")
GP = GlobalPatterns

GP = transform_sample_counts(GlobalPatterns, function(otu) otu/sum(otu))
GP = filter_taxa(GP, function(x) max(x)>=0.01,TRUE)
GP = fix_duplicate_tax(GP)

tr = parsePhyloseq(GP)
p = tree.backbone(tr, size=1)

From .biom files

The phyloseq package can import the otu table from .biom files.

rich_dense_biom  = system.file("extdata", "rich_dense_otu_table.biom",  package="phyloseq")
rich_dense = import_biom(rich_dense_biom, parseFunction=parse_taxonomy_greengenes)
tr = parsePhyloseq(rich_dense)
p = tree.backbone(tr, size=1)


lch14forever/microbiomeViz documentation built on Sept. 7, 2020, 4:34 p.m.