Reconcile chr-prefix conventions in the LD-sketch lookup#539
Merged
Conversation
.ldFromSketch did a raw match of the requested variant ids against the panel's SNP ids, so genotype-LD fine-mapping failed when the two agreed on the variants but disagreed on the chr prefix (e.g. chr22:... entry ids vs 22:... panel ids) -- even though variantId.R ships ensureChrMatch for exactly this. Reconcile the two id sets before matching; keep the caller's ids for the returned labels and fall back to the raw ids when normalization can't parse them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
|
This is a good fix, I will merge it now. I will also do an audit of the rest of the code to make sure this issue doesn't exist elsewhere. chr-prefix mismatches are trivial to solve and should be handled automatically by the package. |
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.
.ldFromSketchmatched requested variant ids against the panel with a raw string match, so genotype-LD fine-mapping (GWAS + QTL) errored with "variant id(s) not present in the LD sketch panel" whenever the entry ids and panel ids referred to the same variants but disagreed only on thechrprefix. pecotmr already shipsensureChrMatch/normalizeVariantId(variantId.R) but wired them in nowhere. This routes the lookup throughensureChrMatchbefore matching, preserving the caller's labels and the genuinely-absent error.Tests: prefixed/non-prefixed both directions, same-convention regression, absent-still-errors; test_ld 469/0, test_fineMappingPipeline 385/0, test_sumstatsQc 799/0. Validated on the protocol_example chr22 MWE (common path unchanged; a stripped-prefix panel now resolves).