Skip to content

Filter by PTM site match#68

Merged
tonywu1999 merged 17 commits intodevelfrom
feature-ptm
Feb 24, 2026
Merged

Filter by PTM site match#68
tonywu1999 merged 17 commits intodevelfrom
feature-ptm

Conversation

@tonywu1999
Copy link
Copy Markdown
Contributor

@tonywu1999 tonywu1999 commented Feb 24, 2026

Motivation and Context

This PR adds PTM-site-based filtering to INDRA-derived subnetworks to make extracted interactions more relevant for phospho/PTM-centric proteomics analyses. It refactors the INDRA filtering pipeline into discrete helper steps (PTM-site filtering then curation filtering) and exposes new visualization font-size parameters for HTML/Cytoscape outputs. The aim is to (1) allow optional removal of INDRA edges that do not match input PTM-site information and (2) separate curation adjustments into a dedicated helper.

Solution summary

  • Introduced an optional parameter to filter INDRA edges by matching PTM site information from input PTM results prior to curation filtering.
  • Refactored the INDRA filtering pipeline into .filterByPtmSite() and .filterByCuration() helpers and updated getSubnetworkFromIndra to run PTM-site filtering then curation filtering, returning the chained subnetwork result.
  • Removed api_key usage from several INDRA-related helpers and from the main call site.
  • Added node font-size parameters to the HTML/Cytoscape visualization API and propagated the value through the config generation pipeline.

Detailed changes

  • R/getSubnetworkFromIndra.R

    • Replaced api_key parameter with filter_by_ptm_site = FALSE in the public signature.
    • Added call to .filterByPtmSite(nodes, edges, filter_by_ptm_site) and then .filterByCuration(...) — now returns the filtered subnetwork.
    • Removed passing api_key into .filterIndraResponse; .filterIndraResponse is now called without api_key.
  • R/utils_getSubnetworkFromIndra.R

    • Removed api_key from .get_incorrect_curation_count() and adjusted its request logic to query INDRA curation list without requiring an API key.
    • Simplified .filterIndraResponse() signature by removing api_key and filter_by_curation; inlined curation-adjusting logic was removed.
    • Added .filterByPtmSite(nodes, edges, filter_by_ptm_site): filters edges lacking INDRA site matches to input PTM sites using calculatePTMOverlapAggregated().
    • Added .filterByCuration(nodes, edges, evidence_count_cutoff, filter_by_curation): queries incorrect curation counts and adjusts/evaluates evidence counts before filtering edges.
    • Reworked code comments and roxygen docs to reflect new helper functions and parameter changes.
  • R/visualizeNetworksWithHTML.R, man/exportNetworkToHTML.Rd, man/generateCytoscapeConfig.Rd, man/previewNetworkInBrowser.Rd

    • Added nodeFontSize (public) / node_font_size (internal) parameter with default 12 to control node label font size in HTML/Cytoscape visualizations.
    • Propagated the font-size parameter through exportNetworkToHTML -> generateCytoscapeConfig -> createNodeElements.
  • Documentation

    • Updated roxygen/Rd docs for getSubnetworkFromIndra to replace api_key with filter_by_ptm_site and document applicability (differential PTM abundance use case).
    • Updated man pages for visualization functions to document new font-size parameters.
  • Public API changes

    • getSubnetworkFromIndra signature changed; default behavior preserved but parameter list altered (breaking change).
    • Return value now the filtered subnetwork (output of new helper chain) rather than previously assembled nodes/edges list.

Unit tests added or modified

  • No new unit tests were added for:
    • filter_by_ptm_site behavior (.filterByPtmSite)
    • .filterByCuration behavior and interaction with INDRA curation counts
    • The path combinations (filter_by_ptm_site TRUE/FALSE + filter_by_curation TRUE/FALSE)
    • Visualization parameter propagation (nodeFontSize/node_font_size)
  • Existing tests for getSubnetworkFromIndra remain limited to basic structure and input validation and do not exercise the new filtering logic. The PR’s description/checklist shows testing steps left empty.

Coding guidelines and potential issues

  • Breaking API change: Removing api_key from public getSubnetworkFromIndra is a breaking change with no deprecation/migration guidance in docs or the PR description.
  • Missing tests: New functionality and refactored paths lack unit tests and mocks to validate behavior and edge cases.
  • Potential runtime/scoping bug: .filterByCuration() adjusts and filters edges by evidence_count_cutoff; verify that evidence_count_cutoff is passed into or available to that function (the diff summary suggests the helper receives evidence_count_cutoff but reviewers should confirm the implementation does not rely on an unbound variable).
  • Behavior change risk: .filterIndraResponse() no longer adjusts evidence counts via api-key-based curation lookup; ensure the new .filterByCuration() correctly reimplements prior behavior and that removing api_key does not break authenticated endpoints or rate-limited access in deployment contexts.
  • Documentation vs. implementation: The PR updates Rd/roxygen docs but checklist items for contributing guidelines, change warnings, dependent changes, code styling, and documentation generation are unchecked — ensure CI/doc build and contribution-policy compliance before merge.

@tonywu1999 tonywu1999 changed the title Feature ptm Filter by PTM site match Feb 24, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

Warning

Rate limit exceeded

@tonywu1999 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 7 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c7ea894 and 7c4e728.

📒 Files selected for processing (2)
  • R/utils_getSubnetworkFromIndra.R
  • R/visualizeNetworksWithHTML.R
📝 Walkthrough

Walkthrough

Replaces the INDRA api_key-based curation step with a PTM-site filtering option and modular helper filters (.filterByPtmSite, .filterByCuration); also exposes node font-size options in HTML/Cytoscape visualization APIs and updates documentation accordingly.

Changes

Cohort / File(s) Summary
INDRA filtering & pipeline
R/getSubnetworkFromIndra.R, R/utils_getSubnetworkFromIndra.R
Removed api_key usage; added filter_by_ptm_site parameter to public API; introduced .filterByPtmSite(nodes, edges, filter_by_ptm_site) and .filterByCuration(nodes, edges, evidence_count_cutoff, filter_by_curation); .filterIndraResponse signature simplified.
Visualization API surface
R/visualizeNetworksWithHTML.R, man/exportNetworkToHTML.Rd, man/generateCytoscapeConfig.Rd, man/previewNetworkInBrowser.Rd
Added nodeFontSize / node_font_size parameter (default 12) and wired it through export functions to the Cytoscape config; updated documentation.
Documentation for INDRA function
man/getSubnetworkFromIndra.Rd
Replaced api_key argument docs with filter_by_ptm_site and updated descriptions to reflect PTM-site-based filtering behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Review effort 3/5

Poem

🐰 I hopped through code with twitchy pride,
Swapped keys for sites and split the tide,
Filters in pairs, neat pathways to roam,
Nodes wear their fonts — a cozy home,
Cheers from this rabbit for pipeline refined!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely empty except for the template structure; no motivation, changes, or testing details were provided by the author. Add motivation/context explaining why PTM-site filtering is needed, list all changes (including signature updates to multiple functions), and document any tests added or validation performed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Filter by PTM site match' directly reflects the main change: replacing api_key with filter_by_ptm_site parameter and introducing PTM-site-based filtering in getSubnetworkFromIndra.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature-ptm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
R/utils_getSubnetworkFromIndra.R (1)

291-294: ⚠️ Potential issue | 🟠 Major

Use bigint_as_char = TRUE in fromJSON() to preserve integer precision for matches_hash.

matches_hash in INDRA statement JSON is a signed 64-bit integer, which can reach up to ~19 digits. The current code at lines 291–293 calls fromJSON() without the bigint_as_char parameter, causing large integers to be deserialized into R numeric (double) type. Since doubles can only represent ~15–16 significant decimal digits accurately, hashes exceeding 2^53 will lose precision and become corrupted. When as.character(stmt_hash) is called at line 73 to build the curation API URL, the rounded value is used, potentially querying an incorrect curation list.

Pass bigint_as_char = TRUE to fromJSON() to keep large integers as character strings:

Suggested fix
stmt_json <- fromJSON(query(res, x)$data$stmt_json, bigint_as_char = TRUE)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@R/utils_getSubnetworkFromIndra.R` around lines 291 - 294, The deserialization
of INDRA statement JSON loses precision for 64-bit integer matches_hash because
fromJSON(...) is called without bigint_as_char; update the call in the stmt_hash
construction (where stmt_json <- fromJSON(query(res, x)$data$stmt_json) is used)
to pass bigint_as_char = TRUE so matches_hash remains a character (preserving
full precision) and downstream uses such as as.character(stmt_hash) produce the
correct hash string.
♻️ Duplicate comments (2)
man/generateCytoscapeConfig.Rd (1)

13-14: Missing \item{node_font_size} in \arguments — same as exportNetworkToHTML.Rd.

See the comment on man/exportNetworkToHTML.Rd line 12.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@man/generateCytoscapeConfig.Rd` around lines 13 - 14, The \arguments section
of man/generateCytoscapeConfig.Rd is missing an entry for the node_font_size
argument; add a \item{node_font_size}{...} description matching the one used in
man/exportNetworkToHTML.Rd (explain it’s the default node font size, units and
default value 12) so the documentation lists node_font_size alongside
layout_options and other args.
man/previewNetworkInBrowser.Rd (1)

7-13: Missing \item{nodeFontSize} in \arguments — same as exportNetworkToHTML.Rd.

See the comment on man/exportNetworkToHTML.Rd line 12.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@man/previewNetworkInBrowser.Rd` around lines 7 - 13, The \arguments section
of previewNetworkInBrowser.Rd is missing documentation for the nodeFontSize
parameter; add an \item{nodeFontSize}{...} entry describing its purpose and
default (same wording and style as the nodeFontSize item in
exportNetworkToHTML.Rd) so the help page documents the nodeFontSize argument for
the previewNetworkInBrowser function.
🧹 Nitpick comments (1)
R/utils_getSubnetworkFromIndra.R (1)

363-365: .filterByCuration and .filterByPtmSite lack roxygen documentation blocks.

Every other internal helper in this file (.validateGetSubnetworkFromIndraInput, .callIndraCogexApi, .filterIndraResponse, etc.) has @title, @param, @return, @keywords internal, and @noRd tags. These two new helpers have none, making them inconsistent and invisible to package documentation tooling.

Also applies to: 377-379

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@R/utils_getSubnetworkFromIndra.R` around lines 363 - 365, Add roxygen3
documentation blocks to the two internal helpers `.filterByCuration` and
`.filterByPtmSite` so they match the other helpers: include `@title` (short
description), `@param` entries for each function argument (e.g., nodes, edges,
filter_by_curation for `.filterByCuration`; nodes, edges, filter_by_ptm_site for
`.filterByPtmSite`), `@return` describing the returned object (e.g., filtered
edges/nodes or logical vector), and the tags `@keywords` internal and `@noRd`; place
the block immediately above each function definition so package documentation
tooling treats them as internal and consistent with
`.validateGetSubnetworkFromIndraInput`, `.callIndraCogexApi`, and
`.filterIndraResponse`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@man/exportNetworkToHTML.Rd`:
- Line 12: Add a missing \item entry for the nodeFontSize parameter in the
\arguments section of man/exportNetworkToHTML.Rd: document the parameter name
(nodeFontSize), its purpose (controls node label/font size in the exported
HTML), and its default (12). Do the same for the other RD files mentioned: add
an \item for node_font_size in man/previewNetworkInBrowser.Rd and
man/generateCytoscapeConfig.Rd with a short description and the correct default
value, ensuring the documented names match the function arguments (nodeFontSize
/ node_font_size) so R CMD check no longer reports undocumented parameters.

In `@R/utils_getSubnetworkFromIndra.R`:
- Around line 377-385: In .filterByPtmSite: when subsetting edges using
ptm_overlap[paste(edges$source, edges$target, edges$interaction, sep = "-")] NAs
propagate and produce NA rows; fix by computing the composite key
(paste(edges$source, edges$target, edges$interaction, sep = "-")), look up
ptm_overlap for that key into a vector (e.g., sel), coerce missing entries to a
safe value (e.g., replace NA with "" or use !is.na(sel) combined with sel !=
""), and then subset edges by sel != "" (or equivalent logical mask) before
proceeding to !is.na(edges$site) so no NA logicals cause NA rows.
- Around line 363-375: The function .filterByCuration refers to
evidence_count_cutoff which is out of scope and causes a runtime error; add
evidence_count_cutoff as an explicit parameter to .filterByCuration (e.g.,
.filterByCuration = function(nodes, edges, filter_by_curation,
evidence_count_cutoff)) and use that parameter where edges are filtered, then
update every call-site (notably the call in getSubnetworkFromIndra /
R/getSubnetworkFromIndra.R) to pass the appropriate evidence_count_cutoff value
from the parent scope; ensure the function signature and all invocations are
consistent so the cutoff is threaded through.
- Line 379: The call to calculatePTMOverlapAggregated from
utils_getSubnetworkFromIndra.R fails because the function in
R/visualizeNetworksWithHTML.R is not exported; add an `@export` roxygen2 tag
immediately above the calculatePTMOverlapAggregated function definition in
R/visualizeNetworksWithHTML.R (or alternatively add an
export(calculatePTMOverlapAggregated) entry to the NAMESPACE) so R CMD check and
cross-file calls can find the function.

---

Outside diff comments:
In `@R/utils_getSubnetworkFromIndra.R`:
- Around line 291-294: The deserialization of INDRA statement JSON loses
precision for 64-bit integer matches_hash because fromJSON(...) is called
without bigint_as_char; update the call in the stmt_hash construction (where
stmt_json <- fromJSON(query(res, x)$data$stmt_json) is used) to pass
bigint_as_char = TRUE so matches_hash remains a character (preserving full
precision) and downstream uses such as as.character(stmt_hash) produce the
correct hash string.

---

Duplicate comments:
In `@man/generateCytoscapeConfig.Rd`:
- Around line 13-14: The \arguments section of man/generateCytoscapeConfig.Rd is
missing an entry for the node_font_size argument; add a
\item{node_font_size}{...} description matching the one used in
man/exportNetworkToHTML.Rd (explain it’s the default node font size, units and
default value 12) so the documentation lists node_font_size alongside
layout_options and other args.

In `@man/previewNetworkInBrowser.Rd`:
- Around line 7-13: The \arguments section of previewNetworkInBrowser.Rd is
missing documentation for the nodeFontSize parameter; add an
\item{nodeFontSize}{...} entry describing its purpose and default (same wording
and style as the nodeFontSize item in exportNetworkToHTML.Rd) so the help page
documents the nodeFontSize argument for the previewNetworkInBrowser function.

---

Nitpick comments:
In `@R/utils_getSubnetworkFromIndra.R`:
- Around line 363-365: Add roxygen3 documentation blocks to the two internal
helpers `.filterByCuration` and `.filterByPtmSite` so they match the other
helpers: include `@title` (short description), `@param` entries for each function
argument (e.g., nodes, edges, filter_by_curation for `.filterByCuration`; nodes,
edges, filter_by_ptm_site for `.filterByPtmSite`), `@return` describing the
returned object (e.g., filtered edges/nodes or logical vector), and the tags
`@keywords` internal and `@noRd`; place the block immediately above each function
definition so package documentation tooling treats them as internal and
consistent with `.validateGetSubnetworkFromIndraInput`, `.callIndraCogexApi`,
and `.filterIndraResponse`.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce2af12 and d3fcc10.

📒 Files selected for processing (6)
  • R/getSubnetworkFromIndra.R
  • R/utils_getSubnetworkFromIndra.R
  • man/exportNetworkToHTML.Rd
  • man/generateCytoscapeConfig.Rd
  • man/getSubnetworkFromIndra.Rd
  • man/previewNetworkInBrowser.Rd

Comment thread man/exportNetworkToHTML.Rd
Comment thread R/utils_getSubnetworkFromIndra.R Outdated
Comment thread R/utils_getSubnetworkFromIndra.R
Comment thread R/utils_getSubnetworkFromIndra.R Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
R/visualizeNetworksWithHTML.R (3)

379-403: ⚠️ Potential issue | 🟡 Minor

Missing @param node_font_size in generateCytoscapeConfig roxygen block.

The node_font_size = 12 argument is present in the function signature (Line 403) but has no corresponding @param tag in the documentation block (Lines 379–397). Regenerating docs from roxygen will leave man/generateCytoscapeConfig.Rd without this entry, and R CMD check will flag it as an undocumented argument.

📝 Proposed fix
 #' `@param` layout_options Optional list of layout configuration options
+#' `@param` node_font_size Font size for node labels in pixels (default: 12)
 #' `@export`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@R/visualizeNetworksWithHTML.R` around lines 379 - 403, Add a `@param` tag for
node_font_size to the roxygen block above the generateCytoscapeConfig function:
document that node_font_size is the numeric font size for node labels (default =
12), place it alongside the existing `@param` entries (e.g., after
display_label_type or container_id), and then regenerate the package
documentation so man/generateCytoscapeConfig.Rd includes this parameter.

1149-1153: ⚠️ Potential issue | 🟡 Minor

No input validation for nodeFontSize.

Non-numeric or negative values (e.g., nodeFontSize = "large" or nodeFontSize = -5) pass through to paste0(node_font_size, "px") at Line 440, producing invalid CSS that is silently ignored by the browser. A lightweight guard at the entry point would surface the error early.

🛡️ Proposed fix
 exportNetworkToHTML <- function(nodes, edges,
                                 filename = "network_visualization.html",
                                 displayLabelType = "id",
                                 nodeFontSize = 12,
                                 ...) {
+    if (!is.numeric(nodeFontSize) || nodeFontSize <= 0) {
+        stop("`nodeFontSize` must be a positive number.")
+    }

Apply the same guard at the top of previewNetworkInBrowser and generateCytoscapeConfig.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@R/visualizeNetworksWithHTML.R` around lines 1149 - 1153, The functions
exportNetworkToHTML, previewNetworkInBrowser, and generateCytoscapeConfig do not
validate the nodeFontSize parameter, allowing non-numeric or negative values to
reach paste0(node_font_size, "px") (see node_font_size usage) and produce
invalid CSS; add a lightweight guard at the start of each function that checks
nodeFontSize is numeric (or coercible) and greater than zero, coerce or convert
to a numeric value if safe, and otherwise stop/throw a clear error message
indicating nodeFontSize must be a positive number so invalid inputs are rejected
early.

1170-1182: ⚠️ Potential issue | 🟡 Minor

Missing @param nodeFontSize in previewNetworkInBrowser roxygen block.

nodeFontSize = 12 is in the function signature (Line 1181) but absent from the documentation block (Lines 1170–1178). This will produce an R CMD check undocumented-argument warning and leave man/previewNetworkInBrowser.Rd incomplete after re-generation.

📝 Proposed fix
 #' `@param` displayLabelType Type of label to display ("id" or "hgncName")
+#' `@param` nodeFontSize Font size for node labels (default: 12)
 #' `@param` ... Additional arguments passed to exportCytoscapeToHTML()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@R/visualizeNetworksWithHTML.R` around lines 1170 - 1182, The roxygen block
for previewNetworkInBrowser is missing a `@param` entry for nodeFontSize; add a
line like "@param nodeFontSize Numeric font size for node labels (default 12)."
to the documentation block above the previewNetworkInBrowser function so R CMD
check won't warn and the generated man/previewNetworkInBrowser.Rd includes this
argument.
♻️ Duplicate comments (1)
man/exportNetworkToHTML.Rd (1)

12-12: LGTM – resolves the previously flagged undocumented-parameter warning.

The nodeFontSize = 12 entry is now present in both \usage and \arguments, bringing this .Rd file into R CMD check compliance.

Also applies to: 25-26

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@man/exportNetworkToHTML.Rd` at line 12, Add the missing documentation for the
nodeFontSize parameter in the Rd file: ensure the symbol nodeFontSize = 12
appears in both the \usage and \arguments sections of exportNetworkToHTML.Rd and
add a matching descriptive entry for nodeFontSize in the \arguments block (and
mirror the same addition for the other duplicate occurrence referenced), so the
parameter is documented consistently and R CMD check no longer flags an
undocumented parameter.
🧹 Nitpick comments (1)
R/getSubnetworkFromIndra.R (1)

35-37: Clarify expected PTM-site input fields.

Consider listing the required PTM-site column names/format (or linking to the specific input schema) so users can enable this filter without guesswork.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@R/getSubnetworkFromIndra.R` around lines 35 - 37, The documentation for the
filter_by_ptm_site parameter is missing the exact expected PTM-site column
names/format; update the Roxygen for the getSubnetworkFromIndra function to list
the required input columns (e.g., "gene", "site", "residue" or whatever the
package expects) or add a link to the input schema, and state the expected
format (e.g., "S123" or "S123_phospho"); explicitly mention the column names
used by the function (those parsed in getSubnetworkFromIndra or its helper that
checks PTM sites) so users know how to structure their differential PTM
abundance input before setting filter_by_ptm_site = TRUE.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@R/getSubnetworkFromIndra.R`:
- Around line 62-63: The function getSubnetworkFromIndra currently accepts
filter_by_curation and filter_by_ptm_site and may receive a string if callers
used positional args after api_key was removed; add a fast guard at the start of
getSubnetworkFromIndra that validates filter_by_curation and filter_by_ptm_site
are logical (is.logical and length 1) and error with a clear message if they are
not (e.g., detect character inputs and tell callers to use named arguments or
restore api_key); alternatively implement a short deprecation shim that accepts
a first positional character argument as the removed api_key and emits a
deprecation error guiding callers to switch to named params—reference the
function name getSubnetworkFromIndra and the parameters filter_by_curation and
filter_by_ptm_site in the check.
- Line 67: Update the parameter name in the .filterIndraResponse function to
match the caller: rename the formal argument interaction_types to
statement_types so the call res <- .filterIndraResponse(res, statement_types,
evidence_count_cutoff, sources_filter) is explicit and clear; adjust any
internal references inside .filterIndraResponse (and its documentation/roxygen
if present) from interaction_types to statement_types to avoid breaking
behavior.

---

Outside diff comments:
In `@R/visualizeNetworksWithHTML.R`:
- Around line 379-403: Add a `@param` tag for node_font_size to the roxygen block
above the generateCytoscapeConfig function: document that node_font_size is the
numeric font size for node labels (default = 12), place it alongside the
existing `@param` entries (e.g., after display_label_type or container_id), and
then regenerate the package documentation so man/generateCytoscapeConfig.Rd
includes this parameter.
- Around line 1149-1153: The functions exportNetworkToHTML,
previewNetworkInBrowser, and generateCytoscapeConfig do not validate the
nodeFontSize parameter, allowing non-numeric or negative values to reach
paste0(node_font_size, "px") (see node_font_size usage) and produce invalid CSS;
add a lightweight guard at the start of each function that checks nodeFontSize
is numeric (or coercible) and greater than zero, coerce or convert to a numeric
value if safe, and otherwise stop/throw a clear error message indicating
nodeFontSize must be a positive number so invalid inputs are rejected early.
- Around line 1170-1182: The roxygen block for previewNetworkInBrowser is
missing a `@param` entry for nodeFontSize; add a line like "@param nodeFontSize
Numeric font size for node labels (default 12)." to the documentation block
above the previewNetworkInBrowser function so R CMD check won't warn and the
generated man/previewNetworkInBrowser.Rd includes this argument.

---

Duplicate comments:
In `@man/exportNetworkToHTML.Rd`:
- Line 12: Add the missing documentation for the nodeFontSize parameter in the
Rd file: ensure the symbol nodeFontSize = 12 appears in both the \usage and
\arguments sections of exportNetworkToHTML.Rd and add a matching descriptive
entry for nodeFontSize in the \arguments block (and mirror the same addition for
the other duplicate occurrence referenced), so the parameter is documented
consistently and R CMD check no longer flags an undocumented parameter.

---

Nitpick comments:
In `@R/getSubnetworkFromIndra.R`:
- Around line 35-37: The documentation for the filter_by_ptm_site parameter is
missing the exact expected PTM-site column names/format; update the Roxygen for
the getSubnetworkFromIndra function to list the required input columns (e.g.,
"gene", "site", "residue" or whatever the package expects) or add a link to the
input schema, and state the expected format (e.g., "S123" or "S123_phospho");
explicitly mention the column names used by the function (those parsed in
getSubnetworkFromIndra or its helper that checks PTM sites) so users know how to
structure their differential PTM abundance input before setting
filter_by_ptm_site = TRUE.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3fcc10 and c7ea894.

📒 Files selected for processing (4)
  • R/getSubnetworkFromIndra.R
  • R/utils_getSubnetworkFromIndra.R
  • R/visualizeNetworksWithHTML.R
  • man/exportNetworkToHTML.Rd
🚧 Files skipped from review as they are similar to previous changes (1)
  • R/utils_getSubnetworkFromIndra.R

Comment thread R/getSubnetworkFromIndra.R
Comment thread R/getSubnetworkFromIndra.R
@tonywu1999 tonywu1999 merged commit 7ff5f09 into devel Feb 24, 2026
4 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.83333% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.76%. Comparing base (5afd016) to head (7c4e728).
⚠️ Report is 2 commits behind head on devel.

Files with missing lines Patch % Lines
R/utils_getSubnetworkFromIndra.R 31.57% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel      #68      +/-   ##
==========================================
+ Coverage   57.89%   58.76%   +0.87%     
==========================================
  Files           7        7              
  Lines        1356     1414      +58     
==========================================
+ Hits          785      831      +46     
- Misses        571      583      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants