Giter Site home page Giter Site logo

microbiomeviz's Introduction

Hi 👋, I'm Chenhao Li (李陈浩)

GIF

Github | Twitter | Google Scholar | ORCID

  • 🔍 A postdoc at Massachusetts General Hospital and Broad Institute

  • 🧑🏻‍💻 A computational biologist working with high-throughput sequencing data

  • 🧫 Study the gut microbiome and its interactions with the host

  • ❓ Interested in the uncharacterized functional space of the gut microbes

  • ❓ Interested in the spatial-temporal dynamics of the gut microbes

microbiomeviz's People

Contributors

lch14forever avatar zhanxw avatar zhuchcn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

microbiomeviz's Issues

The download method should be update_using the BiocManager

  1. When i perform it : devtools::install_github("lch14forever/microbiomeViz")
    The error is as follow:

Downloading GitHub repo lch14forever/microbiomeViz@HEAD
Skipping 2 packages not available: treeio, ggtree
✓ checking for file ‘/private/var/folders/l4/lcqqh9s553vf2k5j0r3ybhjm0000gn/T/Rtmp65LL9h/remotes11d553b575199/lch14forever-microbiomeViz-e22d7b1/DESCRIPTION’ (362ms)
─ preparing ‘microbiomeViz’:
✓ checking DESCRIPTION meta-information
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘microbiomeViz_0.1.0.tar.gz’

  • installing source package ‘microbiomeViz’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** byte-compile and prepare package for lazy loading
    Error: object ‘get_aes_var’ is not exported by 'namespace:rvcheck'
    Execution halted
    ERROR: lazy loading failed for package ‘microbiomeViz’
  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/microbiomeViz’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/l4/lcqqh9s553vf2k5j0r3ybhjm0000gn/T//Rtmp65LL9h/file11d5561ae323e/microbiomeViz_0.1.0.tar.gz’ had non-zero exit status

  1. considering the Error: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install

The download method should be update as follows:

if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("ggtree")
BiocManager::install("treeio")

I add the follow script but still did not work:

make parseMetaphlanTSV() more general?

Could you edit a bit to make parseMetaphlanTSV() more general?

I am recently using .BIOM files for microbiome data analysis and they have similar taxonomy table format. The dataset can be easily visualized by GraPhlAn by simply pasting the dataset together with "." as a seperator, and use the generated txt file as input.

If you want to see the dataset, do

biocLite("phyloseq")
library(phyloseq)
data("GlobalPatterns")
tax_table(GlobalPatterns)@.Data %>% View()

Can't install successfully!

1: All
2: CRAN packages only
3: None
4: glue (1.4.1 -> 1.4.2) [CRAN]
5: vctrs (0.3.2 -> 0.3.3) [CRAN]

Error : (由警告转换成)无法重新编码'visualizer.R'行155
ERROR: unable to collate and parse R files for package 'microbiomeViz'

does not work for "enterotype" and my data

Hi, I tried using "enterotype" which comes from phyloseq and it got stucked at fix_duplicate_tax() and here is the related information:
image
image

For my data, it got stuck at parsePhyloseq,
image
image
I am sorry that I could not share my data but I am happy to follow any instructions.

Only works for phyloseq when the phyloseq object (e.g GlobalPattern) has taxa_are_row == TRUE

I don't know why but phyloseq allows two kind of otu layout in a phyloseq object; one is taxa_are_row and the other one not. To access this information, one can use taxa_are_row(phyobj) to check.

What I found is microbiomeViz currently only supports the taxa_are_row == TRUE phyobj, but you can make adjustment if you have time. And here is one function I wrote to make that kind of adjustment.

edit_phyobj = function(phyobj){ # phyobj must be taxa_are_rows = TRUE for microbiomeviz to work
			if(!taxa_are_rows(phyobj)){
				otu = otu_table(phyobj)
				otu = t(otu)

				return(
					phyloseq(
						otu_table(otu,taxa_are_rows = TRUE),
						tax_table(phyobj),
						sample_data(phyobj)
						)
					)
			}
		}

bug

Visualizator.r in the cloned source code contains one more character on 155 lines, causing the package installation to fail.

error line :facet_grid(group~., scale='free_y',  space = "free_y",

correct line:facet_grid(group~., scale='free_y', space = "free_y",
Idea reminds me that it is hard to distinguish with naked eyes

add dependency to stringr

Hi, it is just a minor issue. When I use microbiomeviz for phyloseq object following the example, I got "Error in str_c(...)...." when doing "tr = parsePhyloseq(GP)". I believe it is due to stringr is not loaded when microbiomeviz is loaded, yet it did get installed when installing microbiomeviz. Just a minor issue and I think you are doing a great job in incorporating phyloseq object and .BIOM into your package!

Fix dependency warnings

It seems that the package is loading both dplyr and plyr (maybe due to phyloseq?), creating a lot of warnings for function overwriting.

a

A

clade.anno() doesn't annotate correctly

Hi, thanks for making this package! And the new version is much better! I still have two issues using the clade.anno function. I customized it myself, but maybe you should consider fixing them in the future.

The first issue is when I try to annotate the tree with a dataframe, the calde.anno function does not label the nodes correctly. The reason is in the visualizer.R, line 29, that the node_ids are actually not in the same order as the nodes originally in the anno.data passed in. So I just sorted them and it worked out fine.

And also, the layout of the annotation text on the side is very awkward. If I increase the anno.y, part of the text will disappear because of the nature of geom_text (I think).

Plus, it will also be cool to add legends for the colors.

Dependencies

Require the latest dev version of treeio and ggtree

example not working

I tried the example in Windows and it is not working. Here is the error message. I used the latest development version of treeio and ggtree.

data("SRS014459_Stool_profile")

tr <- parseMetaphlanTSV(SRS014459_Stool_profile)
Error in mutate_impl(.data, dots) :
Evaluation error: 'x' must be an array of at least two dimensions.

Unable to add annotation information

Hello
I'm trying to use the microbiomeViZ package. I obtained error with my data and so tried with microbiomeViZ example.
I'm obtaining the following error :
Warning messages:
1: Computation failed in stat_clad_bar().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"
2: Computation failed in stat_clade_text().

here are my code and session info. I updated all my packages. thanks in advance
Regards

`> library(ggtree)

library(tidytree)
library(ggplot2)
library(microbiomeViz)

tr <- parseMetaphlanTSV(SRS014459_Stool_profile)
p <- tree.backbone(tr)
anno.data <- data.frame(node = c("c__Clostridia", "g__Roseburia", "s__Bacteroides_ovatus"),

  •                     color = 'red', stringsAsFactors = FALSE)
    

library(dplyr)
p <- clade.anno(p1, anno.data)
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
! # Invaild edge matrix for . A <tbl_df> is returned.
p
Warning messages:
1: Computation failed in stat_clad_bar().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"
2: Computation failed in stat_clade_text().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"
3: Computation failed in stat_clad_bar().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"
4: Computation failed in stat_clade_text().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"
5: Computation failed in stat_clad_bar().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"
6: Computation failed in stat_clade_text().
Caused by error in UseMethod():
! no applicable method for 'offspring' applied to an object of class "data.frame"

sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22631)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8 LC_CTYPE=Chinese (Simplified)_China.utf8
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.utf8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] dplyr_1.1.4 microbiomeViz_0.1.0 ggplot2_3.5.0 tidytree_0.4.6
[5] ggtree_3.6.2 phyloseq_1.42.0

loaded via a namespace (and not attached):
[1] nlme_3.1-160 bitops_1.0-7 fs_1.6.3 usethis_2.2.3
[5] devtools_2.4.5 GenomeInfoDb_1.34.9 profvis_0.3.8 tools_4.2.2
[9] utf8_1.2.4 R6_2.5.1 vegan_2.6-4 DBI_1.2.2
[13] lazyeval_0.2.2 BiocGenerics_0.44.0 mgcv_1.8-41 colorspace_2.0-3
[17] permute_0.9-7 rhdf5filters_1.10.1 ade4_1.7-22 withr_3.0.0
[21] urlchecker_1.0.1 tidyselect_1.2.1 compiler_4.2.2 cli_3.6.2
[25] Biobase_2.58.0 shadowtext_0.1.3 labeling_0.4.3 scales_1.3.0
[29] readr_2.1.5 stringr_1.5.1 digest_0.6.33 yulab.utils_0.1.4
[33] XVector_0.38.0 pkgconfig_2.0.3 htmltools_0.5.7 sessioninfo_1.2.2
[37] fastmap_1.1.1 htmlwidgets_1.6.4 rlang_1.1.3 rstudioapi_0.15.0
[41] shiny_1.8.0 farver_2.1.1 gridGraphics_0.5-1 generics_0.1.3
[45] jsonlite_1.8.8 RCurl_1.98-1.13 magrittr_2.0.3 ggplotify_0.1.2
[49] GenomeInfoDbData_1.2.9 biomformat_1.26.0 patchwork_1.2.0 Matrix_1.6-4
[53] Rcpp_1.0.11 munsell_0.5.0 S4Vectors_0.36.2 Rhdf5lib_1.20.0
[57] fansi_1.0.6 ape_5.7-1 lifecycle_1.0.4 stringi_1.8.3
[61] MASS_7.3-58.1 zlibbioc_1.44.0 rhdf5_2.42.1 pkgbuild_1.4.3
[65] plyr_1.8.9 grid_4.2.2 parallel_4.2.2 promises_1.2.1
[69] crayon_1.5.2 miniUI_0.1.1.1 lattice_0.20-45 Biostrings_2.66.0
[73] splines_4.2.2 multtest_2.54.0 hms_1.1.3 pillar_1.9.0
[77] igraph_1.6.0 reshape2_1.4.4 codetools_0.2-19 stats4_4.2.2
[81] pkgload_1.3.4 glue_1.7.0 ggfun_0.1.4 remotes_2.4.2.1
[85] data.table_1.14.10 vctrs_0.6.5 treeio_1.22.0 tzdb_0.4.0
[89] httpuv_1.6.13 foreach_1.5.2 gtable_0.3.4 purrr_1.0.1
[93] tidyr_1.3.0 cachem_1.0.8 mime_0.12 xtable_1.8-4
[97] later_1.3.2 survival_3.4-0 tibble_3.2.1 iterators_1.0.14
[101] aplot_0.2.2 memoise_2.0.1 IRanges_2.32.0 cluster_2.1.4
[105] ellipsis_0.3.2`

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.