Skip to content

Scope RAISS imputation to the analysis region, not the whole sketch - #561

Open
Yining97 wants to merge 1 commit into
StatFunGen:mainfrom
Yining97:rss-impute-region-scope
Open

Scope RAISS imputation to the analysis region, not the whole sketch#561
Yining97 wants to merge 1 commit into
StatFunGen:mainfrom
Yining97:rss-impute-region-scope

Conversation

@Yining97

Copy link
Copy Markdown
Contributor

What

summaryStatsQc's RAISS imputation (impute = TRUE, in .runEntrySummaryStatsQc) built its reference panel and genotype dosage from the entire LD sketch (seq_len(nrow(sketchSnpInfo))), while every other panel-using QC step scopes to the region's variants. With a per-chromosome / genome-wide sketch that materializes an n_samples × n_chromVariants dosage matrix + scale() copy + RAISS SVD over the full panel — so --impute was unusable on large chromosomes.

Now the panel/dosage are scoped to the analysis-region window [min(pos) − flank, max(pos) + flank] on the region chromosome (one windowIdx for both refPanel and .dosageMatrix). imputeOpts$flank (default 0) widens the window to recover panel variants just beyond the observed range; an empty window skips imputation defensively.

Impact

  • Makes --impute usable with per-chromosome / genome-wide LD sketches (memory bounded to the region, like every other QC step).
  • No change for block-level sketches (window == block). No protocol change — the pipeline already passes --impute + a per-chromosome LD meta.

Testing

susieR 0.16.6:

  • test_sumstatsQc.R 825 pass — new scoping test (dosage built for the in-window panel variants only), 2 existing impute tests updated to use a flank (they impute beyond the observed range).
  • Real chr21 AD_Bellenguez + per-chromosome panel + --impute: dosage materialized drops from 197,864 → 10,319 columns (~19×); run completes, 1,357 variants imputed.

.runEntrySummaryStatsQc's impute branch built its reference panel and
dosage from seq_len(nrow(sketchSnpInfo)) - the entire LD sketch - while
every other QC step scopes to the region's variants. With a
per-chromosome / genome-wide sketch that materialized an n_samples x
n_chromVariants dosage matrix, so --impute was unusable on large
chromosomes. Restrict refPanel/dosage to the region window
[min(pos)-flank, max(pos)+flank] (imputeOpts$flank, default 0), with a
defensive empty-window skip. On chr21 with a per-chromosome panel the
materialized dosage drops from 197864 to 10319 columns and --impute
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