From 461a85d8197c85426c45ba2b8d5c16546198fd1c Mon Sep 17 00:00:00 2001 From: Cristianetaniguti Date: Tue, 16 Jul 2024 09:15:47 -0400 Subject: [PATCH 1/2] add auto tests --- .github/workflows/R-CMD-check.yaml | 49 ++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .gitignore diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..48ed03f --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, auto_tests] + pull_request: + branches: [main, auto_tests] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a48538 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_store \ No newline at end of file From b4e433d1009a9d8d1f127a548eb00a81cd65a455 Mon Sep 17 00:00:00 2001 From: Cristianetaniguti Date: Tue, 16 Jul 2024 09:44:10 -0400 Subject: [PATCH 2/2] some adjustments --- .Rbuildignore | 4 ++++ .gitignore | 4 +++- DESCRIPTION | 10 ++++++---- R/clean_ebvs.R | 8 ++++---- R/run_renum.R | 12 +++++++----- man/clean_ebvs.Rd | 6 +++--- man/run_renum.Rd | 8 +++++--- 7 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 .Rbuildignore diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..664987a --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,4 @@ +^.*\.Rproj$ +^\.Rproj\.user$ +.github +BIGf90_0.3.0.pdf \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4a48538..3394485 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.DS_store \ No newline at end of file +.DS_store +.Rproj.user +BIGf90.Rproj \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 0e6842f..f870c69 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,18 +1,20 @@ Package: BIGf90 Title: R face front for running K-fold crossvalidation, estimating ebvs and variance component estimation with Blupf90 modules Version: 0.3.0 -Authors: Josue Chinchilla-Vargas, Alexander M. Sandercock and Breeding Insight Team -Maintainer:Josue Chinchilla-Vargas +Authors@R: c(person("Josue", "Chinchilla-Vargas", role = c("aut", "cre"), email = "jc3635@cornell.edu"), + person("Alexander", "Sandercock", role = "aut"), + person("Breeding Insight Team", role = "ctb")) +Maintainer: Josue Chinchilla-Vargas Description: This package provides R functions to run several BLUPf90 modules. Along with an R function to run K-fold crossvalidation for univariate analyses through blupf90+. The output table from the K-fold crossvalidation function calculates accuracy as cor(y,ebv^) and cor(y*,ebv^) along with bias of ebvs calculated as reg(y,ebv.) You will need to create the .par file to feed into Renumf90 manually. Once this is done, there are functions to run Renumf90, Blupf90+, Predictf90, Gibbsf90+ and Postgibbsf90. If you need to learn how to use the blupf90 suite of programs refer to nce.ads.uga.edu/wiki/doku.php?id=start. Please remember to cite Blupf90 appropriately along with this package when used for publications. To run the functions in this package you will need to have a directory with all the blupf90 executables so that you can indicate the path for R to find the execs. As of version 0.3.0, all functions have been tested in PC and Unix environments, we have noticed that PC environments tend to have issues about permissions, so it is advised to run RStudio as administrator when planning to use this package. -License: Apache 2.0 +License: Apache License (== 2.0) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Imports: base (>= 4.3.1), dplyr (>= 1.1.4), diff --git a/R/clean_ebvs.R b/R/clean_ebvs.R index 38febd9..838eb35 100644 --- a/R/clean_ebvs.R +++ b/R/clean_ebvs.R @@ -10,11 +10,11 @@ #' @return a tab-separated file that includes the original id and ebv for all individuals for which an EBV was produced. #' @import dplyr #' @examples -#' ## Example -#' -#'clean_ebvs(3, -#'"my_clean_ebvs") #' +#' \donttest{ +#' #clean_ebvs(3, "my_clean_ebvs") +#' } +#' #' @export clean_ebvs <- function(random_effect_col, solutions_output_name) { diff --git a/R/run_renum.R b/R/run_renum.R index 9c229ea..041b0ab 100644 --- a/R/run_renum.R +++ b/R/run_renum.R @@ -8,11 +8,13 @@ #' @param path_2_execs path to a folder that holds the renumf90 executable. This field should be in quotes "". #' @param raw_par_file name of the .par file that will be processed. This field should be in quotes "". #' @examples -#' ## Example -#' -#' # run_renum(path_2_execs = "/Users/johndoe/Desktop/bf90_execs/", -#' raw_par_file = "weight_2022_no_cov_cv.par") -#' +#' +#' \donttest{ +#' #run_renum(path_2_execs = "path/bf90_execs/", +#' #raw_par_file = "weight_2022_no_cov_cv.par") +#' } +#' +#' #' @export run_renum <- function(path_2_execs, raw_par_file) { diff --git a/man/clean_ebvs.Rd b/man/clean_ebvs.Rd index 256544e..e714ae9 100644 --- a/man/clean_ebvs.Rd +++ b/man/clean_ebvs.Rd @@ -22,9 +22,9 @@ This function cleans and formats the raw solutions file produced by blupf90+ by I also matches the processed ID assigned by renumf90 to the original ID for each individual tested producing a interpretable output file with two columns: ID and EBV. } \examples{ -## Example -clean_ebvs(3, -"my_clean_ebvs") +\donttest{ + #clean_ebvs(3, "my_clean_ebvs") +} } diff --git a/man/run_renum.Rd b/man/run_renum.Rd index 13e50d6..551d7d1 100644 --- a/man/run_renum.Rd +++ b/man/run_renum.Rd @@ -19,9 +19,11 @@ This function runs renumf90 to process the raw parameter(.par) file to be used w The outputs will be the standard output files produced by renumf90. A log file called run_renum.log is also produced. } \examples{ -## Example -# run_renum(path_2_execs = "/Users/johndoe/Desktop/bf90_execs/", - raw_par_file = "weight_2022_no_cov_cv.par") +\donttest{ + #run_renum(path_2_execs = "path/bf90_execs/", + #raw_par_file = "weight_2022_no_cov_cv.par") +} + }