Learn R Programming

AllelicImbalance (version 1.10.2)

getSnpIdFromLocation: 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, ...)
"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

Value

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

Details

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

Examples

Run this code

#load example data
data(ASEset)

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

Run the code above in your browser using DataLab