Code repostitory to run analyses and generate figures and manuscript for Nitta et al. "A taxonomic and molecular survey of the pteridophytes of the Nectandra Reserve, Costa Rica". PLOS ONE 2020 https://doi.org/10.1371/journal.pone.0241231
All code is in R. The drake package is used to manage the workflow.
To run all analyses and generate the manuscript:
- Clone this repository
- If you haven't already, set up an NCBI Entrez API key
- Download the data
make.Rin the provided docker container
NCBI Entrez API key
This analysis queries GenBank and downloads DNA sequences. It is recommended to register a free NCBI
key and set this as the
ENTREZ_KEY environmental variable before running analyses, or warnings will be issued when the sequences get downloaded. See
taxize::`taxize-authentication`() for more info on how to set this up.
(short version of the
taxize documentation: make a file called
.Renviron in the root of this repo, and put this line in it:
somekey is the API key you set up on NCBI)
There are two small data files included in this repo. The rest of the data are hosted on Dryad. For each of the links below, click on "Download Dataset", then place the zipped data file (it will have a similar name to the DOI) in the
data folder of the this repo. This must be done before running
make.R. You can manually unzip the data archives if you want to see the contents, but the code needs the original zipped file in
data/ to run.
Reproducible analysis with Docker
make.R requires various packages to be installed, and may not work properly if package versions have changed. Therefore, a Docker image is provided to run the code reproducibly. You can install docker from here.
Navigate to the cloned repository (where
/path/to/repo is the path on your machine), and launch the container:
cd /path/to/repo docker-compose up -d
make.R inside the container:
docker exec nectandra_ferns_analysis_1 Rscript make.R
You will see the targets being built by
drake, and the final manuscript should be compiled at the end as
nectandra_ferns.docx in the
results/ms folder. Other figure and table files will also be compiled.
When it's finished, take down the container:
- All code in this repository is licensed under the MIT license
- The data are licensed under the CC0 1.0 Universal Public Domain Dedication license
- The paper is licensed under the Creative Commons Attribution License
- The Roboto font is licensed under the Apache 2.0 license