Skip to content

refactor(getSubnetworkFromIndra): Switch column from pvalue to adj.pvalue for nodes table#52

Merged
tonywu1999 merged 1 commit intodevelfrom
pvalue
Jul 28, 2025
Merged

refactor(getSubnetworkFromIndra): Switch column from pvalue to adj.pvalue for nodes table#52
tonywu1999 merged 1 commit intodevelfrom
pvalue

Conversation

@tonywu1999
Copy link
Copy Markdown
Contributor

@tonywu1999 tonywu1999 commented Jul 28, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the column name for adjusted p-values in the output data to ensure consistency with the input data.

PR Type

Bug fix


Description

  • Rename nodes column to adj.pvalue

File Walkthrough

Relevant files
Bug fix
utils_getSubnetworkFromIndra.R
Rename nodes column to adj.pvalue                                               

R/utils_getSubnetworkFromIndra.R

  • Renamed data.frame column from pvalue to adj.pvalue
  • Updated .constructNodesDataFrame to use adjusted p-value field
+1/-1     

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 28, 2025

Walkthrough

The change updates the .constructNodesDataFrame function in R/utils_getSubnetworkFromIndra.R to correct the column name for adjusted p-values in the nodes data frame from pvalue to adj.pvalue, ensuring consistency with the input data. No other logic or exported entity signatures are affected.

Changes

Cohort / File(s) Change Summary
Adjusted p-value Column Name Correction
R/utils_getSubnetworkFromIndra.R
Corrects the nodes data frame column name from pvalue to adj.pvalue for naming consistency.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A hop and a skip, a column renamed,
From pvalue to adj.pvalue, now properly framed.
Consistency blooms in the data’s neat row,
As rabbits rejoice in the code’s tidy flow.
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pvalue

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Column Naming Change

Verify that downstream code and documentation reference the renamed column adj.pvalue instead of the old pvalue, including tests, plotting functions, and export routines.

adj.pvalue = input$adj.pvalue,
Data Completeness

Confirm that removal of the original pvalue column (which held raw p-values) is intentional and that no subsequent analysis steps depend on it.

adj.pvalue = input$adj.pvalue,
Input Validation

Ensure input$adj.pvalue always exists and is numeric, or implement a fallback or error if it's missing to avoid creating a completely NA column.

adj.pvalue = input$adj.pvalue,

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: 0

🔭 Outside diff range comments (1)
R/utils_getSubnetworkFromIndra.R (1)

260-266: Update downstream references to the renamed adj.pvalue column

We only found one consumer still expecting nodes$pvalue, so you’ll need to adjust that before merging:

• R/visualizeNetworks.R
– Line 8 & 12 (roxygen tags): change mentions of “pvalue (number)” and @param pvalueCutoff description if they imply the old column name
– Line 47: replace nodes$pvalue with nodes$adj.pvalue in the color‐assignment expression

With these updates in place, all code reading the nodes table will correctly use adj.pvalue.

🧹 Nitpick comments (1)
R/utils_getSubnetworkFromIndra.R (1)

260-266: Roxygen docs & examples need update.

The roxygen block above .constructNodesDataFrame() still refers generically to "p-value"; update it (and any examples) to mention adj.pvalue so that generated docs stay accurate.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fde597 and c7b5edb.

📒 Files selected for processing (1)
  • R/utils_getSubnetworkFromIndra.R (1 hunks)

@github-actions
Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Add legacy pvalue alias

Preserve the original pvalue column for backward compatibility by adding it
alongside the new adj.pvalue assignment. This prevents downstream code that expects
pvalue from breaking.

R/utils_getSubnetworkFromIndra.R [264]

 adj.pvalue = input$adj.pvalue,
+pvalue     = input$adj.pvalue,
Suggestion importance[1-10]: 5

__

Why: Preserving the original pvalue alongside adj.pvalue ensures backward compatibility and prevents breaking downstream code that expects pvalue.

Low
Possible issue
Coerce adj.pvalue to numeric

Ensure that adj.pvalue is treated as numeric to avoid unexpected type issues in
downstream filtering or plotting. Wrap the assignment in as.numeric() to coerce
factors or character vectors into numbers.

R/utils_getSubnetworkFromIndra.R [264]

-adj.pvalue = input$adj.pvalue,
+adj.pvalue = as.numeric(input$adj.pvalue),
Suggestion importance[1-10]: 4

__

Why: Coercing adj.pvalue to numeric guards against potential type issues, but is a minor precaution since input likely already provides numeric values.

Low

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.71%. Comparing base (0fde597) to head (c7b5edb).

Additional details and impacted files
@@           Coverage Diff           @@
##            devel      #52   +/-   ##
=======================================
  Coverage   64.71%   64.71%           
=======================================
  Files           7        7           
  Lines         598      598           
=======================================
  Hits          387      387           
  Misses        211      211           

☔ 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