Conversation
…nction descriptions - Added author information to `runSCORPION` and `testEdges` functions. - Introduced `maEdges` function for meta-analysis of TF-target edges with documentation. - Implemented `enrichEdges` function for gene set enrichment analysis with detailed usage examples. - Created `circosEdges` function for visualizing differential network edges with comprehensive documentation. - Added internal helper functions for processing gene coordinates and parsing GMT files. - Updated `README.md` with new function descriptions and usage examples. - Added tests for `circosEdges` to ensure functionality with user-supplied coordinates and error handling. - Updated existing documentation to include new references and author information.
There was a problem hiding this comment.
Pull request overview
This PR expands SCORPION’s user-facing functionality and documentation by adding three new exported helpers (maEdges(), enrichEdges(), circosEdges()), updating package docs/README, and introducing test coverage for circosEdges().
Changes:
- Added new exported functions for meta-analysis (
maEdges), TF-wise gene set enrichment (enrichEdges), and Circos visualization (circosEdges) with roxygen docs and README examples. - Updated existing function documentation (
runSCORPION,testEdges,regressEdges) with author/seealso references and refreshed dataset documentation (scorpionTest). - Added testthat coverage for
circosEdgesbehavior (offline coords, GMT parsing, errors, chromosome ordering) and updated package exports/imports/suggested deps.
Reviewed changes
Copilot reviewed 10 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test_circos_edges.R | Adds testthat coverage for circosEdges (offline coords, GMT parsing, error paths, .orderChr). |
| README.md | Documents new functions and provides usage examples for maEdges, enrichEdges, and circosEdges. |
| R/testEdges.R | Adds author and seealso references to connect new APIs in documentation. |
| R/runSCORPION.R | Adds author and seealso references in documentation. |
| R/maEdges.R | Introduces exported maEdges() meta-analysis implementation and roxygen docs. |
| R/enrichEdges.R | Introduces exported enrichEdges() fgsea-based enrichment implementation and roxygen docs. |
| R/data-scorpionTest.R | Updates dataset documentation to reflect the current scorpionTest contents/structure. |
| R/circosEdges.R | Introduces exported circosEdges() visualization plus internal helpers (GMT parsing, coords fetch/validate, chromosome ordering, legends). |
| NAMESPACE | Exports new functions and adds required imports for new code paths. |
| man/testEdges.Rd | Regenerates docs to include author and seealso updates. |
| man/scorpionTest.Rd | Regenerates docs to match updated dataset documentation. |
| man/runSCORPION.Rd | Regenerates docs to include author and seealso updates. |
| man/regressEdges.Rd | Regenerates docs to include author and seealso updates. |
| man/maEdges.Rd | Adds generated documentation for maEdges(). |
| man/enrichEdges.Rd | Adds generated documentation for enrichEdges(). |
| man/dot-validateGeneCoords.Rd | Adds generated internal documentation for .validateGeneCoords(). |
| man/dot-parseGMT.Rd | Adds generated internal documentation for .parseGMT(). |
| man/dot-orderChr.Rd | Adds generated internal documentation for .orderChr(). |
| man/dot-fetchGeneCoords.Rd | Adds generated internal documentation for .fetchGeneCoords(). |
| man/dot-drawCircosLegends.Rd | Adds generated internal documentation for .drawCircosLegends(). |
| man/circosEdges.Rd | Adds generated documentation for circosEdges(). |
| DESCRIPTION | Updates package description typography and adds new suggested dependencies (circlize, biomaRt, fgsea). |
Files not reviewed (12)
- man/circosEdges.Rd: Generated file
- man/dot-drawCircosLegends.Rd: Generated file
- man/dot-fetchGeneCoords.Rd: Generated file
- man/dot-orderChr.Rd: Generated file
- man/dot-parseGMT.Rd: Generated file
- man/dot-validateGeneCoords.Rd: Generated file
- man/enrichEdges.Rd: Generated file
- man/maEdges.Rd: Generated file
- man/regressEdges.Rd: Generated file
- man/runSCORPION.Rd: Generated file
- man/scorpionTest.Rd: Generated file
- man/testEdges.Rd: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+205
to
+208
| enrichment <- enrichment[ | ||
| setdiff(colnames(enrichment), "leadingEdge"), | ||
| drop = FALSE | ||
| ] |
|
|
||
| # Per-gene degree: sum of log2FoldChange over outgoing (TF) and incoming | ||
| # (target) links, using every edge under pAdjThreshold (not just drawn links) | ||
| deg_col <- if ("log2FoldChange" %in% colnames(edges_sig)) "log2FoldChange" else colorBy |
Comment on lines
+65
to
+72
| maEdges <- function(edgesList, | ||
| method = c("random", "fixed"), | ||
| minStudies = 2L) { | ||
| method <- match.arg(method) | ||
|
|
||
| n_studies <- length(edgesList) | ||
|
|
||
| stopifnot(is.list(edgesList), n_studies >= 2L) |
Comment on lines
+70
to
+81
| enrichEdges <- function(edgesDF, | ||
| geneSets, | ||
| numericValue, | ||
| nCores = 3, | ||
| seed = 1) { | ||
| if (!requireNamespace("fgsea", quietly = TRUE)) { | ||
| stop( | ||
| "Package 'fgsea' (Bioconductor) is required for enrichEdges(). ", | ||
| "Install it with BiocManager::install('fgsea').", | ||
| call. = FALSE | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…nction descriptions
runSCORPIONandtestEdgesfunctions.maEdgesfunction for meta-analysis of TF-target edges with documentation.enrichEdgesfunction for gene set enrichment analysis with detailed usage examples.circosEdgesfunction for visualizing differential network edges with comprehensive documentation.README.mdwith new function descriptions and usage examples.circosEdgesto ensure functionality with user-supplied coordinates and error handling.