Skip to content

upgrade the sdrf-pipelines 0.0.29 -> 0.0.30 - #29

Merged
ypriverol merged 12 commits into
mainfrom
dev
Oct 10, 2024
Merged

ypriverol merged 12 commits into
mainfrom
dev

Conversation

@ypriverol

@ypriverol ypriverol commented Oct 7, 2024 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added new command-line options for ms2rescore to specify regex patterns for spectrum and PSM files.
    • Introduced cross-validation checks for spectrum IDs in the PSH sub-table to enhance data integrity.
  • Bug Fixes

    • Improved error handling for missing files in the conversion script.
  • Improvements

    • Updated dependency versions to enhance performance and compatibility, including sdrf-pipelines, setuptools, and scikit-learn.
    • Enhanced the performance of precursor mass calculations through optimized data processing.
    • Updated module version number for clarity.

@coderabbitai

coderabbitai Bot commented Oct 7, 2024 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes in this pull request primarily involve updating the version of the sdrf-pipelines dependency across multiple files, including environment.yml, requirements.txt, and setup.py, changing it from >=0.0.29 to >=0.0.30. Additionally, there are modifications to the quantmsutils module's version number and several enhancements to the functionality and error handling in the diann2mztab.py and ms2rescore.py scripts, including updates to function signatures and the addition of new command-line interface options.

Changes

File Path Change Summary
environment.yml Updated sdrf-pipelines version from >=0.0.29 to >=0.0.30; minor formatting adjustment.
requirements.txt Updated sdrf-pipelines version from 0.0.29 to 0.0.30; added scikit-learn and setuptools.
setup.py Updated sdrf-pipelines version from >=0.0.29 to >=0.0.30; added setuptools.
quantmsutils/init.py Updated __version__ from "0.0.11" to "0.0.12".
quantmsutils/diann/diann2mztab.py Adjusted function signatures for consistency; renamed DataFrame columns; optimized precursor mass calculation; added error handling; introduced cross-validation check for spectrum IDs; formatted code.
quantmsutils/rescoring/ms2rescore.py Updated parse_cli_arguments_to_config function to include new parameters; added CLI options for spectrum and PSM ID patterns; enhanced logging control; maintained existing error handling for output path.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Config
    participant Script

    User->>CLI: Run ms2rescore with options
    CLI->>Config: Parse CLI arguments
    Config->>Script: Update configuration with new parameters
    Script->>Script: Execute processing with updated config
    Script-->>User: Return results
Loading

🐰 "In the meadow where bunnies hop,
A version update makes us stop.
With sdrf-pipelines now so bright,
Our scripts will run with pure delight!
New features added, bugs made few,
Hooray for changes, hip-hip-hooray too!" 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7dec954 and 7b58774.

📒 Files selected for processing (1)
  • recipe/meta.yaml (2 hunks)
🧰 Additional context used
🔇 Additional comments (5)
recipe/meta.yaml (5)

4-4: Significant version bump noted. Please provide more context.

The package version has been updated from "0.0.3" to "0.0.12", which is a substantial increase. While this aligns with the upgrade mentioned in the PR title, it would be helpful to have more information about the changes that warranted such a significant version bump.

Could you please provide a changelog or summary of the major changes introduced in this version update?


22-22: Good addition of setuptools as a host requirement.

Adding setuptools to the host requirements is a good practice. This ensures that the package can be built properly during the conda package creation process.


24-25: Consider maintaining version constraints for all dependencies.

While updating dependency versions is good for security and bug fixes, I noticed that version constraints for click and pandas have been removed. This might lead to compatibility issues with future versions. Consider adding appropriate version constraints for these packages.

For pydantic, you've pinned it to a specific version (1.10.14). While this ensures consistency, it might prevent automatic updates to newer versions. Consider using a more flexible version specifier like >=1.10.14,<2.0.0 unless there's a specific reason for this exact version.

The updates for sdrf-pipelines, ms2rescore, and psm-utils look good and align with the PR objectives.

Could you explain the rationale behind removing version constraints for click and pandas, and pinning pydantic to an exact version?

Also applies to: 27-27, 30-30, 32-33


28-29: New dependencies added. Please provide context for their inclusion.

The addition of new dependencies (deeplc, ms2pip, deeplcretrainer, protobuf, pyarrow, pygam, scipy, and scikit-learn) suggests new functionalities or improvements in the package. Most of these have specific version constraints, which is good for reproducibility.

The comment for protobuf explaining its compatibility with tensorboard is helpful. Could you provide similar context for the other new dependencies? This would help in understanding the new features or improvements they enable.

Can you elaborate on the new features or improvements that necessitated these additional dependencies?

Also applies to: 31-31, 34-34, 36-39


4-4: Overall, the changes look good but require more context.

The updates to the meta.yaml file indicate a significant upgrade to the quantms-utils package, including a version bump and numerous dependency changes. While most changes seem reasonable, it would be beneficial to have:

  1. A comprehensive changelog detailing the changes from version 0.0.3 to 0.0.12.
  2. Explanations for the removal of version constraints on some dependencies and the addition of new ones.
  3. Information about the new features or improvements enabled by the added dependencies.

This additional context will help in understanding the full scope of the upgrade and ensure that all changes are intentional and necessary.

Could you provide a detailed changelog and address the points mentioned above to give a clearer picture of this upgrade?

Also applies to: 22-22, 24-25, 27-34, 36-39


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 and nitpick comments (4)
quantmsutils/rescoring/ms2rescore.py (3)

35-37: LGTM! Consider adding parameter descriptions.

The addition of log_level, spectrum_id_pattern, and psm_id_pattern parameters enhances the function's flexibility. The default values of None maintain backward compatibility.

Consider adding parameter descriptions in the function's docstring to improve documentation.


283-292: LGTM! Consider clarifying the default behavior in help text.

The addition of --spectrum_id_pattern and --psm_id_pattern options enhances the CLI's flexibility. The default value "(.*)" maintains backward compatibility.

Consider clarifying in the help text that the default pattern "(.*)" matches the entire string. For example:

help="Regex pattern to extract index or scan number from spectrum file. Requires at least one capturing group. Default '(.*)' matches the entire string.",

313-314: LGTM! Consider enhancing parameter descriptions.

The ms2rescore function signature and docstring have been correctly updated to include the new spectrum_id_pattern and psm_id_pattern parameters.

Consider enhancing the parameter descriptions in the docstring to provide more context. For example:

:param spectrum_id_pattern: Regex pattern to extract index or scan number from spectrum file. Default '(.*)' matches the entire string.
:param psm_id_pattern: Regex pattern to extract index or scan number from PSM file. Default '(.*)' matches the entire string.

Also applies to: 336-337

quantmsutils/diann/diann2mztab.py (1)

Line range hint 453-466: Redundant inclusion of 'MS2.Scan' in remain_cols

The column 'MS2.Scan' is included twice in the remain_cols list. This redundancy is unnecessary and could be removed to prevent potential confusion.

Apply this diff to remove the redundant entry:

       "Precursor.Quantity",
       "Global.PG.Q.Value",
-      "MS2.Scan"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c7913a5 and 2f9ab75.

📒 Files selected for processing (6)
  • environment.yml (1 hunks)
  • quantmsutils/init.py (1 hunks)
  • quantmsutils/diann/diann2mztab.py (22 hunks)
  • quantmsutils/rescoring/ms2rescore.py (6 hunks)
  • requirements.txt (1 hunks)
  • setup.py (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • quantmsutils/init.py
  • requirements.txt
🧰 Additional context used
🔇 Additional comments (17)
environment.yml (1)

8-8: Version update for sdrf-pipelines looks good.

The update of sdrf-pipelines from >=0.0.29 to >=0.0.30 aligns with the PR objective. This change ensures that the project will use the latest version of the sdrf-pipelines package.

To ensure consistency across the project, let's verify if this version update is reflected in other configuration files:

✅ Verification successful

sdrf-pipelines version update verified successfully.

The sdrf-pipelines dependency has been consistently updated to >=0.0.30 across all relevant configuration files (environment.yml, setup.py, requirements.txt).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if sdrf-pipelines version is consistently updated across the project

# Test 1: Check setup.py
echo "Checking setup.py:"
rg "sdrf-pipelines" setup.py

# Test 2: Check requirements.txt
echo "Checking requirements.txt:"
rg "sdrf-pipelines" requirements.txt

# Note: The results should show version >=0.0.30 in all occurrences

Length of output: 228

setup.py (2)

Line range hint 44-62: Consider updating other dependencies and adopting a consistent version pinning strategy.

While updating sdrf-pipelines is good, it might be beneficial to review and potentially update other dependencies as well. Additionally, consider adopting a consistent version pinning strategy across all dependencies to ensure better reproducibility and easier maintenance.

Here are some suggestions:

  1. Review and potentially update other dependencies to their latest stable versions.
  2. Consider using a consistent version pinning strategy. For example, you could use == for all dependencies or >= with an upper bound (e.g., >=1.0.0,<2.0.0) to allow for compatible updates while avoiding major version changes.
  3. Use tools like pip-compile or poetry to generate a requirements.txt file with pinned versions for reproducibility.

To assist with this process, you can run the following script to check for outdated dependencies:

#!/bin/bash
# Description: Check for outdated dependencies

# Test: List outdated dependencies
pip list --outdated --format=columns

This will help identify which packages have newer versions available, allowing you to make informed decisions about updates.


48-48: LGTM: Version update for sdrf-pipelines looks good.

The update of sdrf-pipelines from >=0.0.29 to >=0.0.30 is consistent with the PR objectives. This change ensures that the package will use the latest compatible version of sdrf-pipelines.

To ensure this update doesn't introduce any compatibility issues, please run the following script:

This script will help identify any potential issues or necessary updates related to the sdrf-pipelines version change.

✅ Verification successful

LGTM: Version update for sdrf-pipelines has been verified and is safe to merge.

  • requirements.txt and environment.yml have been updated to sdrf-pipelines>=0.0.30.
  • No import statements for sdrf-pipelines were found in the codebase, minimizing the risk of compatibility issues.
  • No deprecated features related to sdrf-pipelines are in use.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any compatibility issues or necessary updates in conjunction with sdrf-pipelines 0.0.30

# Test 1: Check if sdrf-pipelines 0.0.30 introduces any breaking changes
rg --type python -g '!setup.py' 'from sdrf_pipelines import|import sdrf_pipelines'

# Test 2: Verify if any other dependencies have hard dependencies on sdrf-pipelines
rg --type python 'sdrf-pipelines' requirements.txt environment.yml

# Test 3: Check for any usage of deprecated features from sdrf-pipelines
rg --type python 'deprecated|DEPRECATED' -C 5

Length of output: 540


Script:

#!/bin/bash
# Description: Check for any compatibility issues or necessary updates in conjunction with sdrf-pipelines 0.0.30

# Test 1: Check if sdrf-pipelines 0.0.30 is imported elsewhere in the codebase
rg 'from sdrf_pipelines import|import sdrf_pipelines' --glob '!setup.py'

# Test 2: Verify if any other dependencies have hard dependencies on sdrf-pipelines in requirements files
rg 'sdrf-pipelines' requirements.txt environment.yml

# Test 3: Check for any usage of deprecated features in the codebase
rg 'deprecated|DEPRECATED' -C 5

Length of output: 244

quantmsutils/rescoring/ms2rescore.py (2)

109-114: LGTM! Consistent implementation of new parameters.

The new parameters (log_level, spectrum_id_pattern, and psm_id_pattern) are correctly added to the config dictionary when they are not None. This implementation is consistent with the function's existing structure and maintains the expected behavior.


Line range hint 35-371: Overall, excellent enhancements to configurability and flexibility.

The changes in this file consistently implement new parameters for regex patterns (spectrum_id_pattern and psm_id_pattern) and logging level across the parse_cli_arguments_to_config function, the ms2rescore CLI command, and the ms2rescore function. These modifications enhance the script's flexibility and configurability while maintaining backward compatibility.

The implementation is solid, with only minor suggestions for improving documentation. Great job on these updates!

quantmsutils/diann/diann2mztab.py (12)

47-54: Improved indentation for function parameters enhances readability

The indentation of the function parameters for diann2mztab has been adjusted, enhancing readability and consistency with PEP8 standards.


231-231: Corrected slicing of s_table to exclude header row

By adding [1:], the header row is properly excluded from s_table, preventing it from being treated as data.


268-292: Fixed incorrect logging of ')' as unknown amino acid

By adding and aa != ")", the code avoids incorrectly logging the closing parenthesis as an unknown amino acid when outside of a modification.


370-376: Improved indentation for convert_to_mztab method parameters

The indentation of the convert_to_mztab method parameters has been adjusted for consistency and readability.


486-487: Optimized calculation of Calculate.Precursor.Mz

The calculation of Calculate.Precursor.Mz now uses vectorized operations, enhancing performance and ensuring correctness of the m/z values.


594-594: Improved formatting of software settings in MTD sub-table

The software settings entries have been reformatted for clarity and readability.

Also applies to: 597-597, 600-600, 603-603, 612-612, 615-615


638-638: Adjusted line wrapping for variable modifications

Line wrapping has been adjusted to improve readability when setting variable modifications in the MTD sub-table.


654-655: Reformatted ms_run location assignment for clarity

The assignment of ms_run locations has been reformatted for improved readability.


664-664: Improved string construction for assay references

The string construction for assay references has been adjusted for clarity.


728-730: Reformatted protein abundance assay column names for clarity

The construction of column names for protein abundance assays has been reformatted for improved readability.


888-892: Adjusted indentation of mztab_peh function parameters

The indentation of the parameters in the mztab_peh function has been adjusted for consistency and readability.


1127-1133: Added cross-validation of spectrum IDs to ensure data integrity

The new code performs a cross-validation between MS2.Scan and DIANN-intraID to detect mismatches, enhancing data integrity by ensuring that the scan IDs align correctly.

@ypriverol

Copy link
Copy Markdown
Contributor Author

Related with bigbio/quantms#427

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.

3 participants