Repository navigation
Conversation
fixed diann scan and add ms2rescore arg
# Conflicts: # quantmsutils/__init__.py
# Conflicts: # quantmsutils/__init__.py
WalkthroughThe changes in this pull request primarily involve updating the version of the Changes
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
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🔇 Additional comments (5)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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, andpsm_id_patternparameters enhances the function's flexibility. The default values ofNonemaintain 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_patternand--psm_id_patternoptions 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
ms2rescorefunction signature and docstring have been correctly updated to include the newspectrum_id_patternandpsm_id_patternparameters.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'inremain_colsThe column
'MS2.Scan'is included twice in theremain_colslist. 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
📒 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-pipelinesfrom>=0.0.29to>=0.0.30aligns 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-pipelinesdependency has been consistently updated to>=0.0.30across 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 occurrencesLength 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-pipelinesis 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:
- Review and potentially update other dependencies to their latest stable versions.
- 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.- Use tools like
pip-compileorpoetryto generate arequirements.txtfile 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=columnsThis 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-pipelinesfrom>=0.0.29to>=0.0.30is consistent with the PR objectives. This change ensures that the package will use the latest compatible version ofsdrf-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-pipelinesversion change.✅ Verification successful
LGTM: Version update for sdrf-pipelines has been verified and is safe to merge.
requirements.txtandenvironment.ymlhave been updated tosdrf-pipelines>=0.0.30.- No import statements for
sdrf-pipelineswere found in the codebase, minimizing the risk of compatibility issues.- No deprecated features related to
sdrf-pipelinesare 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 5Length 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 5Length of output: 244
quantmsutils/rescoring/ms2rescore.py (2)
109-114: LGTM! Consistent implementation of new parameters.The new parameters (
log_level,spectrum_id_pattern, andpsm_id_pattern) are correctly added to theconfigdictionary when they are notNone. 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_patternandpsm_id_pattern) and logging level across theparse_cli_arguments_to_configfunction, thems2rescoreCLI command, and thems2rescorefunction. 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 readabilityThe indentation of the function parameters for
diann2mztabhas been adjusted, enhancing readability and consistency with PEP8 standards.
231-231: Corrected slicing ofs_tableto exclude header rowBy adding
[1:], the header row is properly excluded froms_table, preventing it from being treated as data.
268-292: Fixed incorrect logging of ')' as unknown amino acidBy 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 forconvert_to_mztabmethod parametersThe indentation of the
convert_to_mztabmethod parameters has been adjusted for consistency and readability.
486-487: Optimized calculation ofCalculate.Precursor.MzThe calculation of
Calculate.Precursor.Mznow uses vectorized operations, enhancing performance and ensuring correctness of the m/z values.
594-594: Improved formatting of software settings in MTD sub-tableThe 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 modificationsLine wrapping has been adjusted to improve readability when setting variable modifications in the MTD sub-table.
654-655: Reformattedms_runlocation assignment for clarityThe assignment of
ms_runlocations has been reformatted for improved readability.
664-664: Improved string construction for assay referencesThe string construction for assay references has been adjusted for clarity.
728-730: Reformatted protein abundance assay column names for clarityThe construction of column names for protein abundance assays has been reformatted for improved readability.
888-892: Adjusted indentation ofmztab_pehfunction parametersThe indentation of the parameters in the
mztab_pehfunction has been adjusted for consistency and readability.
1127-1133: Added cross-validation of spectrum IDs to ensure data integrityThe new code performs a cross-validation between
MS2.ScanandDIANN-intraIDto detect mismatches, enhancing data integrity by ensuring that the scan IDs align correctly.
fixed bugs when RT matched and DIA-NN Scan matched are inconsistent
|
Related with bigbio/quantms#427 |
Summary by CodeRabbit
New Features
ms2rescoreto specify regex patterns for spectrum and PSM files.Bug Fixes
Improvements
sdrf-pipelines,setuptools, andscikit-learn.