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