From a2f5b002768ad767b3f6be5f988a357e4983b8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Thu, 13 Nov 2025 00:39:38 +0100 Subject: [PATCH 1/4] Avoid removing all columns if all optional columns are present --- R/obo.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/obo.R b/R/obo.R index cd396b04..74ffff0e 100644 --- a/R/obo.R +++ b/R/obo.R @@ -130,7 +130,7 @@ getGAF <- function(x) { colnames(df) <- gsub("O_ID", "sets", colnames(df), fixed = TRUE) colnames(df) <- gsub("DB_Object_Symbol", "elements", colnames(df), fixed = TRUE) - + browser() TS <- tidySet(df) # Check that the columns really have information that allows them to be From 67cda6940593aeab2419e0819837c4c2fc962d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Thu, 13 Nov 2025 00:43:06 +0100 Subject: [PATCH 2/4] Redocument --- DESCRIPTION | 2 +- R/obo.R | 10 ++++++---- man/getGAF.Rd | 4 ++-- man/subtract.Rd | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d6426cb0..b903023a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -42,7 +42,7 @@ Config/testthat/edition: 3 Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Collate: 'validity.R' 'AllClasses.R' diff --git a/R/obo.R b/R/obo.R index 74ffff0e..37485fa4 100644 --- a/R/obo.R +++ b/R/obo.R @@ -83,8 +83,8 @@ getOBO <- function(x) { #' #' @references The format is defined [here]( #' https://geneontology.org/docs/go-annotation-file-gaf-format-2.1/). -#' @param x A file in GAF format -#' @return A TidySet object +#' @param x A file in GAF format. +#' @return A TidySet object. #' @export #' @family IO functions #' @importFrom utils read.delim @@ -114,7 +114,10 @@ getGAF <- function(x) { remove <- apply(df[, optional_columns], 2, function(x) { all(is.na(x)) }) - df <- df[, -optional_columns[remove]] + + if (any(remove)) { + df <- df[, -optional_columns[remove]] + } # Modify if they are GeneOntolgoy GO <- grepl("^GO:", df$O_ID) @@ -130,7 +133,6 @@ getGAF <- function(x) { colnames(df) <- gsub("O_ID", "sets", colnames(df), fixed = TRUE) colnames(df) <- gsub("DB_Object_Symbol", "elements", colnames(df), fixed = TRUE) - browser() TS <- tidySet(df) # Check that the columns really have information that allows them to be diff --git a/man/getGAF.Rd b/man/getGAF.Rd index cde7a839..8c143b95 100644 --- a/man/getGAF.Rd +++ b/man/getGAF.Rd @@ -7,10 +7,10 @@ getGAF(x) } \arguments{ -\item{x}{A file in GAF format} +\item{x}{A file in GAF format.} } \value{ -A TidySet object +A TidySet object. } \description{ Read a GO Annotation File (GAF) formatted file diff --git a/man/subtract.Rd b/man/subtract.Rd index 2c8c4d65..93d263a5 100644 --- a/man/subtract.Rd +++ b/man/subtract.Rd @@ -43,7 +43,7 @@ A \code{TidySet} object. } \description{ Elements in a set not present in the other set. Equivalent to -\code{\link[=setdiff]{setdiff()}}. +\code{\link[generics:setops]{generics::setdiff()}}. } \section{Methods (by class)}{ \itemize{ @@ -65,7 +65,7 @@ subtract(TS, "A", "B") subtract(TS, "A", "B", keep = FALSE) } \seealso{ -\code{\link[=setdiff]{setdiff()}} +\code{\link[generics:setops]{generics::setdiff()}} Other complements: \code{\link{complement}()}, From 097de3dbcf849c654c6e28f98cc24ec5327b8b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Thu, 13 Nov 2025 00:49:08 +0100 Subject: [PATCH 3/4] Update news --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4c4ce98b..d15ca799 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # BaseSet (development version) +* Fixed issue with `getGAF()` when all optional columns are present. + # BaseSet 1.0.0 * Now it is possible to list sets and elements that are not present in the relations but might be on the object via its factors: `name_sets()`, `name_elements()`, `nElements()` and `nSets()` gain a `all` argument. From 5c17fe90161197faa1b4d0a15bb41aab31606abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs?= Date: Sun, 16 Nov 2025 20:48:41 +0100 Subject: [PATCH 4/4] Fixes #75 --- .github/workflows/test-coverage.yaml | 7 ++++--- README.Rmd | 2 +- README.md | 3 ++- _pkgdown.yml | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index e050312f..0ab748d6 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -34,15 +34,16 @@ jobs: clean = FALSE, install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") ) + print(cov) covr::to_cobertura(cov) shell: Rscript {0} - - uses: codecov/codecov-action@v4 + - uses: codecov/codecov-action@v5 with: # Fail if error if not on PR, or if on PR and token is given fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} - file: ./cobertura.xml - plugin: noop + files: ./cobertura.xml + plugins: noop disable_search: true token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.Rmd b/README.Rmd index 4a568d73..f082cec2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,7 +16,7 @@ knitr::opts_chunk$set( ``` -[![R-CMD-check](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check) [![Codecov test coverage](https://codecov.io/gh/ropensci/BaseSet/graph/badge.svg)](https://app.codecov.io/gh/ropensci/BaseSet) [![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#maturing) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) diff --git a/README.md b/README.md index ce1497fe..7dd30911 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ + -[![R-CMD-check](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check.yaml) +[![R-CMD-check](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/BaseSet/actions/workflows/R-CMD-check) [![Codecov test coverage](https://codecov.io/gh/ropensci/BaseSet/graph/badge.svg)](https://app.codecov.io/gh/ropensci/BaseSet) [![Lifecycle: diff --git a/_pkgdown.yml b/_pkgdown.yml index 1294c7eb..4724fe1c 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -2,6 +2,7 @@ url: https://docs.ropensci.org/BaseSet template: package: rotemplate + bootstrap: 5 development: mode: auto