Repository navigation
Add batch_confounded quality flag - #72
Merged
Merged
Conversation
Treatment contrast fully confounded with a processing batch (sequencing run, MS acquisition batch, extraction batch). DUPERRET2025_POMS_STARVE (diet vs MS batch) and DECICOMP2025_POMS_AGE (age vs challenge year) both note that AREE had no such flag. Validation reads the vocabulary, so the term validates with no code change. quality_score counts every flag equally (1 - n/5), so it costs the same as low_replication; tests pin both. No registered study declares it yet, so no existing score changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
batch_confoundedtoregistry/controlled_vocabularies/quality_flags.yaml: the treatment contrast is fully confounded with a processing batch (sequencing run, MS acquisition batch, extraction batch), so the treatment effect can't be separated from batch.DUPERRET2025_POMS_STARVE(fed and starved samples acquired in separate MS batches months apart, see [study] DUPERRET2025_POMS_STARVE (MTBLS13313): reanalyzed from Table S12, QC failed #70) andDECICOMP2025_POMS_AGE(age confounded with challenge year). Both YAMLs say AREE has no such flag.Consumers checked
schemas/study.schema.json:quality_flagsis freestringitems. Nothing to change.src/intake/schema_validate.py: checks flags against the vocabulary, so the new term validates with no code change.src/harmonize/schema.py::compute_quality_flags: passes study-level flags through, so the flag reaches every evidence record from a study that declares it.src/prioritize/scoring.py/cross_species.py:quality_score = 1 - n_flags/5. Every flag weighs the same, sobatch_confoundedcosts exactly as much aslow_replication, including at thequality_score >= 0.4high-priority gate.Scoring effect
No registered study declares the flag yet, so no existing score changes. Documented in
docs/interpreting_candidate_scores.md.Tests
test_batch_confounded_quality_flag_validates: a study that declares the flag validates.test_batch_confounded_costs_at_least_as_much_quality_as_low_replicationruff check src testsclean.Follow-up
Under
check_study_scope, a study PR can't touch shared files, and this PR can't touch study files. Adding the flag toDUPERRET2025_POMS_STARVE.yamlandDECICOMP2025_POMS_AGE.yamlneeds one study PR each after this merges.🤖 Generated with Claude Code