Skip to content

Add batch_confounded quality flag - #72

Merged
sr320 merged 1 commit into
mainfrom
claude/sharp-cori-63f12c
Oct 17, 2026
Merged

sr320 merged 1 commit into
mainfrom
claude/sharp-cori-63f12c

Conversation

@sr320

@sr320 sr320 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds batch_confounded to registry/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.
  • Requested by 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) and DECICOMP2025_POMS_AGE (age confounded with challenge year). Both YAMLs say AREE has no such flag.

Consumers checked

  • schemas/study.schema.json: quality_flags is free string items. 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, so batch_confounded costs exactly as much as low_replication, including at the quality_score >= 0.4 high-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_replication
  • Full suite: 615 passed; ruff check src tests clean.

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 to DUPERRET2025_POMS_STARVE.yaml and DECICOMP2025_POMS_AGE.yaml needs one study PR each after this merges.

🤖 Generated with Claude Code

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>
@sr320
sr320 merged commit 4729bab into main Oct 17, 2026
6 checks passed
@sr320
sr320 deleted the claude/sharp-cori-63f12c branch October 17, 2026 01:17
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.

1 participant