From 303e4aeef1b8da24b340a64992df8cf12da71a90 Mon Sep 17 00:00:00 2001 From: pcastellanoescuder Date: Thu, 7 Dec 2023 12:07:06 -0500 Subject: [PATCH] rename default branch to main and update actions 2 --- .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 49 +++++++++++++++++ .github/workflows/R-CMD-check.yml | 87 ------------------------------ .gitignore | 1 + DESCRIPTION | 2 +- NEWS.md | 3 +- R/PomaUnivariate.R | 8 +-- R/helpers.R | 13 ++--- README.Rmd | 5 +- README.md | 6 +-- 10 files changed, 68 insertions(+), 107 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/R-CMD-check.yml diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..91d7091 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +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 + diff --git a/.github/workflows/R-CMD-check.yml b/.github/workflows/R-CMD-check.yml deleted file mode 100644 index a2e5738..0000000 --- a/.github/workflows/R-CMD-check.yml +++ /dev/null @@ -1,87 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -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: windows-latest, r: 'release'} - - {os: macOS-latest, r: 'release'} - - {os: ubuntu-18.04, r: 'release'} - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@main - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@main - - - name: Query dependencies - run: | - install.packages(c('remotes')) - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}- - - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - Rscript -e "remotes::install_github('r-hub/sysreqs')" - sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))") - sudo -s eval "$sysreqs" - sudo apt-get update && apt-get install -y libglpk-dev libmagick++-dev libavfilter-dev libpoppler-cpp-dev - sudo su - -c "R -e \"install.packages('Rmpfr', repos = 'http://cran.rstudio.com/')\"" - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check - - - name: Test coverage - run: | - covr::codecov() - shell: Rscript {0} - diff --git a/.gitignore b/.gitignore index 908e451..d093c56 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ inst/doc Dockerfile pkgdown/ docs/ +.DS_Store \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index 850a355..c4c6781 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: POMA Title: Tools for Omics Data Analysis -Version: 1.8.50 +Version: 1.8.51 Authors@R: c(person(given = "Pol", family = "Castellano-Escuder", diff --git a/NEWS.md b/NEWS.md index ceb2420..043bfd1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# POMA 1.8.50 +# POMA 1.8.51 * New POMA theme and colorblind-friendly palette * Available sample normalization (sum and quantile) @@ -12,7 +12,6 @@ * Other new functions: `PomaLM`, `PomaLMM` * Post-hoc pairwise comparisons in `PomaUnivariate` * Update tests and vignettes -* Rename default GitHub branch from `master` to `main` # POMA 1.7.19 diff --git a/R/PomaUnivariate.R b/R/PomaUnivariate.R index 5822cb0..6646da0 100644 --- a/R/PomaUnivariate.R +++ b/R/PomaUnivariate.R @@ -137,7 +137,7 @@ PomaUnivariate <- function(data, # Post-hoc tests if (run_post_hoc) { post_hoc_tests <- list() - for (i in 1:nrow(SummarizedExperiment::assay(data))) { + for (i in seq_len(nrow(SummarizedExperiment::assay(data)))) { post_hoc_tests[[i]] <- dplyr::tibble(feature = rownames(SummarizedExperiment::assay(data))[i], broom::tidy(TukeyHSD(aov(to_univariate[,i] ~ group_factor)))[,c(2, 7)]) } @@ -160,7 +160,7 @@ PomaUnivariate <- function(data, covariates_feat <- as.data.frame(cbind(to_univariate, covariates)) result_cov <- vector(mode = "list", length = ncol(to_univariate)) - for(i in 1:ncol(to_univariate)) { + for(i in seq_len(ncol(to_univariate))) { result_cov[[i]] <- broom::tidy(anova(aov(as.formula(paste(colnames(covariates_feat)[i], "~", model_names)), data = covariates_feat))) %>% dplyr::filter(term != "Residuals") %>% @@ -182,7 +182,7 @@ PomaUnivariate <- function(data, # Post-hoc tests if (run_post_hoc) { post_hoc_tests <- list() - for (i in 1:nrow(SummarizedExperiment::assay(data))) { + for (i in seq_len(nrow(SummarizedExperiment::assay(data)))) { post_hoc_tests[[i]] <- dplyr::tibble(feature = rownames(SummarizedExperiment::assay(data))[i], as.data.frame(TukeyHSD( aov(as.formula(paste(colnames(covariates_feat)[1], "~", model_names)), @@ -238,7 +238,7 @@ PomaUnivariate <- function(data, # Post-hoc tests if (run_post_hoc) { post_hoc_tests <- list() - for (i in 1:nrow(SummarizedExperiment::assay(data))) { + for (i in seq_len(nrow(SummarizedExperiment::assay(data)))) { post_hoc_tests[[i]] <- dplyr::tibble(feature = rownames(SummarizedExperiment::assay(data))[i], FSA::dunnTest(to_univariate[,i] ~ group_factor, data = as.data.frame(to_univariate))$res diff --git a/R/helpers.R b/R/helpers.R index 1741238..3e1e3d6 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -1,8 +1,7 @@ help_extract <- function(fun, - section = "Description", - ...) { - x <- capture.output(tools:::Rd2txt(utils:::.getHelpFile(help(fun, ...)), options = list(sectionIndent = 0))) + section = "Description") { + x <- capture.output(tools::Rd2txt(utils:::.getHelpFile(help(fun, ...)), options = list(sectionIndent = 0))) B <- grep("^_", x) x <- gsub("_\b", "", x, fixed = TRUE) X <- rep(FALSE, length(x)) @@ -21,17 +20,15 @@ help_extract <- function(fun, return(out) } -title_extract <- function(fun, - ...) { - x <- capture.output(tools:::Rd2txt(utils:::.getHelpFile(help(fun, ...)), options = list(sectionIndent = 0))) +title_extract <- function(fun) { + x <- capture.output(tools::Rd2txt(utils:::.getHelpFile(help(fun, ...)), options = list(sectionIndent = 0))) x <- gsub("_\b", "", x, fixed = TRUE) title <- x[1] return(title) } make_legend <- function(fun, - html = FALSE, - ...) { + html = FALSE) { description <- help_extract(fun, package = POMA, section = "Description") title <- title_extract(fun, package = POMA) if (html) { diff --git a/README.Rmd b/README.Rmd index 55af8fd..6c05510 100644 --- a/README.Rmd +++ b/README.Rmd @@ -7,7 +7,8 @@ output: github_document [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) - [![Actions Status](https://github.com/pcastellanoescuder/POMA/workflows/R-CMD-check/badge.svg)](https://github.com/pcastellanoescuder/POMA/actions) + + [![R-CMD-check](https://github.com/pcastellanoescuder/POMA/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pcastellanoescuder/POMA/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/pcastellanoescuder/POMA/branch/master/graph/badge.svg)](https://codecov.io/gh/pcastellanoescuder/POMA?branch=master) [![CodeFactor](https://www.codefactor.io/repository/github/pcastellanoescuder/POMA/badge)](https://www.codefactor.io/repository/github/pcastellanoescuder/POMA) [![Last Commit](https://img.shields.io/github/last-commit/pcastellanoescuder/POMA.svg)](https://github.com/pcastellanoescuder/POMA/commits/master) @@ -16,7 +17,7 @@ output: github_document | _BioC_ branch | Status | Version | Dependencies | Rank | |- |- |- |- |- | | [Release](http://bioconductor.org/packages/release/bioc/html/POMA.html) | [![Bioc release status](https://bioconductor.org/shields/build/release/bioc/POMA.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/POMA/) | [![BioC released version](https://img.shields.io/badge/release%20version-1.6.0-blue.svg)](https://www.bioconductor.org/packages/POMA) | [![Dependencies](http://bioconductor.org/shields/dependencies/release/POMA.svg)](http://bioconductor.org/packages/release/bioc/html/POMA.html#since) | [![Rank](http://www.bioconductor.org/shields/downloads/release/POMA.svg)](https://bioconductor.org/packages/stats/bioc/POMA) | -| [Devel](http://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Bioc devel status](https://bioconductor.org/shields/build/devel/bioc/POMA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/POMA/) | [![BioC devel version](https://img.shields.io/badge/devel%20version-1.8.50-blue.svg)](https://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Dependencies](http://bioconductor.org/shields/dependencies/devel/POMA.svg)](http://bioconductor.org/packages/devel/bioc/html/POMA.html#since) | [![Rank](http://www.bioconductor.org/shields/downloads/devel/POMA.svg)](https://bioconductor.org/packages/stats/bioc/POMA) | +| [Devel](http://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Bioc devel status](https://bioconductor.org/shields/build/devel/bioc/POMA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/POMA/) | [![BioC devel version](https://img.shields.io/badge/devel%20version-1.8.51-blue.svg)](https://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Dependencies](http://bioconductor.org/shields/dependencies/devel/POMA.svg)](http://bioconductor.org/packages/devel/bioc/html/POMA.html#since) | [![Rank](http://www.bioconductor.org/shields/downloads/devel/POMA.svg)](https://bioconductor.org/packages/stats/bioc/POMA) | diff --git a/README.md b/README.md index e2d65d6..3501d2c 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) -[![Actions -Status](https://github.com/pcastellanoescuder/POMA/workflows/R-CMD-check/badge.svg)](https://github.com/pcastellanoescuder/POMA/actions) + +[![R-CMD-check](https://github.com/pcastellanoescuder/POMA/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pcastellanoescuder/POMA/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/pcastellanoescuder/POMA/branch/master/graph/badge.svg)](https://codecov.io/gh/pcastellanoescuder/POMA?branch=master) [![CodeFactor](https://www.codefactor.io/repository/github/pcastellanoescuder/POMA/badge)](https://www.codefactor.io/repository/github/pcastellanoescuder/POMA) @@ -18,7 +18,7 @@ v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/li | *BioC* branch | Status | Version | Dependencies | Rank | |-------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------| | [Release](http://bioconductor.org/packages/release/bioc/html/POMA.html) | [![Bioc release status](https://bioconductor.org/shields/build/release/bioc/POMA.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/POMA/) | [![BioC released version](https://img.shields.io/badge/release%20version-1.6.0-blue.svg)](https://www.bioconductor.org/packages/POMA) | [![Dependencies](http://bioconductor.org/shields/dependencies/release/POMA.svg)](http://bioconductor.org/packages/release/bioc/html/POMA.html#since) | [![Rank](http://www.bioconductor.org/shields/downloads/release/POMA.svg)](https://bioconductor.org/packages/stats/bioc/POMA) | -| [Devel](http://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Bioc devel status](https://bioconductor.org/shields/build/devel/bioc/POMA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/POMA/) | [![BioC devel version](https://img.shields.io/badge/devel%20version-1.8.50-blue.svg)](https://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Dependencies](http://bioconductor.org/shields/dependencies/devel/POMA.svg)](http://bioconductor.org/packages/devel/bioc/html/POMA.html#since) | [![Rank](http://www.bioconductor.org/shields/downloads/devel/POMA.svg)](https://bioconductor.org/packages/stats/bioc/POMA) | +| [Devel](http://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Bioc devel status](https://bioconductor.org/shields/build/devel/bioc/POMA.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/POMA/) | [![BioC devel version](https://img.shields.io/badge/devel%20version-1.8.51-blue.svg)](https://bioconductor.org/packages/devel/bioc/html/POMA.html) | [![Dependencies](http://bioconductor.org/shields/dependencies/devel/POMA.svg)](http://bioconductor.org/packages/devel/bioc/html/POMA.html#since) | [![Rank](http://www.bioconductor.org/shields/downloads/devel/POMA.svg)](https://bioconductor.org/packages/stats/bioc/POMA) |