Remove mix-max dead code and --method CLI flag - #30
Conversation
Eliminates all mix-max confidence estimation code (MixmaxConfidence class, mixmax/estimate_pi0/calculate_mixmax_qval functions) that was left behind after the method was removed. Also drops the --method CLI flag whose only remaining choice was "tdc", removes the method parameter from assign_confidence(), cleans up unused imports (itertools, ClassVar, re, read_txt, read_pepxml), and fixes test fixtures to use absolute paths so tests pass regardless of working directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Install duckdb and pyarrow to enable previously-skipped tests. Remove stray method= kwargs from test_duckdb.py and test_parquet.py, and replace the now-defunct test_duckdb_backend_invalid_method_raises with test_duckdb_backend_invalid_backend_raises (tests unknown backend name). Also fix parse_psms_txt in utils.py to skip the pyarrow engine when skip_line=True, since pyarrow does not support skiprows and would misidentify column names in files with a leading comment row (MSAmanda). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the previously-deprecated MixMax confidence/q-value implementation and simplifies the confidence estimation API/CLI to the single remaining method (TDC), while updating tests and fixtures accordingly.
Changes:
- Deleted MixMax-related code paths (
MixmaxConfidenceand mixmax q-value helpers) and removed method-based dispatch inPsmDataset.assign_confidence(). - Removed the no-op
--method/-mCLI flag and updated CLI dispatch to match the new API. - Updated unit tests/fixtures to remove
method="tdc"usage and to use a stableDATA_DIRpath independent of the current working directory.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit_tests/test_writers.py | Removes method="tdc" from confidence assignment calls in writer tests. |
| tests/unit_tests/test_qvalues.py | Removes MixMax imports and MixMax test coverage; keeps TDC tests. |
| tests/unit_tests/test_parquet.py | Removes method="tdc" from Parquet writer tests. |
| tests/unit_tests/test_edge_cases.py | Removes method="tdc" from edge-case confidence assignment tests. |
| tests/unit_tests/test_duckdb.py | Updates backend validation test to check unknown backend rather than invalid method. |
| tests/unit_tests/test_confidence.py | Removes MixMax confidence tests and method="tdc" usage; keeps TDC tests. |
| tests/conftest.py | Introduces DATA_DIR fixture root to make test data paths robust to pytest CWD. |
| crema/utils.py | Ensures parse_psms_txt doesn’t use the pyarrow engine when skiprows is required. |
| crema/qvalues.py | Removes MixMax q-value estimation functions, leaving TDC and helper _fdr2qvalue. |
| crema/params.py | Removes the --method/-m CLI argument. |
| crema/dataset.py | Removes method dispatch and always instantiates TdcConfidence for pandas backend; preserves backend selection. |
| crema/crema.py | Stops passing args.method into assign_confidence now that the flag/parameter is removed. |
| crema/confidence.py | Removes the MixmaxConfidence class implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@wsnoble larger question for you regarding the 'method' parameter. When Crema supported mixmax and TDC, it made sense to have this parameter. I also understand why removing this parameter makes sense if we remove mixmax since it's useless code. However, I think it might make sense for us to leave it in b/c it gives us the framework to add other methods in Crema. I remember at one point in time there was a discussion about putting some of Uri's other methods in Crema. |
If we ever need to reinstate this code, it will be available in the git history. I would prefer to avoid maintaining unused code. |
MSAmanda output can include several '#'-prefixed comment/settings lines before the header, not just a single "#version" line. Generalize parse_psms_txt's skip_line parameter to accept a count of leading rows to skip, and have the MSAmanda parser count all leading '#' lines rather than checking for a single hardcoded "#version" prefix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Pushed a fix for the MSAmanda comment-line issue raised above (1ec1d73). Problem: Fix:
Note: I initially tried having Test: added a |
|
Alright, this looks good to me except for one thing. Specifically the CHANGELOG.md inside of the docs folder has not been updated to reflect the changes in this PR. One that is updated with something like "Remove mix-max dead code and --method CLI flag" we can merge. |
… flag Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
MixmaxConfidenceclass (~177 lines) fromconfidence.py— the mix-max method was previously removed but its class was left behindmixmax(),estimate_pi0(), andcalculate_mixmax_qval()fromqvalues.py(~211 lines) — these only served mix-max--method/-mCLI flag fromparams.py— its only remaining choice was"tdc", making it a no-opmethodparameter fromPsmDataset.assign_confidence()anddataset.py's internal dispatch dict, replacing method-based dispatch with a directTdcConfidence(...)call (thebackendparameter added in PR29 is preserved)itertoolsinutils.py,ClassVarindataset.py,rein three parsers,read_txt/read_pepxmlinmsfragger.pyPath(__file__).parent.parent / "data"so tests pass regardless of the working directory from which pytest is runTest plan
pytest tests/→ 88 passed, 2 skippedmethod="tdc"kwargs removed from all test files (test_confidence.py,test_edge_cases.py,test_writers.py)test_qvalues.pyortest_confidence.pynumbaimport retained inqvalues.py— still used by_fdr2qvalue🤖 Generated with Claude Code