GithubHelp home page GithubHelp logo

microbiomeviz's Introduction

microbiomeViz -- An R package for visualizing microbiome data

Authors:

Chenhao Li, Guangchuang Yu, Chenghao Zhu

Description:

  • parse taxonomic profiling table
  • GraPhlAn like tree visualization and annotation
  • support cladograme visualization from phyloseq objects and .biom files

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)

microbiomeviz's People

Contributors

lch14forever avatar zhanxw avatar zhuchcn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.