Do not impute at GWAS-observed positions in RAISS - #573
Open
Yining97 wants to merge 1 commit into
Open
Conversation
RAISS selected imputation targets by variant_id only, so a position already typed in the GWAS still had its other panel forms (a second allele / opposite orientation) imputed. Guard the target set by observed (chrom,pos) in both raissSingleMatrix and raissSingleMatrixFromX; un-observed positions, including genuinely multi-allelic sites, still impute all their forms. Also fixes generate_dummy_data, which sampled the known set's variant_id and pos independently (an inconsistent fixture the guard correctly flags).
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.
Problem
RAISS chose imputation targets purely by
variant_id:unknowns <- which(!refPanel$variant_id %in% knownsId). So a genomic position already typed in the GWAS still had its other panel forms imputed — a second allele or the opposite orientation of a site the GWAS actually measured. On the ADSP R5 panel this inflated the imputed set (43 observed multi-allelic positions → 2,969 imputed variants in one block) and manufactured redundant records at measured positions, contradicting the intent of imputation (fill un-observed variants).Fix
In both RAISS entry points (
raissSingleMatrixandraissSingleMatrixFromX), a panel variant is an imputation target only if its canonical(chrom, pos)is not present in the observed z-scores, on top of the existingvariant_idcheck. Positions with no GWAS observation — including genuinely multi-allelic sites — still impute all their panel forms, so legitimately imputed variants remain available to fine-mapping and the credible set.Validation
fromX) paths.generate_dummy_data, which sampled the known set'svariant_idandposindependently (placing a known id at a foreign position) — an inconsistent fixture the guard correctly flags; now drawn from the same panel rows.3035 rows / 3 failed / 6 errorsvs cleanmain3033 / 3 / 6(+2 new tests) — identical failure counts, zero new regressions. The 3 failures are pre-existing order-dependent joint-dispatcher tests (pass in isolation); the 6 errors are the pre-existingtest_ctwasPipeline.Rones.Tests added:
test_sumstatsQc.R+2 (both RAISS paths).🤖 Generated with Claude Code