ramiromagno / gwasrapidd

gwasrapidd: an R package to query, download and wrangle GWAS Catalog data
https://rmagno.eu/gwasrapidd/
Other
89 stars 15 forks source link

get_snp_by_id and get_snp_by_location not working for rs35252396 and rs6470588 #1

Closed ramiromagno closed 5 years ago

ramiromagno commented 5 years ago

rs35252396 and rs6470588 return more than one hit in locations::_links::snps where only one was (erroneously) presumed:

{
  "rsId" : "rs35252396",
  "merged" : 0,
  "functionalClass" : "intron_variant",
  "lastUpdateDate" : "2018-07-21T04:19:30.186+0000",
  "locations" : [ {
    "chromosomeName" : "8",
    "chromosomePosition" : 127877125,
    "region" : {
      "name" : "8q24.21"
    },
    "_links" : {
      "snps" : [ {
        "href" : "https://www.ebi.ac.uk/gwas/rest/api/singleNucleotidePolymorphisms/rs35252396"
      }, {
        "href" : "https://www.ebi.ac.uk/gwas/rest/api/singleNucleotidePolymorphisms/rs6470588"
      } ]
    }
  } ],

and

{
  "rsId" : "rs6470588",
  "merged" : 0,
  "functionalClass" : "intron_variant",
  "lastUpdateDate" : "2018-07-21T04:19:29.693+0000",
  "locations" : [ {
    "chromosomeName" : "8",
    "chromosomePosition" : 127877125,
    "region" : {
      "name" : "8q24.21"
    },
    "_links" : {
      "snps" : [ {
        "href" : "https://www.ebi.ac.uk/gwas/rest/api/singleNucleotidePolymorphisms/rs35252396"
      }, {
        "href" : "https://www.ebi.ac.uk/gwas/rest/api/singleNucleotidePolymorphisms/rs6470588"
      } ]
    }
  } ],

I need to write a patch here: https://github.com/ramiromagno/gwasrapidd/blob/b062b9cb469e5470e457065c3e1a1c751f8f3589/R/snp.R#L200-L258

ramiromagno commented 5 years ago

This issue was first noted with:

get_snps_by_location("8", 125843656L, 128157561L)