From 0a488a4ca8fc7a3668ccfec4088c08c341b3b3a9 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 10 Jul 2026 14:57:51 +0200 Subject: [PATCH 01/10] Add GitHub Actions workflow for Bioconductor checks --- .github/workflows/check-bioc.yml | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/check-bioc.yml diff --git a/.github/workflows/check-bioc.yml b/.github/workflows/check-bioc.yml new file mode 100644 index 0000000..b1cc4bf --- /dev/null +++ b/.github/workflows/check-bioc.yml @@ -0,0 +1,52 @@ +on: + push: + branches: + - main + - devel + pull_request: + +name: R-CMD-check-bioc + +jobs: + check: + runs-on: ubuntu-latest + container: ${{ matrix.config.image }} + + name: ${{ matrix.config.bioc }} + + strategy: + fail-fast: false + matrix: + config: + - { bioc: 'release', image: 'bioconductor/bioconductor_docker:RELEASE_3_23' } + - { bioc: 'devel', image: 'bioconductor/bioconductor_docker:devel' } + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + NOT_CRAN: true + + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::BiocCheck, any::rcmdcheck + needs: check + cache: true + + - name: R CMD CHECK + uses: r-lib/actions/check-r-package@v2 + with: + args: 'c("--no-manual", "--no-vignettes", "--timings")' + error-on: '"error"' + + - name: BiocCheck + shell: Rscript {0} + run: | + BiocCheck::BiocCheck( + package = ".", + `new-package` = FALSE, + `no-check-bioc-help` = TRUE + ) From 7cd507de0bee16951e19a2c3a150c97ec945da97 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 10 Jul 2026 15:12:30 +0200 Subject: [PATCH 02/10] Use centralized check-bioc GHA workflow --- .github/workflows/check-bioc.yml | 49 ++++---------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/.github/workflows/check-bioc.yml b/.github/workflows/check-bioc.yml index b1cc4bf..8eca8c2 100644 --- a/.github/workflows/check-bioc.yml +++ b/.github/workflows/check-bioc.yml @@ -1,52 +1,13 @@ +name: R-CMD-check-bioc + on: push: branches: - main + - master - devel pull_request: -name: R-CMD-check-bioc - jobs: - check: - runs-on: ubuntu-latest - container: ${{ matrix.config.image }} - - name: ${{ matrix.config.bioc }} - - strategy: - fail-fast: false - matrix: - config: - - { bioc: 'release', image: 'bioconductor/bioconductor_docker:RELEASE_3_23' } - - { bioc: 'devel', image: 'bioconductor/bioconductor_docker:devel' } - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - NOT_CRAN: true - - steps: - - uses: actions/checkout@v4 - - - name: Install dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::BiocCheck, any::rcmdcheck - needs: check - cache: true - - - name: R CMD CHECK - uses: r-lib/actions/check-r-package@v2 - with: - args: 'c("--no-manual", "--no-vignettes", "--timings")' - error-on: '"error"' - - - name: BiocCheck - shell: Rscript {0} - run: | - BiocCheck::BiocCheck( - package = ".", - `new-package` = FALSE, - `no-check-bioc-help` = TRUE - ) + run-check: + uses: bioc-package-rescue/workflows/.github/workflows/check-bioc.yml@main From f8d92c23f1953d137e1ea97b276d5551c1d7a326 Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 17:02:21 +0200 Subject: [PATCH 03/10] Fix example graph.incidence coercion failure in RcisTarget - Coerce subselected data frame to a matrix - Skip the rankAtMax metadata column in the incidence matrix - Use graph_from_biadjacency_matrix instead of deprecated graph.incidence Co-authored-by: Antigravity --- inst/examples/example_addSignificantGenes.R | 6 +++--- man/addSignificantGenes.Rd | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/inst/examples/example_addSignificantGenes.R b/inst/examples/example_addSignificantGenes.R index 0ed27f5..9c6d584 100755 --- a/inst/examples/example_addSignificantGenes.R +++ b/inst/examples/example_addSignificantGenes.R @@ -61,16 +61,16 @@ motifEnr_wIncidMat <- addSignificantGenes(motifEnrichmentTable, genesFormat = "incidMatrix") motifEnr_wIncidMat <- as.data.frame(motifEnr_wIncidMat) -which(colnames(motifEnr_wIncidMat) == "rankAtMax") +rankAtMaxIdx <- which(colnames(motifEnr_wIncidMat) == "rankAtMax") -incidMat <- motifEnr_wIncidMat[,8:ncol(motifEnr_wIncidMat)] +incidMat <- as.matrix(motifEnr_wIncidMat[, (rankAtMaxIdx + 1):ncol(motifEnr_wIncidMat)]) rownames(incidMat) <- motifEnr_wIncidMat[,"motif"] incidMat <- incidMat[, colSums(incidMat)>0, drop=FALSE] # Plot as network par(mfrow=c(1,1)) library(igraph) -plot(graph.incidence(incidMat)) +plot(graph_from_biadjacency_matrix(incidMat)) ############################################################### # Alternative method: getSignificantGenes() diff --git a/man/addSignificantGenes.Rd b/man/addSignificantGenes.Rd index efebbbe..ed9ca04 100755 --- a/man/addSignificantGenes.Rd +++ b/man/addSignificantGenes.Rd @@ -302,16 +302,16 @@ motifEnr_wIncidMat <- addSignificantGenes(motifEnrichmentTable, genesFormat = "incidMatrix") motifEnr_wIncidMat <- as.data.frame(motifEnr_wIncidMat) -which(colnames(motifEnr_wIncidMat) == "rankAtMax") +rankAtMaxIdx <- which(colnames(motifEnr_wIncidMat) == "rankAtMax") -incidMat <- motifEnr_wIncidMat[,8:ncol(motifEnr_wIncidMat)] +incidMat <- as.matrix(motifEnr_wIncidMat[, (rankAtMaxIdx + 1):ncol(motifEnr_wIncidMat)]) rownames(incidMat) <- motifEnr_wIncidMat[,"motif"] incidMat <- incidMat[, colSums(incidMat)>0, drop=FALSE] # Plot as network par(mfrow=c(1,1)) library(igraph) -plot(graph.incidence(incidMat)) +plot(graph_from_biadjacency_matrix(incidMat)) ############################################################### # Alternative method: getSignificantGenes() From 79155b2cd7e49cd1d371cba462ce477610b05ea6 Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 17:15:58 +0200 Subject: [PATCH 04/10] Address Copilot PR review feedback - Use match() and explicit NA check instead of which() for robustness - Use graph_from_incidence_matrix() instead of graph_from_biadjacency_matrix() Co-authored-by: Antigravity --- inst/examples/example_addSignificantGenes.R | 5 +++-- man/addSignificantGenes.Rd | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/inst/examples/example_addSignificantGenes.R b/inst/examples/example_addSignificantGenes.R index 9c6d584..932ecd0 100755 --- a/inst/examples/example_addSignificantGenes.R +++ b/inst/examples/example_addSignificantGenes.R @@ -61,7 +61,8 @@ motifEnr_wIncidMat <- addSignificantGenes(motifEnrichmentTable, genesFormat = "incidMatrix") motifEnr_wIncidMat <- as.data.frame(motifEnr_wIncidMat) -rankAtMaxIdx <- which(colnames(motifEnr_wIncidMat) == "rankAtMax") +rankAtMaxIdx <- match("rankAtMax", colnames(motifEnr_wIncidMat)) +if(is.na(rankAtMaxIdx)) stop("Column 'rankAtMax' not found in results.") incidMat <- as.matrix(motifEnr_wIncidMat[, (rankAtMaxIdx + 1):ncol(motifEnr_wIncidMat)]) rownames(incidMat) <- motifEnr_wIncidMat[,"motif"] @@ -70,7 +71,7 @@ incidMat <- incidMat[, colSums(incidMat)>0, drop=FALSE] # Plot as network par(mfrow=c(1,1)) library(igraph) -plot(graph_from_biadjacency_matrix(incidMat)) +plot(graph_from_incidence_matrix(incidMat)) ############################################################### # Alternative method: getSignificantGenes() diff --git a/man/addSignificantGenes.Rd b/man/addSignificantGenes.Rd index ed9ca04..f7b6652 100755 --- a/man/addSignificantGenes.Rd +++ b/man/addSignificantGenes.Rd @@ -302,7 +302,8 @@ motifEnr_wIncidMat <- addSignificantGenes(motifEnrichmentTable, genesFormat = "incidMatrix") motifEnr_wIncidMat <- as.data.frame(motifEnr_wIncidMat) -rankAtMaxIdx <- which(colnames(motifEnr_wIncidMat) == "rankAtMax") +rankAtMaxIdx <- match("rankAtMax", colnames(motifEnr_wIncidMat)) +if(is.na(rankAtMaxIdx)) stop("Column 'rankAtMax' not found in results.") incidMat <- as.matrix(motifEnr_wIncidMat[, (rankAtMaxIdx + 1):ncol(motifEnr_wIncidMat)]) rownames(incidMat) <- motifEnr_wIncidMat[,"motif"] @@ -311,7 +312,7 @@ incidMat <- incidMat[, colSums(incidMat)>0, drop=FALSE] # Plot as network par(mfrow=c(1,1)) library(igraph) -plot(graph_from_biadjacency_matrix(incidMat)) +plot(graph_from_incidence_matrix(incidMat)) ############################################################### # Alternative method: getSignificantGenes() From 91abbf5d11f461340cd82baf49411b2376ba61fd Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 18:00:20 +0200 Subject: [PATCH 05/10] Fix BiocCheck errors and warnings in RcisTarget - Use Authors@R instead of deprecated Author/Maintainer fields in DESCRIPTION - Replace single-letter logical variables T/F with TRUE/FALSE Co-authored-by: Antigravity --- DESCRIPTION | 9 ++++++--- R/02_addMotifAnnotation.R | 2 +- R/aux_addLogo.R | 4 ++-- R/priv_calcErn.R | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 62c149b..99cd1ad 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,9 +4,12 @@ Title: RcisTarget Identify transcription factor binding motifs enriched on a list of genes or genomic regions Version: 1.23.1 Date: 2024-03-02 -Author: Sara Aibar, Gert Hulselmans, Stein Aerts. Laboratory of Computational Biology. - VIB-KU Leuven Center for Brain & Disease Research. Leuven, Belgium -Maintainer: Gert Hulselmans +Authors@R: c( + person("Sara", "Aibar", role = "aut"), + person("Gert", "Hulselmans", email = "Gert.Hulselmans@kuleuven.be", role = c("aut", "cre")), + person("Stein", "Aerts", role = "aut"), + person("Laboratory of Computational Biology. VIB-KU Leuven Center for Brain & Disease Research. Leuven, Belgium", role = "cph") + ) Description: RcisTarget identifies transcription factor binding motifs (TFBS) over-represented on a gene list. In a first step, RcisTarget selects DNA motifs that are significantly diff --git a/R/02_addMotifAnnotation.R b/R/02_addMotifAnnotation.R index b8e5fdb..246a6ce 100755 --- a/R/02_addMotifAnnotation.R +++ b/R/02_addMotifAnnotation.R @@ -186,7 +186,7 @@ addMotifAnnotation <- function(auc, nesThreshold=3.0, digits=3, if(!is.null(motifAnnot)) { motifAnnot_subset <- motifAnnot[(motifAnnot[[idColumn]] %in% aucTable[[idColumn]]) - & (motifAnnot$TF %in% TFs), ][,c(idColumn, "TF", "annotationSource"),with=F] + & (motifAnnot$TF %in% TFs), ][,c(idColumn, "TF", "annotationSource"),with=FALSE] motifAnnot_subset <- split(motifAnnot_subset, motifAnnot_subset[[idColumn]]) for(motifName in names(motifAnnot_subset)) { diff --git a/R/aux_addLogo.R b/R/aux_addLogo.R index 9b86327..6aca62d 100755 --- a/R/aux_addLogo.R +++ b/R/aux_addLogo.R @@ -94,7 +94,7 @@ showLogo <- function(motifEnrDT, stop("Please indicate the column containing the motif id (argument 'motifCol') or set it to NULL.") } # TODO - met <- met[grep("transfac_pro__", met[[motifCol]], invert = T),] + met <- met[grep("transfac_pro__", met[[motifCol]], invert = TRUE),] } # For numeric columns, show only the number of significant digits... @@ -106,7 +106,7 @@ showLogo <- function(motifEnrDT, if(!is.null(colsToShow)) { colsToShow <- unique(unname(unlist(colsToShow))) colsToShow <- colsToShow[which(colsToShow %in% colnames(met))] - met <- met[, colsToShow, with=F] + met <- met[, colsToShow, with=FALSE] } # Show... diff --git a/R/priv_calcErn.R b/R/priv_calcErn.R index af5d455..1b70210 100755 --- a/R/priv_calcErn.R +++ b/R/priv_calcErn.R @@ -44,7 +44,7 @@ maxRankExtra <- maxRank+nMean gsRankings.asMat <- as.matrix(gsRankings) # Much faster! gsRankings.asMat[gsRankings.asMat>maxRankExtra] <- NA - globalMat <- matrix(0, nrow=max(nrow(gsRankings),max(gsRankings.asMat, na.rm=T)), ncol=maxRankExtra) # nrow=nrow(gsRankings): can be out of range, add extra rows and subset at the end + globalMat <- matrix(0, nrow=max(nrow(gsRankings),max(gsRankings.asMat, na.rm=TRUE)), ncol=maxRankExtra) # nrow=nrow(gsRankings): can be out of range, add extra rows and subset at the end # x <- x[seq_len(min(length(x), nrow(globalMat)))] # or: # if(nrow(globalMat) < length(x)) x <- x[seq_len(nrow(globalMat))] # cannot be in the loop... too slow! for(i in 1:nrow(gsRankings)) # (TO DO: Paralellize?) From 917eecb638468997e33259e022892d2c22ede6b8 Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 18:16:36 +0200 Subject: [PATCH 06/10] Add runnable examples to document exported functions and fix warnings Co-authored-by: Antigravity --- R/aux_convertToTargetRegions.R | 12 +++++++----- R/aux_getDbRegionsLoc.R | 22 ++++++++++++++++++---- inst/examples/example_workflow.R | 14 ++++++-------- man/calcAUC.Rd | 9 +++------ man/convertToTargetRegions.Rd | 12 +++++++----- man/getDbRegionsLoc.Rd | 22 ++++++++++++++++++---- 6 files changed, 59 insertions(+), 32 deletions(-) diff --git a/R/aux_convertToTargetRegions.R b/R/aux_convertToTargetRegions.R index bccd95a..9156252 100644 --- a/R/aux_convertToTargetRegions.R +++ b/R/aux_convertToTargetRegions.R @@ -14,11 +14,13 @@ #' \code{vignette("RcisTarget")} #' #' @examples -#' \dontrun{ -#' ## To apply on a list of regionSets: -#' regionSets_db <- lapply(regionSets, function(x) -#' convertToTargetRegions(queryRegions=x, targetRegions=dbRegionsLoc)) -#' } +#' # Create mock query and target regions +#' library(GenomicRanges) +#' queryRegions <- GRanges("chr1", IRanges(start = c(10, 100), end = c(50, 150))) +#' targetRegions <- GRanges("chr1", IRanges(start = c(5, 80, 200), end = c(45, 120, 250))) +#' +#' # Convert query regions to target regions +#' convertToTargetRegions(queryRegions = queryRegions, targetRegions = targetRegions) #' @rdname convertToTargetRegions #' @importFrom methods isClass #' @importFrom GenomeInfoDb keepSeqlevels diff --git a/R/aux_getDbRegionsLoc.R b/R/aux_getDbRegionsLoc.R index 4f1bf5b..d536437 100644 --- a/R/aux_getDbRegionsLoc.R +++ b/R/aux_getDbRegionsLoc.R @@ -15,10 +15,24 @@ #' \code{vignette("RcisTarget")} #' #' @examples -#' \dontrun{ -#' featherFilePath <- "~/databases/dm6-regions-11species.mc9nr.feather" -#' dbRegionsLoc <- getDbRegionsLoc(featherFilePath) -#' } +#' library(arrow) +#' # Create a dummy data frame with drosophila-style region column names +#' df <- data.frame( +#' features = c("motif1", "motif2"), +#' `motif1__chr3L:1000-2000` = c(1, 2), +#' `motif2__chr3L:3000-4000` = c(3, 4), +#' check.names = FALSE +#' ) +#' +#' # Write to a temporary feather file +#' tmpFile <- tempfile(fileext = ".feather") +#' write_feather(df, tmpFile) +#' +#' # Get the region locations +#' getDbRegionsLoc(tmpFile) +#' +#' # Clean up +#' file.remove(tmpFile) #' @rdname getDbRegionsLoc #' @importFrom GenomeInfoDb sortSeqlevels seqlevels #' @importFrom GenomicRanges GRanges diff --git a/inst/examples/example_workflow.R b/inst/examples/example_workflow.R index cce10fb..8832770 100755 --- a/inst/examples/example_workflow.R +++ b/inst/examples/example_workflow.R @@ -1,8 +1,6 @@ # RcisTarget workflow for advanced users: # Running the workflow steps individually -\dontrun{ - ################################################## #### Load your gene sets # As example, the package includes an Hypoxia gene set: @@ -12,11 +10,13 @@ geneLists <- list(hypoxia=read.table(txtFile, stringsAsFactors=FALSE)[,1]) #### Load databases ## Motif rankings: Select according to organism and distance around TSS -## (See the vignette for URLs to download) -motifRankings <- importRankings("~/databases/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather") +library(RcisTarget.hg19.motifDBs.cisbpOnly.500bp) +data(hg19_500bpUpstream_motifRanking_cispbOnly) +motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly ## Motif - TF annotation: -data("motifAnnotations_hgnc") # human TFs (for motif collection 10) +data(motifAnnotations_hgnc_v9) # human TFs (for motif collection 9) +motifAnnotation <- motifAnnotations_hgnc_v9 ################################################## #### Run RcisTarget @@ -26,7 +26,7 @@ motifs_AUC <- calcAUC(geneLists, motifRankings) # Step 2. Select significant motifs, add TF annotation & format as table motifEnrichmentTable <- addMotifAnnotation(motifs_AUC, - motifAnnot=motifAnnotations) + motifAnnot=motifAnnotation) # Step 3 (optional). Identify genes that have the motif significantly enriched # (i.e. genes from the gene set in the top of the ranking) @@ -34,5 +34,3 @@ motifEnrichmentTable_wGenes <- addSignificantGenes(motifEnrichmentTable, geneSets=geneLists, rankings=motifRankings, method="aprox") - -} diff --git a/man/calcAUC.Rd b/man/calcAUC.Rd index 3c96694..a41311b 100755 --- a/man/calcAUC.Rd +++ b/man/calcAUC.Rd @@ -107,8 +107,6 @@ that are significantly over-represented in the gene-set. # RcisTarget workflow for advanced users: # Running the workflow steps individually -\dontrun{ - ################################################## #### Load your gene sets # As example, the package includes an Hypoxia gene set: @@ -118,8 +116,9 @@ geneLists <- list(hypoxia=read.table(txtFile, stringsAsFactors=FALSE)[,1]) #### Load databases ## Motif rankings: Select according to organism and distance around TSS -## (See the vignette for URLs to download) -motifRankings <- importRankings("hg19-500bp-upstream-7species.mc9nr.feather") +library(RcisTarget.hg19.motifDBs.cisbpOnly.500bp) +data(hg19_500bpUpstream_motifRanking_cispbOnly) +motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly ## Motif - TF annotation: data(motifAnnotations_hgnc_v9) # human TFs (for motif collection 9) @@ -141,8 +140,6 @@ motifEnrichmentTable_wGenes <- addSignificantGenes(motifEnrichmentTable, geneSets=geneLists, rankings=motifRankings, method="aprox") - -} } \seealso{ Next step in the workflow: \code{\link{addMotifAnnotation}}. diff --git a/man/convertToTargetRegions.Rd b/man/convertToTargetRegions.Rd index 91e5a7d..342edbb 100644 --- a/man/convertToTargetRegions.Rd +++ b/man/convertToTargetRegions.Rd @@ -34,11 +34,13 @@ IDs of the regions in the "target regions" overlapping with the query regions. Convert a set of input regions to the overlapping regions in the target set. } \examples{ -\dontrun{ - ## To apply on a list of regionSets: - regionSets_db <- lapply(regionSets, function(x) - convertToTargetRegions(queryRegions=x, targetRegions=dbRegionsLoc)) - } +# Create mock query and target regions +library(GenomicRanges) +queryRegions <- GRanges("chr1", IRanges(start = c(10, 100), end = c(50, 150))) +targetRegions <- GRanges("chr1", IRanges(start = c(5, 80, 200), end = c(45, 120, 250))) + +# Convert query regions to target regions +convertToTargetRegions(queryRegions = queryRegions, targetRegions = targetRegions) } \seealso{ \code{\link{getDbRegionsLoc}}. diff --git a/man/getDbRegionsLoc.Rd b/man/getDbRegionsLoc.Rd index a740966..45c932a 100644 --- a/man/getDbRegionsLoc.Rd +++ b/man/getDbRegionsLoc.Rd @@ -28,8 +28,22 @@ For \bold{human/mouse} the region locations are stored in a separate object (i.e. \code{}). This function is not needed. } \examples{ -\dontrun{ -featherFilePath <- "~/databases/dm6-regions-11species.mc9nr.feather" -dbRegionsLoc <- getDbRegionsLoc(featherFilePath) -} +library(arrow) +# Create a dummy data frame with drosophila-style region column names +df <- data.frame( + features = c("motif1", "motif2"), + `motif1__chr3L:1000-2000` = c(1, 2), + `motif2__chr3L:3000-4000` = c(3, 4), + check.names = FALSE +) + +# Write to a temporary feather file +tmpFile <- tempfile(fileext = ".feather") +write_feather(df, tmpFile) + +# Get the region locations +getDbRegionsLoc(tmpFile) + +# Clean up +file.remove(tmpFile) } From 55e5cdc8e4c293f013bd7818c6261ba0d612af14 Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 18:26:11 +0200 Subject: [PATCH 07/10] Guard suggested package dependencies in examples using requireNamespace Co-authored-by: Antigravity --- inst/examples/example_workflow.R | 45 +++++++++++++------------- man/addSignificantGenes.Rd | 7 ++--- man/calcAUC.Rd | 54 +++++++++++++++----------------- 3 files changed, 50 insertions(+), 56 deletions(-) diff --git a/inst/examples/example_workflow.R b/inst/examples/example_workflow.R index 8832770..0d559c2 100755 --- a/inst/examples/example_workflow.R +++ b/inst/examples/example_workflow.R @@ -1,36 +1,33 @@ # RcisTarget workflow for advanced users: # Running the workflow steps individually -################################################## -#### Load your gene sets # As example, the package includes an Hypoxia gene set: txtFile <- paste(file.path(system.file('examples', package='RcisTarget')), "hypoxiaGeneSet.txt", sep="/") geneLists <- list(hypoxia=read.table(txtFile, stringsAsFactors=FALSE)[,1]) - -#### Load databases -## Motif rankings: Select according to organism and distance around TSS -library(RcisTarget.hg19.motifDBs.cisbpOnly.500bp) -data(hg19_500bpUpstream_motifRanking_cispbOnly) -motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly -## Motif - TF annotation: -data(motifAnnotations_hgnc_v9) # human TFs (for motif collection 9) -motifAnnotation <- motifAnnotations_hgnc_v9 -################################################## +# Since the suggested database package is in Suggests, +# we guard the example to avoid hard failures if it is not installed: +if (requireNamespace("RcisTarget.hg19.motifDBs.cisbpOnly.500bp", quietly = TRUE)) { + + # Load rankings database + data(hg19_500bpUpstream_motifRanking_cispbOnly, package="RcisTarget.hg19.motifDBs.cisbpOnly.500bp") + motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly -#### Run RcisTarget + # Load motif annotations + data(motifAnnotations_hgnc_v9) # human TFs (for motif collection 9) + motifAnnotation <- motifAnnotations_hgnc_v9 -# Step 1. Calculate AUC -motifs_AUC <- calcAUC(geneLists, motifRankings) + # Step 1. Calculate AUC + motifs_AUC <- calcAUC(geneLists, motifRankings) -# Step 2. Select significant motifs, add TF annotation & format as table -motifEnrichmentTable <- addMotifAnnotation(motifs_AUC, - motifAnnot=motifAnnotation) + # Step 2. Select significant motifs, add TF annotation & format as table + motifEnrichmentTable <- addMotifAnnotation(motifs_AUC, + motifAnnot=motifAnnotation) -# Step 3 (optional). Identify genes that have the motif significantly enriched -# (i.e. genes from the gene set in the top of the ranking) -motifEnrichmentTable_wGenes <- addSignificantGenes(motifEnrichmentTable, - geneSets=geneLists, - rankings=motifRankings, - method="aprox") + # Step 3 (optional). Identify genes that have the motif significantly enriched + motifEnrichmentTable_wGenes <- addSignificantGenes(motifEnrichmentTable, + geneSets=geneLists, + rankings=motifRankings, + method="aprox") +} diff --git a/man/addSignificantGenes.Rd b/man/addSignificantGenes.Rd index f7b6652..8f3f5cf 100755 --- a/man/addSignificantGenes.Rd +++ b/man/addSignificantGenes.Rd @@ -255,9 +255,10 @@ geneLists <- list(hypoxia=read.table(txtFile, stringsAsFactors=FALSE)[,1]) ## (See the vignette for URLs to download) # motifRankings <- importRankings("hg19-500bp-upstream-7species.mc9nr.feather") +if (requireNamespace("RcisTarget.hg19.motifDBs.cisbpOnly.500bp", quietly = TRUE)) { + ## For this example we will use a SUBSET of the ranking/motif databases: -library(RcisTarget.hg19.motifDBs.cisbpOnly.500bp) -data(hg19_500bpUpstream_motifRanking_cispbOnly) +data(hg19_500bpUpstream_motifRanking_cispbOnly, package="RcisTarget.hg19.motifDBs.cisbpOnly.500bp") motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly ## Motif - TF annotation: @@ -323,8 +324,6 @@ onlyGenes <- getSignificantGenes(geneSet=geneLists$hypoxia, plotCurve=TRUE, rankings=motifRankings, method="aprox") - - } \seealso{ Previous step in the workflow: \code{\link{addMotifAnnotation}}. diff --git a/man/calcAUC.Rd b/man/calcAUC.Rd index a41311b..fb2be10 100755 --- a/man/calcAUC.Rd +++ b/man/calcAUC.Rd @@ -107,39 +107,37 @@ that are significantly over-represented in the gene-set. # RcisTarget workflow for advanced users: # Running the workflow steps individually -################################################## -#### Load your gene sets # As example, the package includes an Hypoxia gene set: txtFile <- paste(file.path(system.file('examples', package='RcisTarget')), "hypoxiaGeneSet.txt", sep="/") geneLists <- list(hypoxia=read.table(txtFile, stringsAsFactors=FALSE)[,1]) + +# Since the suggested database package is in Suggests, +# we guard the example to avoid hard failures if it is not installed: +if (requireNamespace("RcisTarget.hg19.motifDBs.cisbpOnly.500bp", quietly = TRUE)) { -#### Load databases -## Motif rankings: Select according to organism and distance around TSS -library(RcisTarget.hg19.motifDBs.cisbpOnly.500bp) -data(hg19_500bpUpstream_motifRanking_cispbOnly) -motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly - -## Motif - TF annotation: -data(motifAnnotations_hgnc_v9) # human TFs (for motif collection 9) -motifAnnotation <- motifAnnotations_hgnc_v9 -################################################## - -#### Run RcisTarget - -# Step 1. Calculate AUC -motifs_AUC <- calcAUC(geneLists, motifRankings) - -# Step 2. Select significant motifs, add TF annotation & format as table -motifEnrichmentTable <- addMotifAnnotation(motifs_AUC, - motifAnnot=motifAnnotation) - -# Step 3 (optional). Identify genes that have the motif significantly enriched -# (i.e. genes from the gene set in the top of the ranking) -motifEnrichmentTable_wGenes <- addSignificantGenes(motifEnrichmentTable, - geneSets=geneLists, - rankings=motifRankings, - method="aprox") + # Load rankings database + data(hg19_500bpUpstream_motifRanking_cispbOnly, package="RcisTarget.hg19.motifDBs.cisbpOnly.500bp") + motifRankings <- hg19_500bpUpstream_motifRanking_cispbOnly + + # Load motif annotations + data(motifAnnotations_hgnc_v9) # human TFs (for motif collection 9) + motifAnnotation <- motifAnnotations_hgnc_v9 + + # Step 1. Calculate AUC + motifs_AUC <- calcAUC(geneLists, motifRankings) + + # Step 2. Select significant motifs, add TF annotation & format as table + motifEnrichmentTable <- addMotifAnnotation(motifs_AUC, + motifAnnot=motifAnnotation) + + # Step 3 (optional). Identify genes that have the motif significantly enriched + # (i.e. genes from the gene set in the top of the ranking) + motifEnrichmentTable_wGenes <- addSignificantGenes(motifEnrichmentTable, + geneSets=geneLists, + rankings=motifRankings, + method="aprox") +} } \seealso{ Next step in the workflow: \code{\link{addMotifAnnotation}}. From 10f9d52e8fa5d34e6061d85e3f20bb4b5d116eba Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 18:34:13 +0200 Subject: [PATCH 08/10] Fix Rd syntax: close examples block correctly in addSignificantGenes.Rd Co-authored-by: Antigravity --- man/addSignificantGenes.Rd | 1 + 1 file changed, 1 insertion(+) diff --git a/man/addSignificantGenes.Rd b/man/addSignificantGenes.Rd index 8f3f5cf..55e7c97 100755 --- a/man/addSignificantGenes.Rd +++ b/man/addSignificantGenes.Rd @@ -325,6 +325,7 @@ onlyGenes <- getSignificantGenes(geneSet=geneLists$hypoxia, rankings=motifRankings, method="aprox") } +} \seealso{ Previous step in the workflow: \code{\link{addMotifAnnotation}}. From ed8d9cca5db44624d5d579c964638d5f5b4c909b Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Fri, 10 Jul 2026 19:25:16 +0200 Subject: [PATCH 09/10] Remove GHA workflow and promote igraph to Imports Co-authored-by: Antigravity --- .github/workflows/check-bioc.yml | 13 ------------- DESCRIPTION | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 .github/workflows/check-bioc.yml diff --git a/.github/workflows/check-bioc.yml b/.github/workflows/check-bioc.yml deleted file mode 100644 index 8eca8c2..0000000 --- a/.github/workflows/check-bioc.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: R-CMD-check-bioc - -on: - push: - branches: - - main - - master - - devel - pull_request: - -jobs: - run-check: - uses: bioc-package-rescue/workflows/.github/workflows/check-bioc.yml@main diff --git a/DESCRIPTION b/DESCRIPTION index 99cd1ad..5196c6f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,6 +34,7 @@ Imports: dplyr, tibble, GSEABase, + igraph, methods, R.utils, stats, @@ -51,7 +52,6 @@ Suggests: foreach, gplots, rtracklayer, - igraph, knitr, RcisTarget.hg19.motifDBs.cisbpOnly.500bp, rmarkdown, From e0c27f97e63bec345614e6e314ed713a2e11b6a8 Mon Sep 17 00:00:00 2001 From: Levi Waldron Date: Sun, 12 Jul 2026 12:07:59 +0200 Subject: [PATCH 10/10] Restore GHA workflow for CI Co-authored-by: Antigravity --- .github/workflows/check-bioc.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/check-bioc.yml diff --git a/.github/workflows/check-bioc.yml b/.github/workflows/check-bioc.yml new file mode 100644 index 0000000..8eca8c2 --- /dev/null +++ b/.github/workflows/check-bioc.yml @@ -0,0 +1,13 @@ +name: R-CMD-check-bioc + +on: + push: + branches: + - main + - master + - devel + pull_request: + +jobs: + run-check: + uses: bioc-package-rescue/workflows/.github/workflows/check-bioc.yml@main