From 540c32df320891ec84c55c27ffab39b08c804af2 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Sat, 3 Feb 2024 13:16:13 +0800 Subject: [PATCH 1/5] Update tic.yml --- .github/workflows/tic.yml | 27 +++++++++++++++++---------- .github/workflows/update-tic.yml | 2 +- DESCRIPTION | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tic.yml b/.github/workflows/tic.yml index af1483fa..247b2320 100644 --- a/.github/workflows/tic.yml +++ b/.github/workflows/tic.yml @@ -1,5 +1,5 @@ ## tic GitHub Actions template: linux-macos-windows-deploy -## revision date: 2023-05-22 +## revision date: 2023-12-15 on: workflow_dispatch: push: @@ -46,7 +46,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-r@v2 with: @@ -58,6 +58,10 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 + - name: Install sys deps for Ubuntu + if: runner.os == 'Linux' + run: sudo apt update && sudo apt install -y libgit2-dev libcurl4-openssl-dev + # set date/week for use in cache creation # https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970 # - cache R packages daily @@ -66,19 +70,22 @@ jobs: id: date run: echo "date=$(date '+%d-%m')" >> $GITHUB_OUTPUT - - name: "[Cache] Cache R packages" + - name: "[Cache] Restore R package cache" if: runner.os != 'Windows' - uses: pat-s/always-upload-cache@v3 + uses: actions/cache/restore@v3 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} - - - name: "[Stage] Install pak" - run: Rscript -e "install.packages('pak', repos = 'https://r-lib.github.io/p/pak/stable')" - name: "[Stage] Install" - run: Rscript -e "if (grepl('Ubuntu', Sys.info()[['version']]) && !grepl('Under development', R.version[['status']])) {options(repos = c(CRAN = sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))))}else{options(repos = c(CRAN = 'cloud.r-project.org'))}; pak::pkg_install('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + run: Rscript -e "install.packages('tic', repos = c('https://ropensci.r-universe.dev', if (grepl('Ubuntu', Sys.info()[['version']])) {sprintf('https://packagemanager.rstudio.com/all/__linux__/%s/latest', system('lsb_release -cs', intern = TRUE))} else {'https://cloud.r-project.org'}))" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()" + + - name: "[Cache] Save R package cache" + if: runner.os != 'Windows' && always() + uses: actions/cache/save@v3 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}} - name: "[Stage] Script" run: Rscript -e 'tic::script()' @@ -88,7 +95,7 @@ jobs: - name: "[Stage] Upload R CMD check artifacts" if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ runner.os }}-r${{ matrix.config.r }}-results path: check diff --git a/.github/workflows/update-tic.yml b/.github/workflows/update-tic.yml index 7a7e4da6..e04bc1c4 100644 --- a/.github/workflows/update-tic.yml +++ b/.github/workflows/update-tic.yml @@ -23,7 +23,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false diff --git a/DESCRIPTION b/DESCRIPTION index 6b2674b4..9223c3ea 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -62,7 +62,7 @@ Suggests: vdiffr, roxyglobals VignetteBuilder: knitr -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd", "roxyglobals::global_roclet")) Language: en-US From 19a449cf168e67f691ab116a92da628c65620c8b Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Thu, 16 May 2024 10:55:02 +0800 Subject: [PATCH 2/5] Reformat DESCRIPTION --- DESCRIPTION | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ade57f49..105d9b21 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -43,17 +43,18 @@ Suggests: knitr, rmarkdown, roxyglobals, + roxyglobals, testthat, - vegan, vdiffr, - roxyglobals -VignetteBuilder: knitr -RoxygenNote: 7.3.1 + vegan +VignetteBuilder: + knitr +Encoding: UTF-8 +Language: en-US Roxygen: list(markdown = TRUE, roclets = c("collate", "namespace", "rd", "roxyglobals::global_roclet")) -Language: en-US -URL: https://github.com/openplantpathology/hagis, https://openplantpathology.github.io/hagis/ -BugReports: https://github.com/openplantpathology/hagis/issues +RoxygenNote: 7.3.1 X-schema.org-applicationCategory: Tools -X-schema.org-keywords: plant-pathology, pathotype, pathogen-survey, virulence analysis, differential set, assessment scale X-schema.org-isPartOf: https://openplantpathology.org +X-schema.org-keywords: plant-pathology, pathotype, pathogen-survey, + virulence analysis, differential set, assessment scale From 5a185808de09923e6096081c0522a662e1b20a9a Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Thu, 16 May 2024 10:56:14 +0800 Subject: [PATCH 3/5] Add Jari to authors' list --- DESCRIPTION | 4 +++- codemeta.json | 26 ++++++++++++++++++++++---- man/hagis-package.Rd | 1 + 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 105d9b21..ae4fb8d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: hagis Title: Analysis of Plant Pathogen Pathotype Complexities, Distributions and Diversity -Version: 3.1.11.9000 +Version: 3.1.12 Authors@R: c( person("Austin G.", "McCoy", , "mccoyaus@msu.edu", role = c("aut", "ccp"), comment = c(ORCID = "0000-0003-2483-4184")), @@ -11,6 +11,8 @@ Authors@R: c( comment = c(ORCID = "0000-0002-0061-8359")), person("Martin", "Chilvers", , "chilvers@msu.edu", role = c("aut", "ths"), comment = c(ORCID = "0000-0001-8832-1666")), + person("Jari", "Oksanen", , "jhoksane@gmail.com", role = "aut", + comment = "Contributed patch to update betadiversity vignette and fixed bug therein as well."), person("Zhian N.", "Kamvar", role = c("ctb", "rev"), comment = c(ORCID = "0000-0003-1458-7108")), person("Michigan Soybean Promotion Committee", role = "fnd"), diff --git a/codemeta.json b/codemeta.json index b5780141..48bfc922 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/openplantpathology/hagis", "issueTracker": "https://github.com/openplantpathology/hagis/issues", "license": "https://spdx.org/licenses/MIT", - "version": "3.1.11.9000", + "version": "3.1.12", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -49,6 +49,12 @@ "familyName": "Chilvers", "email": "chilvers@msu.edu", "@id": "https://orcid.org/0000-0001-8832-1666" + }, + { + "@type": "Person", + "givenName": "Jari", + "familyName": "Oksanen", + "email": "jhoksane@gmail.com" } ], "contributor": [ @@ -154,6 +160,18 @@ }, "sameAs": "https://CRAN.R-project.org/package=roxyglobals" }, + { + "@type": "SoftwareApplication", + "identifier": "roxyglobals", + "name": "roxyglobals", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=roxyglobals" + }, { "@type": "SoftwareApplication", "identifier": "testthat", @@ -249,7 +267,7 @@ "applicationCategory": "Tools", "isPartOf": "https://openplantpathology.org", "keywords": ["plant-pathology", "pathotype", "pathogen-survey", "virulenceanalysis", "differentialset", "assessmentscale", "plant-disease", "pathotype-complexities", "population-diversities"], - "fileSize": "294.779KB", + "fileSize": "295.986KB", "citation": [ { "@type": "ScholarlyArticle", @@ -320,13 +338,13 @@ "name": "{hagis}: Analysis of Plant Pathogen Pathotype Complexities, Distributions and Diversity", "identifier": "10.5281/zenodo.2619820", "url": "https://openplantpathology.github.io/hagis/", - "description": "R package version 3.1.11.9000", + "description": "R package version 3.1.12", "@id": "https://doi.org/10.5281/zenodo.2619820", "sameAs": "https://doi.org/10.5281/zenodo.2619820" } ], "releaseNotes": "https://github.com/openplantpathology/hagis/blob/master/NEWS.md", "readme": "https://github.com/openplantpathology/hagis/blob/main/README.md", - "contIntegration": ["https://app.codecov.io/gh/openplantpathology/hagis", "https://github.com/openplantpathology/hagis/actions/workflows/test-coverage.yaml"], + "contIntegration": ["https://codecov.io/gh/openplantpathology/hagis", "https://github.com/openplantpathology/hagis/actions/workflows/test-coverage.yaml"], "developmentStatus": "https://www.repostatus.org/#active" } diff --git a/man/hagis-package.Rd b/man/hagis-package.Rd index 2925eea9..1af20e48 100644 --- a/man/hagis-package.Rd +++ b/man/hagis-package.Rd @@ -25,6 +25,7 @@ Authors: \item Austin G. McCoy \email{mccoyaus@msu.edu} (\href{https://orcid.org/0000-0003-2483-4184}{ORCID}) [conceptor] \item Zachary Noel \email{noelzach@msu.edu} (\href{https://orcid.org/0000-0001-6375-8300}{ORCID}) [conceptor] \item Martin Chilvers \email{chilvers@msu.edu} (\href{https://orcid.org/0000-0001-8832-1666}{ORCID}) [thesis advisor] + \item Jari Oksanen \email{jhoksane@gmail.com} (Contributed patch to update betadiversity vignette and fixed bug therein as well.) } Other contributors: From 7c034851460edb48bcb977fc0dc90f7fd5446b13 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Thu, 16 May 2024 10:57:54 +0800 Subject: [PATCH 4/5] Set up rhub workflow --- .github/workflows/rhub.yaml | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/rhub.yaml diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 00000000..74ec7b05 --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,95 @@ +# R-hub's generic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub +run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + name: + description: 'Run name. You can leave this empty now.' + type: string + id: + description: 'Unique ID. You can leave this empty now.' + type: string + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/actions/setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/run-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/run-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} From 0d513e288330532adbd843ca3b5f5b952c9e1613 Mon Sep 17 00:00:00 2001 From: "Adam H. Sparks" Date: Thu, 16 May 2024 11:05:28 +0800 Subject: [PATCH 5/5] Format code chunks --- vignettes/betadiversity.Rmd | 3 +-- vignettes/hagis.Rmd | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/vignettes/betadiversity.Rmd b/vignettes/betadiversity.Rmd index 894f6ba0..2801cd5e 100644 --- a/vignettes/betadiversity.Rmd +++ b/vignettes/betadiversity.Rmd @@ -166,8 +166,7 @@ ggplot(data = princoor.pathotype.data, aes(x = X, y = Y)) + legend.text = element_text(face = "bold", size = 10), legend.key.size = unit(1, 'lines') ) + - stat_ellipse(data = princoor.pathotype.data, aes(x = X, y = Y), - level = 0.95) + + stat_ellipse(data = princoor.pathotype.data, aes(x = X, y = Y), level = 0.95) + ggtitle("Pathotype Jaccard Distances PCOA") ``` diff --git a/vignettes/hagis.Rmd b/vignettes/hagis.Rmd index 6b68e2fd..ac8f588f 100644 --- a/vignettes/hagis.Rmd +++ b/vignettes/hagis.Rmd @@ -31,7 +31,7 @@ library("hagis") head(P_sojae_survey) ``` -We see in the `gene` column that each gene is prepended with "Rps". +We see in the `gene` column that each gene is pre-pended with "Rps". We can remove this to make the graphs cleaner and report the genes in tables as we would in a manuscript. Note that this will work for any string you enter as the first value, `pattern`. The second string, `replacement`, is the replacement value, the third, `x`, is where to look and make the changes. @@ -266,8 +266,7 @@ Set the font to be a bold-face serif family font. ```{r change-plot-font} Rps.plot <- Rps.plot + - theme(text = element_text(face = "bold", - family = "serif")) + theme(text = element_text(face = "bold", family = "serif")) Rps.plot ``` @@ -289,12 +288,9 @@ You can use named, *e.g.*, "red", "yellow", "blue", colors in R or you can use c Illustrated below is using Michigan State University (MSU) Green, hex code #18453b, using `theme_bw()` with a serif font. ```{r use-Colors} -autoplot(Rps.summary, - type = "percentage", - color = "#18453b") + +autoplot(Rps.summary, type = "percentage", color = "#18453b") + theme_bw() + - theme(text = element_text(face = "bold", - family = "serif")) + theme(text = element_text(face = "bold", family = "serif")) ``` ### Sorting the x-axis @@ -302,11 +298,12 @@ autoplot(Rps.summary, You can sort the x-axis of any graph produced using `autoplot()` in an `ascending` or `descending` order using the `order` parameter in `autoplot()`. ```{r sort-axis} -autoplot(Rps.summary, - type = "percentage", - color = "#18453b", - order = "ascending") + +autoplot( + Rps.summary, + type = "percentage", + color = "#18453b", + order = "ascending" +) + theme_bw() + - theme(text = element_text(face = "bold", - family = "serif")) + theme(text = element_text(face = "bold", family = "serif")) ```