ukb Chromosomal position information was converted into SNPS
Entering edit mode
wenbo • 0
Last seen 11 weeks ago

Enter the body of text here how to use R to convert chromosomal position information into SNP Code should be placed in three backticks as shown below

# include your problematic code here with any corresponding output 
# please also include the results of running the following in an R session 

sessionInfo( )
SNPediaR • 231 views
Entering edit mode

Is there a question?

Entering edit mode

Hi, I downloaded uk biobank data, but I don't know how to use R to convert chromosome position information to rs

Entering edit mode
Last seen 7 hours ago
United States

In my work, we almost always convert RSIDs to chr:pos because the former is ambiguous and changing whereas the latter is not. Which is likely why UKBB uses chr:pos as well. But anyway.

You could get some mappings using functions and data from one of the SNPloc packages. As an example

> library(SNPlocs.Hsapiens.dbSNP144.GRCh38)
> snps <- SNPlocs.Hsapiens.dbSNP144.GRCh38
> snplocs <- GRanges(c(1,1,1), IRanges(c(629241, 785910,20840911)))
> snplocs
GRanges object with 3 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]        1    629241      *
  [2]        1    785910      *
  [3]        1  20840911      *
  seqinfo: 1 sequence from an unspecified genome; no seqlengths
> snpsByOverlaps(snps, snplocs)
UnstitchedGPos object with 3 positions and 2 metadata columns:
      seqnames       pos strand |   RefSNP_id alleles_as_ambig
         <Rle> <integer>  <Rle> | <character>      <character>
  [1]        1    629241      * |  rs10458597                Y
  [2]        1    785910      * |  rs12565286                S
  [3]        1  20840911      * |   rs2230573                R
  seqinfo: 25 sequences (1 circular) from GRCh38.p2 genome

But do note that the last RSID has also been known as rs7553394, so there may be a mapping issue, depending on what you are trying to match the ID to.

Login before adding your answer.

Traffic: 459 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6