Find the nearest genes for top SNPs in each locus.

find_nearest_genes(
  top.snps,
  genes,
  dist.to = c("genebody", "tss"),
  cols.to.keep = c("snp", "chr", "pos", "nearest_gene")
)

Arguments

top.snps

A GRanges object of the GWAS summary statistics for the top SNPs

genes

A GRanges object of gene information

dist.to

Find nearest genes by distance to gene body or TSS

cols.to.keep

columns to keep in the result

Value

A data frame with SNP locations and nearest genes.