Repository navigation
Search cRAP contaminants with the database, flag them and hide them from protein results - #45
Open
t0mdavid-m wants to merge 1 commit into
Open
t0mdavid-m wants to merge 1 commit into
t0mdavid-m wants to merge 1 commit into
Conversation
…esults A new "Add common contaminants (cRAP)" option (on by default) appends the 116 cRAP proteins to the search database with CON__ accessions. With generated decoys, DecoyDatabase reads the FASTA and the contaminants together, so contaminants get decoys too. A FASTA with its own decoys gets contaminant decoys in its decoy style. The database step is now its own method, prepare_search_database(). PSM tables gain a Contaminant column. get_abundance_data() leaves contaminant proteins out by default, so downstream analysis never sees them. The Abundance page flags them and has a "Show contaminants" toggle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D5Wo2FHPpi5a8X6GppNxEk
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: the search database is exactly the user's FASTA. Keratins, trypsin, BSA and other common lab contaminants either go unidentified (and their spectra can be misassigned to real proteins), or turn up as ordinary proteins in the abundance table and the statistics.
After:
CON__before their accessions, the same convention as MaxQuant and ProSE.get_abundance_data()leaves contaminants out unless asked, so Filtering, Imputation, Normalization, Statistics, PCA, heatmaps, volcano and pathway analysis never see them. A protein group counts as a contaminant when any of its members is one.This is ProSE parity item S3 (timosachsenberg/prose-web).
How:
src/common/contaminants.pywrites the prefixed cRAP FASTA and appends FASTAs with pyOpenMSFASTAFile. It also providesis_contaminantanddrop_contaminants.example-data/db/contaminants/crap.fasta. That is a subfolder, so it never shows up as a selectable example database.execution()moved intoWorkflowTest.prepare_search_database(). It writes the derived databases underresults/database/instead of next to the user's FASTA. With contaminants off, it behaves exactly as before.Not in this PR: hiding contaminants by default inside the PSM tables. Those tables are built once at run time, so here the column flags them and the column filter hides them. The Proteins and Identification QC pages from #43 and #42 will pick up the same helper once those land.
Validation:
tests/test_contaminants.pyadds 7 tests. They cover the prefixed cRAP entries, both decoy paths (with a stand-in for DecoyDatabase, since TOPP is not installed here), switching the option off, and abundance data with and without contaminants.pytest test_gui.py tests/passes 126 tests.pylint --errors-onlyreports only E0611 onfrom pyopenms import .... These notices also appear locally on the existingresults_helpers.pyimport, and CI resolves them.Generated by Claude Code