getSnpIdFromLocation {AllelicImbalance} | R Documentation

## Get rsIDs from locations of SNP

### 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

    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

    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)
    }

[Package AllelicImbalance version 1.24.0 Index]