Repository navigation
Link three more SGDP genomes on a recorded genotype check, and report whose files reach no donor (#718) - #739
Conversation
… whose files reach no donor (#718) The SGDP importer linked a sample to its donor only where SGDP's sex and T2T_CHRY's karyotype agree, leaving four genomes out. A genotype search (each sample's chr22 gVCF against every genome of SGDP's and HGDP's public releases) confirms three pairings and finds none for S_Naxi-2. - sources/sgdp_genotype_checks.yaml records the measurement; the importer links a sample its sex check cannot confirm where the record matches it to the genome its tables pair it with, and a recorded non-match leaves a sample out. Both checks are declared in code_rules.IDENTITY_CHECKS. - Each import writes every sample's checks to outcomes.json beside its evidence, which no evidence reader takes as evidence. - Reconcile reports, per dataset, whether each file's samples all reach a donor (entities.donor_reach) and lists each sample without one with the checks its import recorded (entities.samples.no_donor). - docs/studies/sgdp-genome-identity.md records the chain, the checks, the method and each genome's verdict; contract 2.10 amended. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS
…the checks, U reviewed (#718) - The genotype record's scores are bcftools gtcheck mismatch counts per reference (#738 makes them re-runnable); the note gives the method. - A blank table cell disagrees with no other: tables naming two genomes are tables_disagree, none no_sgdp_id; two stated karyotypes make the sex check karyotypes_disagree, which a genotype record still confirms. - The pairing is its own field, apart from what each check found. - The record stays tied to its catalog (#737 would pin files by md5). - SGDP's U is authored as "reviewed, no claim" (declares nothing). - outcomes.json names its source, one outcome per source per sample; a row naming no sample or its own source is refused when written. - Files per sample list are counted by the samples report; each list's members are parsed once; the record loads through map_document. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>
There was a problem hiding this comment.
🟡 Changes recommended
Missing-donor diagnostics omit sample identifiers when no importer outcome exists, leaving affected samples counted but unidentified.
1 open issue
What changed in this PR
Extends SGDP donor linking to accept recorded genotype matches and adds donor-reach reporting to reconciliation, addressing #718.
Changes:
- Adds genotype-based identity checks and per-sample import outcomes.
- Reports file-level donor reach and missing-donor diagnostics.
- Updates rule reporting, tests, and identity-check documentation.
| File | Description |
|---|---|
| tests/test_sgdp_entities.py | Tests genotype checks, outcomes, and donor reach. |
| tests/test_entities.py | Tests donor-reach counts and diagnostics. |
| tests/test_code_rules.py | Validates identity-check declarations. |
| src/meta_disco/sources/sgdp_genotype_checks.yaml | Records four samples’ genotype verdicts. |
| src/meta_disco/sgdp_entities.py | Applies identity checks and writes outcomes. |
| src/meta_disco/rules/value_map.yaml | Treats SGDP’s unknown sex as reviewed without a claim. |
| src/meta_disco/reconcile.py | Passes file counts into entity reconciliation. |
| src/meta_disco/reconcile_samples.py | Counts files by dataset and sample list. |
| src/meta_disco/reconcile_entities.py | Builds donor-reach and missing-donor reports. |
| src/meta_disco/entity_evidence.py | Reads and writes outcome sidecars. |
| src/meta_disco/code_rules.py | Declares sex and genotype identity checks. |
| scripts/generate_rules_report.py | Includes identity checks in rule reports. |
| Makefile | Updates SGDP import help and comments. |
| docs/studies/sgdp-genome-identity.md | Documents identity evidence, methods, and verdicts. |
| docs/claims-contract.md | Updates linking and reporting requirements. |
| CLAUDE.md | Updates SGDP architecture guidance. |
Review effort: Balanced
…mporter gave some (#718) Copilot: no_donor counted a sample no importer spoke of but did not name it, short of what contract 2.10 and the plan say. Each dataset's entry is now the list of those samples. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The new donor links depend on manually recorded genotype measurements that require domain-expert validation and are not yet reproducible through repository tooling.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
…es; kill surviving mutations (#718) - outcome() raises where the tables name two genomes and the record's is neither, as its docstring said. - A record's sample key must be a non-empty string. - Docstrings and notes say what confirmed_by, no_donor and the record's header actually cover. - Tests: files counted per file not per list; a recorded match for a genome SGDP's file lacks links nothing; a record entry for a sample naming no genome, or two genomes neither its own, is refused; an empty sgdp_id is refused; a sample whose sources name two donors reaches none. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The additional donor links rely on manually recorded genotype measurements that need domain-expert validation, with reproducible measurement tooling deferred to #738.
No open issues 🎉
Review effort: Balanced
…with SGDP generation 20261023T054318Z (#718) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS Co-authored-by: cc-claude-tools <cc-claude-tools@clevercanary.com>

Closes #718
What changed
src/meta_disco/sources/sgdp_genotype_checks.yamlrecords abcftools gtcheckrun. Each sample's chr22 gVCF was compared with every genome of SGDP's public release (278) and HGDP's (929). For each sample the record holds the genome it matched (or none) and the two best scores per release.make import-sgdp-entitieslinks a sample when either check passes:S_Palestinian-2becomes donorhgdp:HGDP00725, sexM;S_Norwegian-1andB_Australian-3get donors with no sex.S_Naxi-2stays out: it isn't in SGDP's file, and it matches no public genome.code_rules.IDENTITY_CHECKS(sgdp_sex_agrees,sgdp_genotype_matches). They are listed in the rules report.outcomes.jsonbeside its evidence: the pairing, each check's finding, and which checks confirmed it. No evidence reader takes the file as evidence (it isn't.ndjson).entities.donor_reach, per dataset: files with samples, files whose every sample has a donor, files with one sample and no donor, and files with several samples where some have no donor;entities.samples.no_donor: each sample a file names that has no donor, with what its importer recorded.tables_disagree.karyotypes_disagree, which the genotype record can still confirm.Usex gets an authored value-map row,phenotypic_sex.sgdp_u(declares: {}: reviewed, and no claim).docs/studies/sgdp-genome-identity.md, a new note: the chain from file to person, what T2T_CHRY holds, both checks, the method, the controls, and each genome's verdict.Why
#559 linked a sample only where SGDP's sex and T2T_CHRY's karyotype agree, because the sample-to-genome pairing rests on one table. Four genomes failed that check. A genotype comparison answers the real question — is this the same person? — directly. Three of the four are, and one isn't anyone in the public releases.
For
S_Palestinian-2, the content sides with SGDP'sM: the sample's own chrX shows one X. That makes T2T_CHRY'sXXthe odd one out. I think it may be a male cell line that lost its Y; that isn't checked.Assumptions I made
sgdp_idandmatched. The scores are there for a person, and only the record's keys are checked, not their values.anvil15). The import refuses another catalog until a person confirms the record still holds there. SGDP genotype record: pin the measured gVCFs by md5 instead of the catalog #737 would replace this with pinning each measured gVCF by md5.gtcheckcan't read a gVCF directly (its ALTs carry<NON_REF>). So each sample is written as plain genotypes at the reference's sites, with reference blocks read as 0/0, before scoring.Udonors get no sex.How to verify
Definition of done from #718:
reconcile_report.jsonmatches what this issue leaves. Step 3.docs/studies/sgdp-genome-identity.md§4–§5. You should seegtcheckmismatches:S_Naxi-2's best match is 2.6% (S_Naxi-3), so it has none.make import-sgdp-entities ARGS="--entity-root /tmp/718_e"(network; or omitARGSto write the shared root). It should print:outcomes.jsonwith one entry per sample.make reconcile, orscripts/reconcile.py --run <copy of a run> --entity-root <root holding anvil, anvil_published and the new sgdp>). Inreconciled/reconcile_report.json:entities.donor_reach.ANVIL_T2T_CHRY.one_sample_without_donoris 118 (was 448),S_Naxi-2's single-sample files;several_samples_some_without_donoris 62,310: the joint-called files and the SGDP workspace tars, all of which nameS_Naxi-2;entities.samples.no_donor.ANVIL_T2T_CHRYlistssimons_data_sample_273with its outcome;donors.ndjson.gzgainshgdp:HGDP00725,sgdp:S_Norwegian-1andsgdp:B_Australian-3;make rules-reportlistssgdp_sex_agreesandsgdp_genotype_matchesunder the sample and donor rules.🤖 Generated with Claude Code
https://claude.ai/code/session_01VF7tbFa5ZTmYWZ6JWKiBBS
🐦 Built with cc-claude-tools