Skip to content

Commit

Permalink
Merge pull request #417 from bjohnso005/BAJdev
Browse files Browse the repository at this point in the history
[v2.1.2]
  • Loading branch information
danflop authored Mar 18, 2024
2 parents 1327e1f + 8bdb0e7 commit 45bbf6d
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 33 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: wallace
Version: 2.1.1
Date: 2023-12-05
Version: 2.1.2
Date: 2024-03-08
Title: A Modular Platform for Reproducible Modeling of Species Niches
and Distributions
Description: The 'shiny' application Wallace is a modular platform for
Expand Down Expand Up @@ -43,6 +43,7 @@ Imports:
leafem,
leaflet.extras (>= 1.0.0),
magrittr,
markdown,
methods,
RColorBrewer,
rJava,
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
wallace 2.1.2
=============
- Fixed FAIL in test_occs_queryDB
- Fixed bug in error msgs for xfer_time
- Fixed broken link in v1 vignette
- Added `markdown` to imports
- Updated team members

wallace 2.1.1
=============
- Fixed bug in occ density grid & niche overlap
Expand Down
3 changes: 2 additions & 1 deletion R/helper_functions.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
#
# helper_functions.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
Expand Down Expand Up @@ -66,6 +66,7 @@ spurious <- function(x) {
RColorBrewer::brewer.pal(x)
leafem::addMouseCoordinates(x)
leaflet.extras::removeDrawToolbar(x)
markdown::html_format()
rmarkdown::github_document(x)
shinyWidgets::pickerInput(x)
shinyjs::disable(x)
Expand Down
3 changes: 2 additions & 1 deletion R/xfer_time.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
#
# xfer_time.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
Expand Down Expand Up @@ -95,6 +95,7 @@
#' @author Jamie Kass <jkass@@gradcenter.cuny.edu>
#' @author Andrea Paz <paz.andreita@@gmail.com>
#' @author Gonzalo E. Pinilla-Buitrago <gepinillab@@gmail.com>
#' @author Bethany A. Johnson <bjohnso005@@citymail.cuny.edu>
#' @seealso \code{\link[dismo]{predict}}, \code{\link{xfer_time}}
#' \code{\link{xfer_userEnvs}}
#' @export
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![R-CMD-check](https://github.com/wallaceEcoMod/wallace/workflows/R-CMD-check/badge.svg)](https://github.com/wallaceEcoMod/wallace/actions) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![CRAN version](http://www.r-pkg.org/badges/version/wallace)](https://CRAN.R-project.org/package=wallace) [![downloads](https://cranlogs.r-pkg.org:443/badges/grand-total/wallace?color=orange)](https://cranlogs.r-pkg.org:443/badges/grand-total/wallace?color=orange)

# Wallace (v2.1.1)
# Wallace (v2.1.2)

*Wallace* is a modular platform for reproducible modeling of species niches and distributions, written in R. The application guides users through a complete analysis, from the acquisition of data to visualizing model predictions on an interactive map, thus bundling complex workflows into a single, streamlined interface.

Expand All @@ -27,7 +27,7 @@ run_wallace()
Please make sure you have installed the latest versions of both R (<a href= "https://cran.r-project.org/bin/macosx/" target="_blank">Mac OS</a>, <a href= "https://cran.r-project.org/bin/windows/base/" target="_blank">Windows</a>) and RStudio (<a href= "https://posit.co/download/rstudio-desktop/" target="_blank">Mac OS / Windows</a>: choose the free version).

#### How to run Maxent with maxent.jar
*Wallace* v2.1.1 includes two options to run Maxent models: maxnet and maxent.jar. The former, which is an R implementation and fits the model with the package `glmnet`, is now the default and does not require the package `rJava` (see Phillips et al. 2017). The latter, which is the Java implementation, runs the `maxent()` function in the package `dismo`. This function requires the user to place the `maxent.jar` file in the `/java` directory of the `dismo` package root folder. You can download Maxent <a href="https://biodiversityinformatics.amnh.org/open_source/maxent/" target="_blank">here</a>, and locate `maxent.jar`, which is the Maxent program itself, in the downloaded folder. You can find the directory path to `dismo/java` by running `system.file('java', package="dismo")` at the R console. Simply copy `maxent.jar` and paste it into this folder. If you try to run Maxent in *Wallace* without the file in place, you will get a warning message in the log window and Maxent will not run.
*Wallace* v2.1.2 includes two options to run Maxent models: maxnet and maxent.jar. The former, which is an R implementation and fits the model with the package `glmnet`, is now the default and does not require the package `rJava` (see Phillips et al. 2017). The latter, which is the Java implementation, runs the `maxent()` function in the package `dismo`. This function requires the user to place the `maxent.jar` file in the `/java` directory of the `dismo` package root folder. You can download Maxent <a href="https://biodiversityinformatics.amnh.org/open_source/maxent/" target="_blank">here</a>, and locate `maxent.jar`, which is the Maxent program itself, in the downloaded folder. You can find the directory path to `dismo/java` by running `system.file('java', package="dismo")` at the R console. Simply copy `maxent.jar` and paste it into this folder. If you try to run Maxent in *Wallace* without the file in place, you will get a warning message in the log window and Maxent will not run.

### Potential Issues

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/Rmd/text_about.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output: html_document

<img src="logo.png" alt="logo" style="width: 150px; float:right; padding:10px;"/>

Welcome to *Wallace*, a flexible application for reproducible ecological modeling, built for community expansion. The current version of *Wallace* (v2.1.1) steps the user through a full niche/distribution modeling analysis, from data acquisition to visualizing results.
Welcome to *Wallace*, a flexible application for reproducible ecological modeling, built for community expansion. The current version of *Wallace* (v2.1.2) steps the user through a full niche/distribution modeling analysis, from data acquisition to visualizing results.

The application is written in `R` with the web app development package `shiny`. Please find the stable version of *Wallace* on <a href="https://CRAN.R-project.org/package=wallace" target="_blank">CRAN</a>, and the development version on <a href="https://github.com/wallaceEcoMod/wallace" target="_blank">Github</a>. We also maintain a *Wallace* <a href="https://wallaceecomod.github.io/" target="_blank">website</a> that has some basic info, links, and will be updated with tutorial materials in the near future.

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/Rmd/text_intro_tab.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ output: html_document

#### WORKFLOW

*Wallace* (v2.1.1) currently includes ten components, or steps of a possible workflow. Each component includes two or more modules, which are possible analyses for that step.
*Wallace* (v2.1.2) currently includes ten components, or steps of a possible workflow. Each component includes two or more modules, which are possible analyses for that step.

**Components:**

Expand Down
10 changes: 6 additions & 4 deletions inst/shiny/Rmd/text_team.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ output: html_document

<img src="img/jamie.jpg" alt="jamie" style="width: 100px;"/>

<a href=" https://jamiemkass.github.io/" target="_blank">Jamie M. Kass</a> (co-lead developer) received his PhD at CUNY Graduate Center and City College of New York and is currently a Postdoctoral Scholar at Okinawa Institute of Science and Technology Graduate University.
<a href=" https://jamiemkass.github.io/" target="_blank">Jamie M. Kass</a> (co-lead developer) received his PhD at CUNY Graduate Center and City College of New York, did a Postdoc at Okinawa Institute of Science and Technology, and currently is Associate Professor at Tohoku University.
<br>

<img src="img/gonzalo.png" alt="gonzalo" style="width: 100px;"/>
Expand All @@ -28,10 +28,12 @@ output: html_document
<a href="https://github.com/bjohnso005" target="_blank">Bethany A. Johnson</a> (developer) received her MS in Biology from the City College of New York and is currently a Visiting Scientist at the Center for Biodiversity & Conservation at the American Museum of Natural History.
<br>

<img src="img/daniel.jpeg" alt="dani" style="width: 100px;"/>

<a href="https://www.amnh.org/research/staff-directory/daniel-lopez-lozano" target="_blank">Daniel López Lozano</a> (developer) is a Biodiversity Informatics Specialist at the American Museum of Natural History's Center for Biodiversity & Conservation.
<br>

<img src="img/valentina.png" alt="valentina" style="width: 100px;"/>
<img src="img/valentina.jpeg" alt="valentina" style="width: 100px;"/>

<a href="https://www.researchgate.net/profile/Valentina-Grisales-Betancur" target="_blank">Valentina Grisales-Betancur</a> (developer) completed her undergraduate degree at EAFIT University in Colombia and visited the Anderson lab at CCNY and Blair lab at AMNH.
<br>
Expand Down Expand Up @@ -85,9 +87,9 @@ Sarah Meenan (contributor) completed her undergraduate degree from the City Coll
<a href="https://www.researchgate.net/profile/Brian-Maitner" target="_blank">Brian S. Maitner</a> (contributor, external partner) is a researcher at the Geography Department of the University at Buffalo, SUNY.
<br>

<img src="img/hannahO.png" alt="hannahO" style="width: 100px;"/>
<img src="img/hannahO.jpeg" alt="hannahO" style="width: 100px;"/>

<a href="https://hannahlowens.weebly.com/" target="_blank">Hannah Owens</a> (contributor, external partner) is a Marie Skłodowska Curie Fellow at the Center for Macroecology, Evolution, and Climate at the University of Copenhagen.
<a href="https://hannahlowens.weebly.com/" target="_blank">Hannah Owens</a> (contributor, external partner) is an assistant professor at the Center for Global Mountain Biodiversity & the Center for Macroecology, Evolution, and Climate; Section for Biodiversity; Globe Institute; at the University of Copenhagen.
<br>

<img src="img/saraV.jpeg" alt="saraV" style="width: 100px;"/>
Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/Rmd/userReport_intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ knit_engines$set(asis = function(options) {
knitr::opts_chunk$set(message = FALSE, warning = FALSE, eval = FALSE)
```

Please find below the R code history from your *Wallace* v2.1.1 session.
Please find below the R code history from your *Wallace* v2.1.2 session.

You can reproduce your session results by running this R Markdown file in RStudio.

Expand Down
2 changes: 1 addition & 1 deletion inst/shiny/modules/occs_queryDb.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
component: occs
short_name: Query Database (Present)
long_name: Query Database (Present)
authors: Jamie M. Kass, Bruno Vilela, Gonzalo E. Pinilla-Buitrago, Hannah Owens, Cory Merow, Robert P. Anderson
authors: Jamie M. Kass, Bruno Vilela, Gonzalo E. Pinilla-Buitrago, Hannah Owens, Andrea Paz, Cory Merow, Robert P. Anderson
package: [BIEN, occCite, spocc]
39 changes: 27 additions & 12 deletions inst/shiny/modules/xfer_time.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wallace EcoMod: a flexible platform for reproducible modeling of
# species niches and distributions.
#
#
# xfer_time.R
# File author: Wallace EcoMod Dev Team. 2023.
# --------------------------------------------------------------------------
Expand Down Expand Up @@ -284,19 +284,34 @@ xfer_time_module_server <- function(input, output, session, common) {
"). You can not transfer to a New Time.")
return()
}
if(input$selTime == "") {
logger %>% writeLog(type = 'error', "Please select transfer time period.")
return()
}
if(input$selGCM == "") {
logger %>% writeLog(type = 'error', "Please select global circulation model.")
return()
}
if(input$selRCP == "") {
logger %>% writeLog(type = 'error', "Please select RCP.")
return()
#BAJ
if (input$selTimeVar == 'worldclim') {
# warnings for wc selections
if(input$selTime == "") {
logger %>% writeLog(type = 'error', "Please select transfer time period.")
return()
}
if(input$selGCM == "") {
logger %>% writeLog(type = 'error', "Please select global circulation model.")
return()
}
if(input$selRCP == "") {
logger %>% writeLog(type = 'error', "Please select RCP.")
return()
}
} else if (input$selTimeVar == 'ecoclimate') {
# warnings for ecoclimate selections
if(input$xfAOGCM == "") {
logger %>% writeLog(type = 'error', "Please select transfer AOGCM.")
return()
}
if(input$xfScenario == "") {
logger %>% writeLog(type = 'error', "Please select transfer temporal scenario.")
return()
}
}


# DATA ####
if (input$selTimeVar == 'worldclim') {
# code taken from dismo getData() function to catch if user is trying to
Expand Down
Binary file added inst/shiny/www/img/daniel.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added inst/shiny/www/img/hannahO.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed inst/shiny/www/img/hannahO.png
Binary file not shown.
Binary file added inst/shiny/www/img/valentina.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed inst/shiny/www/img/valentina.png
Binary file not shown.
2 changes: 2 additions & 0 deletions man/xfer_time.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions tests/testthat/test_occs_queryDb.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ test_that("output data checks", {
if ((TRUE %in% duplicated(out.gbif[[i]]$orig[, c('longitude', 'latitude')])) |
(NA %in% out.gbif[[i]]$orig[, c('longitude', 'latitude')])) {
# the cleaned table must have fewer records than the original one
expect_true((nrow(out.gbif[[i]]$orig)) > (nrow(out.gbif[[i]]$cleaned)))
} else { # if not,
# both tables should have the same number of records
expect_true((nrow(out.gbif[[i]]$orig)) == (nrow(out.gbif[[i]]$cleaned)))
}
# if not, both tables should have the same number of records
expect_true((nrow(out.gbif[[i]]$orig)) >= (nrow(out.gbif[[i]]$cleaned)))
}
# there are not "NA" values in longitude OR latitude columns in the cleaned table
expect_false(NA %in% out.gbif[[i]]$cleaned$latitude) |
(NA %in% out.gbif[[i]]$cleaned$longitude)
Expand Down
4 changes: 2 additions & 2 deletions vignettes/tutorial-v1.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ This vignette was written for *Wallace* v. 1.0.5, so if you are using a differen
# Introduction
*Wallace* is an `R`-based GUI application for ecological modeling that currently focuses on building, evaluating, and visualizing models of species niches and distributions. We will refer to these models as species distribution models (SDMs), and we will not explain them at length here---as you read through, you will be pointed to some sources of detailed info within the application for reference.

*Wallace* has many qualities which we think make it a good example of next-generation scientific software: it's 1) open, 2) expandable, 3) flexible, 4) interactive, 5) instructive, and 6) reproducible. The application features a pannable/zoomable map and dynamic plots and tables. Data for the models can be downloaded from online databases or uploaded by the user. Most results can be downloaded, including the option to save R code that can reproduce your analysis. For more details, including on SDMs, please see our [publication](http://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12945/full) in *Methods in Ecology and Evolution*. The citation is below:
*Wallace* has many qualities which we think make it a good example of next-generation scientific software: it's 1) open, 2) expandable, 3) flexible, 4) interactive, 5) instructive, and 6) reproducible. The application features a pannable/zoomable map and dynamic plots and tables. Data for the models can be downloaded from online databases or uploaded by the user. Most results can be downloaded, including the option to save R code that can reproduce your analysis. For more details, including on SDMs, please see our [publication](https://doi.org/10.1111/2041-210X.12945) in *Methods in Ecology and Evolution*. The citation is below:

Kass JM, Vilela B, Aiello-Lammens ME, Muscarella R, Merow C, Anderson RP. (2018). *Wallace*: A flexible platform for reproducible modeling of species niches and distributions built for community expansion. *Methods in Ecology and Evolution*. 9:1151-1156. https://doi-org.ezproxy.gc.cuny.edu/10.1111/2041-210X.12945
Kass JM, Vilela B, Aiello-Lammens ME, Muscarella R, Merow C, Anderson RP. (2018). *Wallace*: A flexible platform for reproducible modeling of species niches and distributions built for community expansion. *Methods in Ecology and Evolution*. 9:1151-1156. DOI:10.1111/2041-210X.12945

The *Wallace* project's [main page](https://wallaceecomod.github.io/) has links to the [Google Group](https://groups.google.com/forum/#!forum/wallaceecomod), the official [email](mailto:[email protected]), the [CRAN page](https://CRAN.R-project.org/package=wallace) hosting the stable version, and the [Github development page](https://github.com/wallaceEcoMod/wallace).

Expand Down

0 comments on commit 45bbf6d

Please sign in to comment.