Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing quantms rescoring bugs #462

Merged
merged 14 commits into from
Dec 20, 2024
Merged

Fixing quantms rescoring bugs #462

merged 14 commits into from
Dec 20, 2024

Conversation

ypriverol
Copy link
Member

This PR fixes the following Bug #458

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/quantms branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

Copy link

coderabbitai bot commented Dec 19, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

Copy link

github-actions bot commented Dec 19, 2024

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit e6a811c

+| ✅ 109 tests passed       |+
#| ❔  13 tests were ignored |#
!| ❗  13 tests had warnings |!

❗ Test warnings:

  • pipeline_todos - TODO string in ro-crate-metadata.json: "description": "

    \n \n <source media="(prefers-color-scheme: dark)" srcset="docs/images/nf-core-quantms_logo_dark.png">\n <img alt="nf-core/quantms" src="docs/images/nf-core-quantms_logo_light.png">\n \n

    \n\nGitHub Actions CI Status\nGitHub Actions Linting StatusAWS CICite with Zenodo\nnf-test\n\nNextflow\nrun with conda\nrun with docker\nrun with singularity\nLaunch on Seqera Platform\n\nGet help on SlackFollow on TwitterFollow on MastodonWatch on YouTube\n\n## Introduction\n\nnf-core/quantms is a bioinformatics pipeline that ...\n\n TODO nf-core:\n Complete this sentence with a 2-3 sentence summary of what types of data the pipeline ingests, a brief overview of the\n major pipeline sections and the types of output it produces. You're giving an overview to someone new\n to nf-core here, in 15-20 seconds. For an example, see https://github.com/nf-core/rnaseq/blob/master/README.md#introduction\n\n\n Include a figure that guides the user through the major workflow steps. Many nf-core\n workflows use the "tube map" design for that. See https://nf-co.re/docs/contributing/design_guidelines#examples for examples. \n Fill in short bullet-pointed list of the default steps in the pipeline \n\n1. Read QC (FastQC)\n2. Present QC for raw reads (MultiQC)\n\n## Usage\n\n> [!NOTE]\n> If you are new to Nextflow and nf-core, please refer to this page on how to set-up Nextflow. Make sure to test your setup with -profile test before running the workflow on actual data.\n\n Describe the minimum required steps to execute the pipeline, e.g. how to prepare samplesheets.\n Explain what rows and columns represent. For instance (please edit as appropriate):\n\nFirst, prepare a samplesheet with your input data that looks as follows:\n\nsamplesheet.csv:\n\ncsv\nsample,fastq_1,fastq_2\nCONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz\n\n\nEach row represents a fastq file (single-end) or a pair of fastq files (paired end).\n\n\n\nNow, you can run the pipeline using:\n\n update the following command to include all required parameters for a minimal example \n\nbash\nnextflow run nf-core/quantms \\\n -profile <docker/singularity/.../institute> \\\n --input samplesheet.csv \\\n --outdir <OUTDIR>\n\n\n> [!WARNING]\n> Please provide pipeline parameters via the CLI or Nextflow -params-file option. Custom config files including those provided by the -c Nextflow option can be used to provide any configuration except for parameters; see docs.\n\nFor more details and further functionality, please refer to the usage documentation and the parameter documentation.\n\n## Pipeline output\n\nTo see the results of an example test run with a full size dataset refer to the results tab on the nf-core website pipeline page.\nFor more details about the output files and reports, please refer to the\noutput documentation.\n\n## Credits\n\nnf-core/quantms was originally written by Yasset Perez-Riverol.\n\nWe thank the following people for their extensive assistance in the development of this pipeline:\n\n If applicable, make list of people who have also contributed \n\n## Contributions and Support\n\nIf you would like to contribute to this pipeline, please see the contributing guidelines.\n\nFor further information or help, don't hesitate to get in touch on the Slack #quantms channel (you can join with this invite).\n\n## Citations\n\n Add citation for pipeline after first release. Uncomment lines below and update Zenodo doi and badge at the top of this file. \n If you use nf-core/quantms for your analysis, please cite it using the following doi: 10.5281/zenodo.XXXXXX \n\n Add bibliography of tools and data used in your pipeline \n\nAn extensive list of references for the tools used by the pipeline can be found in the CITATIONS.md file.\n\nYou can cite the nf-core publication as follows:\n\n> The nf-core framework for community-curated bioinformatics pipelines.\n>\n> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.\n>\n> Nat Biotechnol. 2020 Feb 13. doi: 10.1038/s41587-020-0439-x.\n",
  • pipeline_todos - TODO string in README.md: Add citation for pipeline after first release. Uncomment lines below and update Zenodo doi and badge at the top of this file.
  • pipeline_todos - TODO string in README.md: Add bibliography of tools and data used in your pipeline
  • pipeline_todos - TODO string in nextflow.config: Optionally, you can add a pipeline-specific nf-core config at https://github.com/nf-core/configs
  • pipeline_todos - TODO string in nextflow.config: Update the field with the details of the contributors to your pipeline. New with Nextflow version 24.10.0
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in ci.yml: You can customise CI pipeline run tests as required
  • pipeline_todos - TODO string in ci.yml: You can customise CI pipeline run tests as required
  • pipeline_todos - TODO string in main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in base.config: Customise requirements for specific processes.

❔ Tests ignored:

✅ Tests passed:

Run details

  • nf-core/tools version 3.1.0
  • Run at 2024-12-20 12:51:32

@jpfeuffer
Copy link
Collaborator

Could you please describe the bug in summary and how your changes fix that?

@ypriverol
Copy link
Member Author

Could you please describe the bug in summary and how your changes fix that?

For MSGF+ but also any other search engines, the rescoring algorithm was failing for psms without a main score. #.

In the current PR, @daichengxin https://github.com/bigbio/quantms-rescoring/pull/5/files#diff-d6a7c234404ec9682d47dca3803cc1755e81134d9f19b11b97264f46cf339296R254 is now handling better.

@jpfeuffer
Copy link
Collaborator

How can a PeptideHit not have a main score?
This is impossible in idXML.

@daichengxin
Copy link
Collaborator

daichengxin commented Dec 20, 2024

Normal peptidehit:

		<PeptideIdentification score_type="SpecEValue" higher_score_better="false" significance_threshold="0.0" MZ="454.995086669921875" RT="631.48025999999993" spectrum_reference="controllerType=0 controllerNumber=1 scan=2402" >
			<PeptideHit score="5.606986999999999e-08" sequence=".(TMT6plex)AERALTM(Oxidation)YM(Oxidation)LK(TMT6plex)" charge="4" aa_before="K" aa_after="N" start="2366" end="2376" protein_refs="PH_2117" >
				<UserParam type="int" name="MS:1002049" value="58"/>
				<UserParam type="int" name="MS:1002050" value="133"/>
				<UserParam type="float" name="MS:1002052" value="5.606986999999999e-08"/>
				<UserParam type="float" name="MS:1002053" value="2.466499"/>
				<UserParam type="string" name="AssumedDissociationMethod" value="CID"/>
				<UserParam type="string" name="CTermIonCurrentRatio" value="0.5432841"/>
				<UserParam type="string" name="ExplainedIonCurrentRatio" value="0.64345765"/>
				<UserParam type="string" name="MS2IonCurrent" value="398487.38"/>
				<UserParam type="string" name="MeanErrorAll" value="264.05197"/>
				<UserParam type="string" name="MeanErrorTop7" value="312.92484"/>
				<UserParam type="string" name="MeanRelErrorAll" value="173.04474"/>
				<UserParam type="string" name="MeanRelErrorTop7" value="234.3867"/>
				<UserParam type="string" name="NTermIonCurrentRatio" value="0.100173555"/>
				<UserParam type="string" name="NumMatchedMainIons" value="9"/>
				<UserParam type="string" name="StdevErrorAll" value="277.724"/>
				<UserParam type="string" name="StdevErrorTop7" value="296.51938"/>
				<UserParam type="string" name="StdevRelErrorAll" value="341.92044"/>
				<UserParam type="string" name="StdevRelErrorTop7" value="361.8129"/>
				<UserParam type="float" name="calcMZ" value="455.007080078125"/>
				<UserParam type="int" name="pass_threshold" value="1"/>
				<UserParam type="int" name="start" value="2367"/>
				<UserParam type="int" name="end" value="2377"/>
				<UserParam type="string" name="target_decoy" value="decoy"/>
				<UserParam type="string" name="isotope_error" value="0"/>
				<UserParam type="string" name="protein_references" value="unique"/>
				<UserParam type="float" name="MSGF:ScoreRatio" value="0.43609022556391"/>
				<UserParam type="float" name="MSGF:Energy" value="75.0"/>
				<UserParam type="float" name="MSGF:lnEValue" value="-0.902799736258774"/>
				<UserParam type="float" name="MSGF:lnExplainedIonCurrentRatio" value="-0.44074366776915"/>
				<UserParam type="float" name="MSGF:lnNTermIonCurrentRatio" value="-2.299853277801329"/>
				<UserParam type="float" name="MSGF:lnCTermIonCurrentRatio" value="-0.609938842631449"/>
				<UserParam type="float" name="MSGF:lnMS2IonCurrent" value="12.895431107953099"/>
				<UserParam type="float" name="MSGF:MeanErrorTop7" value="312.924840000000017"/>
				<UserParam type="float" name="MSGF:sqMeanErrorTop7" value="9.79219554890256e04"/>
				<UserParam type="float" name="MSGF:StdevErrorTop7" value="296.519380000000012"/>
			</PeptideHit>
			<UserParam type="string" name="MS:1001115" value="2402"/>
		</PeptideIdentification>

A error example without search engines score features, and NumMatchedMainIons is 0. So we should remove it or we will get an error from ms2rescore hander. I added a patch hander to skip them when extracting PSM. But I forget to synchronise the deletion of peptide ids. So in this commit I synchronised the deletion of the peptides

		<PeptideHit score="5.607171999999999e-08" sequence=".(TMT6plex)WGFAK(TMT6plex)VQK(TMT6plex)" charge="3" aa_before="R" aa_after="I" start="335" end="342" protein_refs="PH_6493" >
				<UserParam type="int" name="MS:1002049" value="-6"/>
				<UserParam type="int" name="MS:1002050" value="17"/>
				<UserParam type="float" name="MS:1002052" value="5.607171999999999e-08"/>
				<UserParam type="float" name="MS:1002053" value="2.4330258"/>
				<UserParam type="string" name="AssumedDissociationMethod" value="HCD"/>
				<UserParam type="string" name="CTermIonCurrentRatio" value="0.0"/>
				<UserParam type="string" name="ExplainedIonCurrentRatio" value="0.0"/>
				<UserParam type="string" name="MS2IonCurrent" value="349679.66"/>
				<UserParam type="float" name="MeanErrorAll" value="0.0"/>
				<UserParam type="float" name="MeanErrorTop7" value="0.0"/>
				<UserParam type="float" name="MeanRelErrorAll" value="0.0"/>
				<UserParam type="float" name="MeanRelErrorTop7" value="0.0"/>
				<UserParam type="string" name="NTermIonCurrentRatio" value="0.0"/>
				<UserParam type="int" name="NumMatchedMainIons" value="0"/>
				<UserParam type="float" name="StdevErrorAll" value="0.0"/>
				<UserParam type="float" name="StdevErrorTop7" value="0.0"/>
				<UserParam type="float" name="StdevRelErrorAll" value="0.0"/>
				<UserParam type="float" name="StdevRelErrorTop7" value="0.0"/>
				<UserParam type="float" name="calcMZ" value="551.0147705078125"/>
				<UserParam type="int" name="pass_threshold" value="1"/>
				<UserParam type="int" name="start" value="336"/>
				<UserParam type="int" name="end" value="343"/>
				<UserParam type="string" name="target_decoy" value="decoy"/>
				<UserParam type="string" name="isotope_error" value="1"/>
				<UserParam type="string" name="protein_references" value="unique"/>
			</PeptideHit>

@jpfeuffer
Copy link
Collaborator

Aha! That makes sense!

@ypriverol ypriverol linked an issue Dec 20, 2024 that may be closed by this pull request
@ypriverol ypriverol requested a review from jpfeuffer December 20, 2024 14:39
@ypriverol ypriverol merged commit c6e862a into bigbio:dev Dec 20, 2024
21 checks passed
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.

Another error of quantms ms2rescore and OpenMS
3 participants