Skip to content

nyankomicro is a in-house package that aims to make the plots more beautiful.

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

xvtyzn/nyankomicro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nyankomicro

Lifecycle: experimental

nyankomicro is a in-house package that aims to make the plots more beautiful.

Bar charts produced by various packages can confuse discussions if the annotations for a particular domain are unknown (e.g. NA, uncultured, uncultured bacteria, etc.). To avoid such confusion, this package uniquely sets unknown annotations as Undetermined. Also, the taxonomy to be visualized will be shown if it is N% or more in at least one sample.

Installation

You can install the released version of demopckg from GitHub with:

devtools::install_github("xvtyzn/nyankomicro")
devtools::update_packages("nyankomicro")

Example

Barplot

library(phyloseq)
library(nyankomicro)
data("GlobalPatterns")

microbiome_barplot(GlobalPatterns, "Order", "SampleType", 10)

The above result contains an Order YS2, so if you would like to re-classify these as Undetermined, you can do the following.

microbiome_barplot(GlobalPatterns, "Order", "SampleType", 10, na_str = "YS2")

Following the naming conventions for bacteria, italics are used to classify bacteria below the family level.

microbiome_barplot(GlobalPatterns, "Family", "SampleType", 10)

You can also visualize the nested categories.

data(enterotype)
enterotype_na_omited <- subset_samples(enterotype, !is.na(Nationality))

microbiome_barplot(enterotype_na_omited, "Genus", c("Nationality", "ClinicalStatus"), 10)

Taxonomic annotation

この結果は、それぞれのasvに対する非荷重の結果となっており、各ASVがサンプルごとにどれくらいの割合で存在するかを考慮していない。

#taxonomy_plot(GlobalPatterns)

カテゴリごとのannotation 割合

taxonomy levelを指定した際のannotation 割合

DEseq2 plot

ASV level

The results of Deseq2 tests can be visualized together with a phylogenetic tree. The visualization can be created for each ASV level and for each domain you would like to focus on.

library(DESeq2)
library(tidyverse)
data("GlobalPatterns")

subGP <- subset_samples(GlobalPatterns, SampleType %in% c("Skin", "Tongue") )
  
deseq2_subGP <- subGP %>%
  phyloseq_to_deseq2(~SampleType) %>%
  DESeq() %>%
  results(cooksCutoff = FALSE)

ggtree_subGP <- deseq2_tree(subGP, deseq2_subGP,level = "Phylum", alpha = 0.01,
                            sample_annotation = "SampleType")
ggtree_subGP

Genus level

Here are the results generated for each genus. It is based on taxnomy annotation of phyloseq and summarized by tax_glom of speedyseq. So ASVs that do not have annotation to genus (NA) are removed.

こちらは、Genusごとに作成した結果です。phyloseqのtaxnomy annotationに基づいて、speedyseqのtax_glomによってまとめています。そのため、genusまでannotationがつかない (NAとなっている) ASVは除去されます。

ggtree_subGP_genus <- deseq2_tree(subGP, deseq2_subGP,level = "Genus", alpha = 0.01,
                            sample_annotation = "SampleType", vis_domain = TRUE)
#> [1] "12ASVs were removed\n"
ggtree_subGP_genus

Core microbiome estimation

コアmicrobiomeの決定には複数の議論が存在します。

そのため、以下ではcore microbiomeの決定のために便利な幾つかの関数を提示します

threholdによる変動

data("GlobalPatterns")

subGP2 <- subset_samples(GlobalPatterns, SampleType %in% c("Skin", "Tongue", "Feces") )

ベン図での可視化

Upset図による可視化

About

nyankomicro is a in-house package that aims to make the plots more beautiful.

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages