Skip to content

Drop GWAS variants on uninterpretable-id LD-panel entries - #585

Merged
danielnachun merged 2 commits into
StatFunGen:mainfrom
Yining97:ld-drop-uninterpretable-panel-ids
Aug 30, 2026
Merged

danielnachun merged 2 commits into
StatFunGen:mainfrom
Yining97:ld-drop-uninterpretable-panel-ids

Conversation

@Yining97

Copy link
Copy Markdown
Contributor

Some LD panels (ADSP R5) name ~3% of variants with a tag where an allele belongs — chr21:13988152:INS:T whose real alleles are A/AT — so the id no longer encodes its alleles even though the A1/A2 columns are correct. Harmonisation keys on the allele columns and keeps the variant; the id-string LD lookup (.ldFromSketchMatch) then can't find it and aborts (.fmLdFromSketch / kriging prefilter: N variant id(s) not present in the LD sketch panel). R4 has none of these, so only R5 fails.

The panel's alleles are trustworthy but the summary statistics are not: at such a position the GWAS carries no way to say which orientation was measured, so aligning its z-score would be a guess that can sign-flip a real signal. Dropping is the only choice that can't be wrong — the same reasoning #576 already applies to flip-pairs.

  • New .ldSketchIdUsable predicate: an id is usable unless it parses to a non-DNA allele (tests for DNA, not the literal INS/DEL; rsIDs and legitimate multi-base indel alleles stay usable).
  • .matchAgainstSketch filters .refVariantsFromSketch by it, so a GWAS variant on such a position is dropped at harmonisation (removeUnmatched) — filtered at the call site, not in .refVariantsFromSketch, since the RAISS path indexes into that frame.
  • .raissUnsafeToImpute gains it as a third clause. The id-string readers then never request the variant.

Validated on the real ADSP R5 chr21 panel: baseline reproduces the abort; the fix drops exactly the tag-position variants at QC and the run completes, through both direct calls and the real gwas_sumstats_construct.R + fine_mapping.R scripts. Suites pass with 0 unrelated changes; rsID panels unaffected.

Some panels (ADSP R5) name ~3% of variants with a tag where an allele belongs (chr21:...:INS:T), so the id no longer encodes its alleles though A1/A2 are correct. Harmonization keys on the allele columns and keeps the variant; the id-string LD lookup then can't find it and aborts (.fmLdFromSketch / kriging: 'N variant id(s) not present'). The sumstats can't say which orientation was measured at such a position, so drop is the only safe choice -- the same rule StatFunGen#576's RAISS flip-pair/flip-of-known masks apply. Exclude uninterpretable-id panel entries from harmonization (.refVariantsFromSketch, so removeUnmatched drops the variant) and from RAISS (.raissUnsafeToImpute third clause), keyed on a new .ldSketchIdUsable predicate (parses to non-DNA allele; rsIDs and real indels unaffected).
@Yining97 Yining97 closed this Aug 30, 2026
@Yining97
Yining97 deleted the ld-drop-uninterpretable-panel-ids branch August 30, 2026 04:12
@Yining97
Yining97 restored the ld-drop-uninterpretable-panel-ids branch August 30, 2026 04:36
@Yining97 Yining97 reopened this Aug 30, 2026
@danielnachun
danielnachun force-pushed the ld-drop-uninterpretable-panel-ids branch from e3376ce to 3ae9cd1 Compare August 30, 2026 04:45
@Yining97 Yining97 closed this Aug 30, 2026
@Yining97
Yining97 deleted the ld-drop-uninterpretable-panel-ids branch August 30, 2026 05:04
@Yining97 Yining97 reopened this Aug 30, 2026
@danielnachun
danielnachun merged commit 99625ca into StatFunGen:main Aug 30, 2026
5 of 8 checks passed
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.

2 participants