Overlap QTL and GWAS top loci by allele-aware variant matching
Source:R/overlapTopLoci.R
overlapTopLoci.RdIntersect the top-loci tables of a QtlFineMappingResult and a
GwasFineMappingResult on shared variants, matched with pecotmr's
allele-aware matchVariants (handling strand flips / ref-alt
swaps rather than naive id equality). The GWAS side is harmonized to the QTL
orientation: its signed effect columns (beta, z,
conditional_effect) are sign-flipped and its effect-allele frequency
(af) is complemented wherever a swap occurred. The result keeps the
variant key columns once (from the QTL, the reference orientation) and
prefixes every other column qtl_ / gwas_. A variant shared
across several QTL contexts and/or GWAS studies yields one row per
(QTL entry x GWAS entry) pair (a wide cross-product per variant).
Usage
overlapTopLoci(qtl, gwas, ...)
# S4 method for class 'QtlFineMappingResult,GwasFineMappingResult'
overlapTopLoci(
qtl,
gwas,
signalCutoff = 0.025,
type = c("data.frame", "GRanges"),
...
)Arguments
- qtl
A
QtlFineMappingResult.- gwas
A
GwasFineMappingResult.- ...
Ignored.
- signalCutoff
PIP cutoff forwarded to
getTopLocifor both inputs. Default 0.025.- type
"data.frame"(default) or"GRanges".
Value
A data.frame (or GRanges) keyed on the QTL variant
(variant_id, chrom, pos, A1, A2) with all other columns prefixed
qtl_ / gwas_. Zero rows when there is no allele-aware overlap.
See also
getTopLoci, matchVariants