Get reference and alternate allele for DBSNP id (rsid)
1
0
Entering edit mode
Krithika • 0
@cbbcc761
Last seen 2.5 years ago
United States

I have some dbSNP ids and I'm trying to locate the reference and the alternate allele . I used the SNPlocs.Hsapiens.dbSNP144.GRCh37 package. But it gave me a message to try the snpcount package.

I've looked at the snpcount package, but unable to find an appropriate example for what I'm looking for. Can anyone help please.

Alternatively, I also have the chromosome number and position. And would like to find the reference and alternate allele for those positions. Can anyone suggest a solution ?

Example code below:

snps <- SNPlocs.Hsapiens.dbSNP144.GRCh37
my_rsids <- c("rs2639606", "rs75264089")
my_snps <- snpsById(snps, my_rsids, ifnotfound="drop")
my_snpsDF <- as.data.frame(my_snps)

alleleInfo <- rsid2alleles(my_rsids, caching=TRUE)

#Error: SNPlocs.Hsapiens.dbSNP144.GRCh37::rsid2alleles() is defunct.
#Please use the SNPlocs API instead. See '?snpcount' for more
#information.
dbSNP • 2.1k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 8 hours ago
United States

The error message points you to a help page, which should be helpful. Here's a bit more information.

> library(SNPlocs.Hsapiens.dbSNP144.GRCh37)
> library(BSgenome.Hsapiens.UCSC.hg19)
> my_rsids <- c("rs2639606", "rs75264089")
> gpos <- snpsById(SNPlocs.Hsapiens.dbSNP144.GRCh37, my_rsids)

## have to convert to UCSC style chromosomes
> seqlevelsStyle(gpos) <- "UCSC"
> z <- inferRefAndAltAlleles(gpos, BSgenome.Hsapiens.UCSC.hg19)
> mcols(gpos) <- cbind(mcols(gpos), z)
> gpos
UnstitchedGPos object with 2 positions and 5 metadata columns:
      seqnames       pos strand |   RefSNP_id alleles_as_ambig genome_compat
         <Rle> <integer>  <Rle> | <character>      <character>     <logical>
  [1]     chr9  71028127      * |   rs2639606                R          TRUE
  [2]     chr6  25056788      * |  rs75264089                S          TRUE
       ref_allele     alt_alleles
      <character> <CharacterList>
  [1]           A               G
  [2]           C               G
  -------
  seqinfo: 25 sequences (1 circular) from hg19 genome
ADD COMMENT

Login before adding your answer.

Traffic: 583 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6