Giter Club home page Giter Club logo

ranacapa's People

Contributors

gauravsk avatar madcowen avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ranacapa's Issues

Do things with continuous metadata?

We currently don't do anything with continuous metadata (everything gets treated as categorical- or there's just no test run). It might be worth doing a few simple things with continuous variables (scatterplot of diversity by variable, scatterplot of NMDS distance vs. Euclidean distance of variable)

bigger rarefaction plots

the facet_wrap()'ed plots on the rarefaction page are quite small as @madcowen pointed out. Will think of alternatives- perhaps just no faceting

Error running runRanacapa()

Hi I get this error running runRanacapa(). Any ideas what I can try?

> runRanacapaApp()

Listening on http://127.0.0.1:4899
Warning: Error in .Call: Incorrect number of arguments (6), expecting 4 for 'unserialize_from_yaml'
  67: yaml.load
  66: yaml::yaml.load_file
  65: getDependency
  64: widget_dependencies
  63: htmlwidgets::shinyWidgetOutput
  61: DT::dataTableOutput
Warning: Error in .Call: Incorrect number of arguments (6), expecting 4 for 'unserialize_from_yaml'
  67: yaml.load
  66: yaml::yaml.load_file
  65: getDependency
  64: widget_dependencies
  63: htmlwidgets::shinyWidgetOutput
  61: DT::dataTableOutput
> session_info()
- Session info --------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.2 (2016-10-31)
 os       Windows >= 8 x64            
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United Kingdom.1252 
 ctype    English_United Kingdom.1252 
 tz       Europe/London               
 date     2018-11-16                  

- Packages ------------------------------------------------------------------------------------------------------------------------------------------
 package         * version date       lib source                            
 ade4              1.7-13  2018-08-31 [1] CRAN (R 3.3.2)                    
 ape               5.2     2018-09-24 [1] CRAN (R 3.3.2)                    
 assertthat        0.2.0   2017-04-11 [1] CRAN (R 3.3.3)                    
 backports         1.1.2   2017-12-13 [1] CRAN (R 3.3.3)                    
 base64enc         0.1-3   2015-07-28 [1] CRAN (R 3.3.2)                    
 bindr             0.1.1   2018-03-13 [1] CRAN (R 3.3.3)                    
 bindrcpp        * 0.2.2   2018-03-29 [1] CRAN (R 3.3.3)                    
 Biobase           2.34.0  2016-10-18 [1] Bioconductor                      
 BiocGenerics      0.20.0  2016-10-18 [1] Bioconductor                      
 biomformat        1.2.0   2016-10-18 [1] Bioconductor                      
 Biostrings        2.42.1  2016-12-01 [1] Bioconductor                      
 callr             3.0.0   2018-08-24 [1] CRAN (R 3.3.2)                    
 cli               1.0.1   2018-09-25 [1] CRAN (R 3.3.2)                    
 cluster           2.0.5   2016-10-08 [2] CRAN (R 3.3.2)                    
 codetools         0.2-15  2016-10-05 [2] CRAN (R 3.3.2)                    
 colorspace        1.3-2   2016-12-14 [1] CRAN (R 3.3.2)                    
 crayon            1.3.4   2017-09-16 [1] CRAN (R 3.3.3)                    
 crosstalk         1.0.0   2016-12-21 [1] CRAN (R 3.3.3)                    
 curl              3.2     2018-03-28 [1] CRAN (R 3.3.3)                    
 data.table      * 1.11.8  2018-09-30 [1] CRAN (R 3.3.2)                    
 desc              1.2.0   2018-05-01 [1] CRAN (R 3.3.2)                    
 devtools        * 2.0.1   2018-10-26 [1] CRAN (R 3.3.2)                    
 digest            0.6.18  2018-10-10 [1] CRAN (R 3.3.2)                    
 dplyr           * 0.7.4   2017-09-28 [1] CRAN (R 3.3.3)                    
 DT                0.5     2018-11-05 [1] CRAN (R 3.3.2)                    
 foreach           1.4.4   2017-12-12 [1] CRAN (R 3.3.3)                    
 fs                1.2.6   2018-08-23 [1] CRAN (R 3.3.2)                    
 ggplot2         * 2.2.1   2016-12-30 [1] CRAN (R 3.3.2)                    
 glue              1.3.0   2018-07-17 [1] CRAN (R 3.3.2)                    
 gtable            0.2.0   2016-02-26 [1] CRAN (R 3.3.2)                    
 htmltools         0.3.6   2017-04-28 [1] CRAN (R 3.3.3)                    
 htmlwidgets       1.3     2018-09-30 [1] CRAN (R 3.3.2)                    
 httpuv            1.4.5   2018-07-19 [1] CRAN (R 3.3.2)                    
 httr              1.3.1   2017-08-20 [1] CRAN (R 3.3.3)                    
 igraph            1.1.2   2017-07-21 [1] CRAN (R 3.3.3)                    
 IRanges           2.8.2   2017-03-18 [1] Bioconductor                      
 iterators         1.0.10  2018-07-13 [1] CRAN (R 3.3.2)                    
 jsonlite          1.5     2017-06-01 [1] CRAN (R 3.3.3)                    
 later             0.7.5   2018-09-18 [1] CRAN (R 3.3.2)                    
 lattice           0.20-34 2016-09-06 [2] CRAN (R 3.3.2)                    
 lazyeval          0.2.1   2017-10-29 [1] CRAN (R 3.3.3)                    
 magrittr          1.5     2014-11-22 [1] CRAN (R 3.3.2)                    
 markdown          0.8     2017-04-20 [1] CRAN (R 3.3.3)                    
 MASS              7.3-45  2016-04-21 [2] CRAN (R 3.3.2)                    
 Matrix            1.2-7.1 2016-09-01 [2] CRAN (R 3.3.2)                    
 memoise           1.1.0   2017-04-21 [1] CRAN (R 3.3.3)                    
 mgcv              1.8-15  2016-09-14 [2] CRAN (R 3.3.2)                    
 mime              0.6     2018-10-05 [1] CRAN (R 3.3.2)                    
 multtest          2.30.0  2016-10-18 [1] Bioconductor                      
 munsell           0.5.0   2018-06-12 [1] CRAN (R 3.3.2)                    
 nlme              3.1-128 2016-05-10 [2] CRAN (R 3.3.2)                    
 permute           0.9-4   2016-09-09 [1] CRAN (R 3.3.2)                    
 phyloseq        * 1.19.1  2016-12-30 [1] Bioconductor                      
 pillar            1.1.0   2018-01-14 [1] CRAN (R 3.3.3)                    
 pkgbuild          1.0.2   2018-10-16 [1] CRAN (R 3.3.2)                    
 pkgconfig         2.0.2   2018-08-16 [1] CRAN (R 3.3.2)                    
 pkgload           1.0.1   2018-10-11 [1] CRAN (R 3.3.2)                    
 plotly          * 4.7.1   2017-07-29 [1] CRAN (R 3.3.3)                    
 plyr              1.8.4   2016-06-08 [1] CRAN (R 3.3.3)                    
 prettyunits       1.0.2   2015-07-13 [1] CRAN (R 3.3.3)                    
 processx          3.2.0   2018-08-16 [1] CRAN (R 3.3.2)                    
 promises          1.0.1   2018-04-13 [1] CRAN (R 3.3.3)                    
 ps                1.2.0   2018-10-16 [1] CRAN (R 3.3.2)                    
 purrr             0.2.5   2018-05-29 [1] CRAN (R 3.3.2)                    
 R6                2.3.0   2018-10-04 [1] CRAN (R 3.3.2)                    
 ranacapa        * 0.1.0   2018-11-08 [1] Github (gauravsk/ranacapa@09cdc27)
 Rcpp              0.12.19 2018-10-01 [1] CRAN (R 3.3.2)                    
 remotes           2.0.1   2018-10-19 [1] CRAN (R 3.3.2)                    
 reshape         * 0.8.8   2018-10-23 [1] CRAN (R 3.3.2)                    
 reshape2          1.4.3   2017-12-11 [1] CRAN (R 3.3.3)                    
 rhdf5             2.18.0  2016-10-18 [1] Bioconductor                      
 rlang             0.2.0   2018-02-20 [1] CRAN (R 3.3.3)                    
 rprojroot         1.3-2   2018-01-03 [1] CRAN (R 3.3.3)                    
 rsconnect         0.8.8   2018-03-09 [1] CRAN (R 3.3.3)                    
 rstudioapi        0.8     2018-10-02 [1] CRAN (R 3.3.2)                    
 S4Vectors         0.12.2  2017-03-18 [1] Bioconductor                      
 scales            1.0.0   2018-08-09 [1] CRAN (R 3.3.2)                    
 sessioninfo       1.1.0   2018-09-25 [1] CRAN (R 3.3.2)                    
 shiny           * 1.1.0   2018-05-17 [1] CRAN (R 3.3.2)                    
 shinythemes     * 1.1.2   2018-11-06 [1] CRAN (R 3.3.2)                    
 splitstackshape * 1.4.6   2018-07-23 [1] CRAN (R 3.3.2)                    
 stringi           1.1.6   2017-11-17 [1] CRAN (R 3.3.3)                    
 stringr         * 1.2.0   2017-02-18 [1] CRAN (R 3.3.3)                    
 survival          2.42-6  2018-07-13 [1] CRAN (R 3.3.2)                    
 testthat          2.0.1   2018-10-13 [1] CRAN (R 3.3.2)                    
 tibble            1.4.2   2018-01-22 [1] CRAN (R 3.3.3)                    
 tidyr           * 0.8.1   2018-05-18 [1] CRAN (R 3.3.2)                    
 tidyselect        0.2.3   2017-11-06 [1] CRAN (R 3.3.3)                    
 usethis         * 1.4.0   2018-08-14 [1] CRAN (R 3.3.2)                    
 vegan             2.5-3   2018-10-25 [1] CRAN (R 3.3.2)                    
 viridisLite       0.3.0   2018-02-01 [1] CRAN (R 3.3.3)                    
 withr             2.1.2   2018-03-15 [1] CRAN (R 3.3.3)                    
 xtable            1.8-3   2018-08-29 [1] CRAN (R 3.3.2)                    
 XVector           0.14.1  2017-03-18 [1] Bioconductor                      
 yaml            * 2.2.0   2018-07-25 [1] CRAN (R 3.3.2)                    
 zlibbioc          1.20.0  2016-10-18 [1] Bioconductor                      

[1] C:/Users/basti/Documents/R/win-library/3.3
[2] C:/Program Files/R/R-3.3.2/library

small app edits

  • I think it would be helpful to have a short description of what the demo dataset is if users select "demo" @gauravsk
  • rotating axes in alpha diversity plot didn’t give x axis enough space! same with taxonomy barplot. make margin a little bigger
  • PCoA make title of plot fully capitalized (Dissimilarity Method)
  • In Beta div stats tab, explain “Adonis”? Or don't call the tables Adonis and Pairwise adonis. @gauravsk
  • (small annoying thing—the genus and species levels of taxonomy barplot take a LONG time and clicking to other tabs doesn’t stop this :( wonder if there should be a pause button or something?) note that i wasn’t patient enough to even see if genus or species worked for unrarefied, beecause it took a long time, and got a warning to use devtools::install_github('hadley/ggplot2') for ggplotly. Maybe subset this demo dataset?? the taxonomy heat map also takes a fairly long time and that would be better with a subset of the demo dataset, too, but it's a reasonable amount of time.

beta diversity functionality temporarily broken- workaround in here

I got an email from the MIMG109 folks saying that their students were running into errors with the beta diversity tab of the ranacapa app on some computers, but not on others:

image

I figured out that the computers having this issue were running vegan v 2.5-1, whereas those that were not having this issue were running vegan v 2.4-6. The issue comes up because of recent updates to vegan that have not yet made their way into phyloseq. Some ongoing discussion about similar errors here.

The temporary workaround for this is to roll back to vegan v 2.4.-6, which can be done with the following steps:


remove.packages("vegan")
remove.packages("phyloseq")
remove.packages("ranacapa")

devtools::install_version("vegan", version = "2.4-6", repos = "http://cran.us.r-project.org")
source("https://bioconductor.org/biocLite.R")
biocLite("phyloseq")
# IMPORTANT! When asked if you want to update packages, including Vegan, enter 'n'
devtools::install_github("gauravsk/ranacapa")

It might be worth redoing how we manage package imports

Hadley Wickham suggests using the package::function() syntax when writing code:

Adding a package dependency here ensures that it’ll be installed. However, it does not mean that it will be attached along with your package (i.e., library(x)). The best practice is to explicitly refer to external functions using the syntax package::function(). This makes it very easy to identify which functions live outside of your package. This is especially useful when you read your code in the future.

If you use a lot of functions from other packages this is rather verbose. There’s also a minor performance penalty associated with :: (on the order of 5µs, so it will only matter if you call the function millions of times). You’ll learn about alternative ways to call functions in other packages in namespace imports.

Some more info about this here

It probably doesn't matter a whole lot, but might be worth it to make code more readable I guess

ggrare_grouping samples

Out of curiosity, is it possible to include an argument to group the samples based on metadata while plotting the rarefaction curve?
For instace, ggrare(gp, step = 1000, color = "SampleType", label = "Sample", group = "habitat", se = T)

Thanks

test not working

Hi Gaurav, recently ranacapa as an R package stopped working for me. The Shiny app still works fine.
If I run the test, I get:

── Error (Line 4): conversion to physeq object works for good files ─────────────────────
Error: .data must be a data frame without row names.
Backtrace:

  1. testthat::expect_is(...)
  2. tibble::column_to_rownames(., "sum.taxonomy")

And later I get:
── Error (Line 3): duplicate entries in taxon table get summarized ─────────────────────
Error: error in evaluating the argument 'x' in selecting a method for function 'nrow': error in evaluating the argument 'object' in selecting a method for function 'tax_table': .data must be a data frame without row names.
Backtrace:

  1. testthat::expect_equal(...)
  2. base::.handleSimpleError(...)
  3. base:::h(simpleError(msg, call))
    Error (Line 2): extra entries in metadata file get filtered out ─────────────────────
    Error: error in evaluating the argument 'x' in selecting a method for function 'nrow': error in evaluating the argument 'object' in selecting a method for function 'sample_data': .data must be a data frame without row names.
    Backtrace:
  4. testthat::expect_equal(...)
  5. base::.handleSimpleError(...)
  6. base:::h(simpleError(msg, call))

Any advice?

Thank you so much.

refer to external functions using 'packagename::function()'

On running devtools::check() I of course get a ton of messages that look like

convert_anacapa_to_phyloseq: no visible global function definition for
  ‘column_to_rownames’

The recommended workflow here is to explicitly state packagename in front of external function names, e.g. here the function should read tibble::column_to_rownames(...)

ranacapa_automated.R file link is broken

Hello,
The link to the ranacapa_automated.R file is a 404 dead end. Is there another way to get the R script to run rANACAPA locally instead of through the shiny app? I'm having trouble uploading my input files to the shiny app (it says file size limit exceeded), so I thought I would try running it on my machine...
Thanks so much!

how to draw a line?

Hello
tried abline function and geom_hline function to draw a line but didn't work.
any suggestion?

p <- ggrare(ps.3, step = 1000, color = "treatment", 
       label = rownames(sample_data(ps.3)),
       parallel = TRUE, # parallel is to make the process faster 
       se = FALSE) +
  facet_wrap(~treatment) +
  labs(x = "Sample Size", y = "Observed ASVs")
trail one 
p + abline(v= quantile(sample_sums(ps.prev@otu_table), 0.25)) 
trail two 
p + abline(v= 2476) # draw a vertical line at the min of the sample sums
trail three 
p +  geom_hline(xintercept = 2476, color = "red") 

Thanks

laundry list of things to be fixed

Overall

  • there's a bunch of places where the spacing isn't great in the app (e.g. axis labels get cut off)- could probably just make the plots smaller

On alpha diversity page

  • Give users option to rotate the axis labels
  • Right now, on the alpha diversity plots, if the samples are grouped by a variable (e.g. depth), and a user hovers over a point, the value of the point is shown but not the identity of the point. This makes it hard to figure out, e.g. "which of the low depth plots has the highest sp richness". Can we figure out a way that hovering over a point shows the sample name of the point?

On beta diversity page

  • in server.R, get rid of the "big old heat map" lines
  • in server.R, get rid of the "network map" lines
  • also get rid of the two above from the call to grid.arrange
  • uncomment lines in ui.R so that the ward linkage map does get shown

Taxonomy barplot

  • I think the barplot doesnt use theme_ranacapa right now- has a gray background.

Taxonomy heat map

  • No scale bar generated- can we add one

some useful info for app deployment

Using this issue to keep track of things that help during app deployment.

options(repos = BiocInstaller::biocinstallRepos())

helps with bioconductor packages

Barplots size and other suggestions for improvements

Hi,

thank you for this really great app, with some minor manipulation of standard formats it's really able to give a quick and awesome glimpse of data. I have just a couple of small questions/enhancement requests:

  • Plots like "taxonomy barplot" would look better if it would be possible to adjust the axis sizes, especially the y-axis when there are a lot of OTUs/ASVs. And this is related to the second question:
  • Still in the taxonomy barplot, it would be nice to have the option to display the top Ns taxa based eg on the sum of the abundance across samples (I know there is plenty of ways to select the top Ns taxa, this is just my favourite one :D). I guess I could subset the taxa before importing the data into the app, but this would screw with the other statistics.

My guess is that these enhancements are not very hard to implement, but my skills with shinyapps are not this extended :D

Again, this is a great app! I hope you're still developing and taking care of it.

Domenici

Error in seq.default(1, tot[i], by = step) : wrong sign in 'by' argument

When I try to run the ggrare function on my phyloseq object, I get the following error: Error in seq.default(1, tot[i], by = step) : wrong sign in 'by' argument.

Any clue what this means or what might be causing it? I tried setting step to many different values (1,10,100,1000) as well as deleting it entirely from the code but nothing changed the error I got.

taxonomy barplot categories

figure out why there are different sections in a given barplot in the taxonomy barplot tab of the shiny app for the same phylum, class, etc.

check if this is an issue in the app

From Sabrina:

Hey! so this may have been fixed already ( i cant tell because I dont see a scripted version of ranacapa on your or the anacapa github)…. the one that I have has a small bug in the beta diversity calculations…. it does not recalculate the distance matrix when switching to the bray method of analysis…. it was an easy fix by just adding

d <- distance(physeq_obj_rare, method=dissimMethod)
sampledf <- data.frame(sample_data(physeq_obj_rare))
veganComm <- vegan_otu(physeq_obj_rare)
ord <- ordinate(physeq_obj_rare, method = "MDS", distance = d)

after

dissimMethod = "bray"

so it was using the jaccard distance matrix for both the bray and jaccard analyses and therefore giving the same results for both

File validator function

We could use a function that confirms a few things about the input metadata and biom tables.

Post here if there's specific things you want this function to do

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.