getSnpIdFromLocation: Get rsIDs from locations of SNP

Description Usage Arguments Details Value Author(s) Examples

Description

Given a GRanges object of SNPs and a SNPlocs annotation, this function attempts to replace the names of the GRanges object entries with rs-IDs.

Usage

1
2
3
4
getSnpIdFromLocation(GR, ...)

## S4 method for signature 'GRanges'
getSnpIdFromLocation(GR, SNPloc, return.vector = FALSE, verbose = TRUE)

Arguments

GR

A GRanges that contains positions of SNPs to look up

...

arguments to pass on

SNPloc

A SNPlocs object containing information on SNP locations (e.g. SNPlocs.Hsapiens.dbSNP.xxxxxxxx)

return.vector

Setting return.vector=TRUE returns vector with rsIds

verbose

Setting verbose=TRUE makes function more talkative

Details

This function is used to try to identify the rs-IDs of SNPs in a GRanges object.

Value

getSnpIdFromLocation returns the same GRanges object it was given with, but with updated with rs.id information.

Author(s)

Jesper R. Gadin, Lasse Folkersen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
is_32bit_windows <- .Platform$OS.type == "windows" &&
                  .Platform$r_arch == "i386"
if (!is_32bit_windows && require(SNPlocs.Hsapiens.dbSNP144.GRCh37)) {
	#load example data
	data(ASEset)

  #get counts at the three positions specified in GRvariants
  updatedGRanges <- getSnpIdFromLocation(rowRanges(ASEset),
    SNPlocs.Hsapiens.dbSNP144.GRCh37)
}

AllelicImbalance documentation built on Nov. 8, 2020, 6:52 p.m.