Skip to content

fix(pvalue-filter): Fix how pvalue filter is passed#103

Merged
tonywu1999 merged 1 commit intodevel-bionetfrom
update-bionet
Feb 4, 2025
Merged

fix(pvalue-filter): Fix how pvalue filter is passed#103
tonywu1999 merged 1 commit intodevel-bionetfrom
update-bionet

Conversation

@tonywu1999
Copy link
Copy Markdown
Contributor

@tonywu1999 tonywu1999 commented Feb 4, 2025

User description

Need to ensure pvalueCutoff parameter is used when MSstatsShiny is calling MSstatsBioNet


PR Type

Bug fix, Enhancement


Description

  • Fixed how the pvalueCutoff parameter is passed to getSubnetworkFromIndra.

  • Added imports for datatable and renderDT from the DT package.

  • Enhanced error handling in the visualizeNetworkServer function.


Changes walkthrough 📝

Relevant files
Enhancement
NAMESPACE
Added new imports for DT package functions                             

NAMESPACE

  • Added imports for datatable and renderDT from the DT package.
+2/-0     
Bug fix
module-visualize-network-server.R
Fixed pvalue filter and enhanced error handling                   

R/module-visualize-network-server.R

  • Fixed pvalueCutoff parameter usage in getSubnetworkFromIndra.
  • Added renderDT and datatable to the function documentation.
  • Improved error handling for subnetwork extraction.
  • +2/-2     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @tonywu1999 tonywu1999 merged commit 6e3bee5 into devel-bionet Feb 4, 2025
    @tonywu1999 tonywu1999 deleted the update-bionet branch February 4, 2025 22:43
    @github-actions
    Copy link
    Copy Markdown

    github-actions Bot commented Feb 4, 2025

    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

    Parameter Passing

    Ensure that the pvalueCutoff parameter is correctly passed to the getSubnetworkFromIndra function and behaves as expected. Validate that the pValue() function provides the correct value for this parameter.

    getSubnetworkFromIndra(annotated_df, pvalueCutoff = pValue())
    Import Redundancy

    Verify that the added imports datatable and renderDT from the DT package are necessary and not redundant with existing imports.

    importFrom(DT,datatable)
    importFrom(DT,renderDT)

    @github-actions
    Copy link
    Copy Markdown

    github-actions Bot commented Feb 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Validate pValue() to prevent errors

    Ensure that the pValue() function used in the getSubnetworkFromIndra call is
    properly defined and returns a valid numeric value, as undefined or invalid values
    could cause runtime errors.

    R/module-visualize-network-server.R [51]

    -getSubnetworkFromIndra(annotated_df, pvalueCutoff = pValue())
    +getSubnetworkFromIndra(annotated_df, pvalueCutoff = ifelse(is.numeric(pValue()) && !is.null(pValue()), pValue(), stop("Invalid pValue")))
    Suggestion importance[1-10]: 8

    Why: The suggestion addresses a potential runtime error by ensuring that pValue() returns a valid numeric value before being used as an argument in getSubnetworkFromIndra. This validation is crucial for preventing unexpected crashes and improving the robustness of the code.

    8

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

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant