| get_matching_snps | R Documentation |
get_matching_snps() aligns rows from multiple variant-level association
result tables using a genomic variant key constructed from chromosome and
position (e.g. "CHR:POS"). Effect estimates and confidence intervals are
standardized across datasets, while row labels are taken from the reference
dataset (the first element of dfs).
The function supports allele-aware matching and automatically corrects effect directions when reference and alternate alleles are flipped between datasets.
This function is typically used internally by foresttopr when
variant-level columns are detected, but may also be called directly to
prepare matched variant-level effect tables.
get_matching_snps(
dfs,
labels,
gene_col = "ID",
label_col = NULL,
effect_type = c("OR", "beta")
)
dfs |
A list of data frames containing variant-level association
results. Each data frame must contain chromosome and position columns
( |
labels |
A character vector of dataset labels of the same length as
|
gene_col |
Character scalar specifying a column name in the reference
dataset used for labeling rows (e.g. gene or variant identifier).
Defaults to |
label_col |
Optional character scalar specifying an alternative column
name in the reference dataset to use as a human-readable row label.
If |
effect_type |
Character scalar specifying the effect scale to use.
Either |
Variants are matched across datasets using a key constructed from chromosome and position. Reference and alternate alleles are compared between datasets, and effect estimates are automatically flipped when allele orientation differs.
Confidence intervals are derived preferentially from explicit bounds, standard errors, or p-values, depending on availability.
The returned table contains one row per matched variant per dataset.
A data frame containing matched variant-level effect estimates with the following columns:
Variant key constructed from chromosome and position.
Row label used for display purposes.
Dataset identifier corresponding to labels.
Effect estimate on the requested scale.
P-value associated with the effect estimate.
Lower confidence interval bound.
Upper confidence interval bound.
foresttopr, get_matching_genes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.