Closed taylorreiter closed 1 year ago
And also remove testthat
from suggests, because it doesn't really belong in DESCRIPTION I don't think.
I like the idea of recording the test env in a conda yml.
jk testthat needs to stay as that's the convention.
CI set up in #24 and #26
developer docs:
The sourmashconsumr package follows package developer conventions laid out in https://r-pkgs.org/. It uses this github repository, the software for R and RStudio, and the R packages devtools, testthat, and usethis for development. It also relies on the packages in the DESCRIPTION
file.
Outside arcadia: fork the repo to your own github user account. Clone the repository locally.
Inside arcadia: clone and create a branch.
Clone the repository locally using git clone
.
See section contributing XXX below for instructions on how to contribute code changes back to the sourmashconsumr repository.
Make sure you have R and RStudio installed.
You'll then need to open the R project for the sourmashconsumer project. You can do this by double clicking the sourmashconsumr.Rproj
file in your file finder or by using File
-> Open Project...
and then finding and opening the sourmashconsumr.Rproj
file.
To start developing the package, you'll need to install devtools
, testthat
, and usethis
.
You can use the following commands to install these packages:
install.packages(c("devtools", "testthat", "usethis"))
To run all of the tests, you'll also need all of the dependencies of the package. See the instructions below for options for how to install these dependencies.
The sourmashconsumr package has a lot of dependencies as it tries to make the outputs of the sourmash python package interoperable with biological computing packages already in the R ecosystem. You can install these dependencies however you like; they're all documented in the DESCRIPTION
file in the root of this repository. Below we describe different strategies for installing the dependencies.
The simplest way may be to install from github, which will trigger missing dependencies to be installed.
install.packages("devtools")
devtools::install_github("Arcadia-Science/sourmashconsumr")
Some of the package dependencies are available on Bioconductor (namely phyloseq), so if installation of dependencies fails through install_github
, you may have more success using BiocManager
:
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Arcadia-Science/sourmashconsumr")
If the above methods fail, conda can be used to install the dependencies.
ADD CONDA INSTALLATION INSTRUCTIONS, MAMBA, ENV YAML FILE, MAMBA ENV CREATE
You'll still need to install RStudio after creating the conda environment. Then, if you're using a mac computer, you can open the sourmashconsumr Rproject by running open sourmashconsumr.Rproj
from the activated environment you just created.
open sourmashconsumr.Rproj
library(devtools)
load_all()
Open the file you want to change and make changes.
The core package functionality is encoded in R scripts in the R
folder.
Each function has at least one unit test in the tests/testthat/
folder.
Run all tests
test()
Only run tests related to the active file
test_active_file()
devtools::build_rmd("vignettes/sourmashconsumr.Rmd")
check()
Pull requests
to be continued
Closed by #65
Brought up in #8