gauravsk / ranacapa Goto Github PK
View Code? Open in Web Editor NEWR package for downstream analysis for anacapa eDNA pipeline
Home Page: https://f1000research.com/articles/7-1734/v1
License: GNU General Public License v3.0
R package for downstream analysis for anacapa eDNA pipeline
Home Page: https://f1000research.com/articles/7-1734/v1
License: GNU General Public License v3.0
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)
the facet_wrap()
'ed plots on the rarefaction page are quite small as @madcowen pointed out. Will think of alternatives- perhaps just no faceting
https://shiny.rstudio.com/articles/modules.html; see also ShinyDiversity's repo
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
I think recent updates have made it so that we need to add the markdown package to the DESCRIPTION file.
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:
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")
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
@limey-bean suggested adding a download button for rarefied files
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
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:
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:
.data
must be a data frame without row names.Any advice?
Thank you so much.
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(...)
use read delim and maybe pipe it to a data.frame() to maintain downstream functionality
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!
Right now the heatmap and the barplot are made on unrarefied samples. Give users the option to choose which one the plot should be made from.
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
When I upload a biom file (size:16 Mb). it show this error: Maximum upload size exceeded
How to fix it ?
server.R
, get rid of the "big old heat map" linesUsing this issue to keep track of things that help during app deployment.
options(repos = BiocInstaller::biocinstallRepos())
helps with bioconductor packages
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:
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
the error above shows up for Maddi on the alpha div plots- figure out what's causing and fix ths
It's a silly name!
Sometimes a metadata column may be numeric but actually be categorical, e.g. Replicate number. I think the right thing to do will be to add options on the front/landing page for people to declare variables as continuous or categorical
I think this can be done in the convert_anacapa_to_physeq
function
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.
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.
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
Rarefaction plot made from the automated pipeline looks like this right now:
Just turn off the legend, it's unhelpful for large number of samples anyway
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
should be fairly straightforward.
As part of this, also agree on terminology for "output file from anacapa"-- not a huge fan of site frequency table
, which I think is what anacapa uses...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.