Skip to content

[fix] write out same set of meta values in MSGF - #7713

Merged
timosachsenberg merged 5 commits into
developfrom
fix_msgf
Nov 28, 2024
Merged

timosachsenberg merged 5 commits into
developfrom
fix_msgf

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Nov 28, 2024 •

Copy link
Copy Markdown
Contributor

User description

Description

MSGF doesn't write out all meta values. Add dummy entries if they are missing.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out

Advanced commands (admins / reviewer only)

Click to expand
  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).


PR Type

Bug fix, Tests


Description

  • Added dummy meta values for missing entries in PeptideHit to ensure all necessary meta values are present.
  • Improved error handling by adding warnings for missing or NaN values in PercolatorFeatureSetHelper.cpp.
  • Updated file paths for database and spectra inputs in multiple test output files to reflect new directory structure.
  • Added new meta values for PeptideHit entries in test output files to align with changes in the main code.

Changes walkthrough 📝

Relevant files
Bug fix
PercolatorFeatureSetHelper.cpp
Add dummy meta values and improve error handling                 

src/openms/source/ANALYSIS/ID/PercolatorFeatureSetHelper.cpp

  • Added dummy meta values for missing entries in PeptideHit.
  • Changed logic to handle missing NumMatchedMainIons and related meta
    values.
  • Improved error handling with warnings for missing or NaN values.
  • +61/-50 
    Tests
    PSMFeatureExtractor_1_out.idXML
    Update file paths and add meta values in test output         

    src/tests/topp/PSMFeatureExtractor_1_out.idXML

  • Updated file paths for database and spectra inputs.
  • Added new meta values for PeptideHit entries.
  • +16/-7   
    PSMFeatureExtractor_2_out.mzid
    Update metadata and paths in mzIdentML test output             

    src/tests/topp/PSMFeatureExtractor_2_out.mzid

  • Updated creation date and software version.
  • Updated file paths for database and spectra inputs.
  • Added new meta values for PeptideHit entries.
  • +19/-10 
    PSMFeatureExtractor_3_out.idXML
    Update file paths and add meta values in test output         

    src/tests/topp/PSMFeatureExtractor_3_out.idXML

  • Updated file paths for database and spectra inputs.
  • Added new meta values for PeptideHit entries.
  • +34/-7   
    MSGFPlusAdapter_1_out.idXML
    Update file paths and add meta values in test output         

    src/tests/topp/THIRDPARTY/MSGFPlusAdapter_1_out.idXML

  • Updated file paths for database and spectra inputs.
  • Added new meta values for PeptideHit entries.
  • +33/-6   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @github-actions

    Copy link
    Copy Markdown
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

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

    Hardcoded Values
    The PR introduces hardcoded dummy values for missing meta values in MS-GF+ PSMs. This approach might not be suitable for all use cases and could lead to misleading analysis results.

    Logging Level
    The use of a warning log level for every missing meta value might be excessive, especially if this is a common scenario. Consider adjusting the log level or implementing a more nuanced logging strategy.

    @github-actions

    github-actions Bot commented Nov 28, 2024 •

    Copy link
    Copy Markdown
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    ✅ Ensure numeric meta values are set using numeric types instead of strings
    Suggestion Impact:The commit replaced string literals for numeric meta values with actual numeric types, as suggested, to ensure type consistency.

    code diff:

    -            hit->setMetaValue("MeanErrorAll", "0.0");
    -            hit->setMetaValue("StdevErrorAll", "0.0");
    -            hit->setMetaValue("MeanErrorTop7", "0.0");
    -            hit->setMetaValue("StdevErrorTop7", "0.0");
    -            hit->setMetaValue("MeanRelErrorAll", "0.0");
    -            hit->setMetaValue("StdevRelErrorAll", "0.0");
    -            hit->setMetaValue("MeanRelErrorTop7", "0.0");
    -            hit->setMetaValue("StdevRelErrorTop7", "0.0");
    +            hit->setMetaValue("MeanErrorAll", 0.0);
    +            hit->setMetaValue("StdevErrorAll", 0.0);
    +            hit->setMetaValue("MeanErrorTop7", 0.0);
    +            hit->setMetaValue("StdevErrorTop7", 0.0);
    +            hit->setMetaValue("MeanRelErrorAll", 0.0);
    +            hit->setMetaValue("StdevRelErrorAll", 0.0);
    +            hit->setMetaValue("MeanRelErrorTop7", 0.0);
    +            hit->setMetaValue("StdevRelErrorTop7", 0.0);

    Replace string literals for numeric meta values with actual numeric types to ensure
    type consistency and avoid potential type conversion issues later in the code.

    src/openms/source/ANALYSIS/ID/PercolatorFeatureSetHelper.cpp [44-51]

    -hit->setMetaValue("MeanErrorAll", "0.0");
    -hit->setMetaValue("StdevErrorAll", "0.0");
    -hit->setMetaValue("MeanErrorTop7", "0.0");
    -hit->setMetaValue("StdevErrorTop7", "0.0");
    -hit->setMetaValue("MeanRelErrorAll", "0.0");
    -hit->setMetaValue("StdevRelErrorAll", "0.0");
    -hit->setMetaValue("MeanRelErrorTop7", "0.0");
    -hit->setMetaValue("StdevRelErrorTop7", "0.0");
    +hit->setMetaValue("MeanErrorAll", 0.0);
    +hit->setMetaValue("StdevErrorAll", 0.0);
    +hit->setMetaValue("MeanErrorTop7", 0.0);
    +hit->setMetaValue("StdevErrorTop7", 0.0);
    +hit->setMetaValue("MeanRelErrorAll", 0.0);
    +hit->setMetaValue("StdevRelErrorAll", 0.0);
    +hit->setMetaValue("MeanRelErrorTop7", 0.0);
    +hit->setMetaValue("StdevRelErrorTop7", 0.0);
    Suggestion importance[1-10]: 8

    Why: Using numeric types directly instead of string representations for setting meta values avoids unnecessary type conversions and potential errors. This change enhances data integrity and performance.

    8

    @timosachsenberg

    Copy link
    Copy Markdown
    Contributor Author

    /describe

    @qodo-code-review

    Copy link
    Copy Markdown
    Contributor

    PR-Agent was enabled for this repository, but no eligible user found. Please link your git user with your CodiumAI identity here.

    @github-actions

    Copy link
    Copy Markdown
    Contributor

    PR Description updated to latest commit (286d47d)

    @timosachsenberg timosachsenberg changed the title fix for MSGF [fix] write out same set of meta values in MSGF Nov 28, 2024
    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.

    2 participants