slowkow / proxysnps

:bookmark: Get SNP proxies from the 1000 Genomes Project.
MIT License
28 stars 9 forks source link

Could not resolve host: tabix.iobio.io #15

Closed MasakiLin closed 3 years ago

MasakiLin commented 3 years ago

Hi,

When I ran your example, there is an error message. Please see below:

library(proxysnps)
d <- get_proxies(query = "rs42")
Error in function (type, msg, asError = TRUE)  : 
  Could not resolve host: tabix.iobio.io
slowkow commented 3 years ago

Thanks for letting us know.

Sorry for the trouble. I will not address this issue this any time soon.

slowkow commented 3 years ago

Issue #10 shows a viable alternative:

library(httr)
library(jsonlite)
library(xml2)

server <- "http://grch37.rest.ensembl.org"
ext <- "/ld/human/rs42/1000GENOMES:phase_3:EUR"

r <- GET(paste(server, ext, sep = ""), content_type("application/json"))
stop_for_status(r)

# use this if you get a simple nested list back, otherwise inspect its structure
# head(data.frame(t(sapply(content(r),c))))
head(fromJSON(toJSON(content(r))))
#>           population_name       r2  d_prime variation1 variation2
#> 1 1000GENOMES:phase_3:EUR 0.060888 0.790030       rs42 rs12699249
#> 2 1000GENOMES:phase_3:EUR 0.147759 0.861987       rs42 rs17633604
#> 3 1000GENOMES:phase_3:EUR 0.128357 0.781375       rs42 rs10486144
#> 4 1000GENOMES:phase_3:EUR 0.334122 0.936431       rs42       rs29
#> 5 1000GENOMES:phase_3:EUR 0.060888 0.790030       rs42 rs12699248
#> 6 1000GENOMES:phase_3:EUR 0.629504 0.978462       rs42       rs15

Created on 2020-08-07 by the reprex package (v0.3.0)

yangchuhua commented 3 years ago

Hi, I also want to find proxies by variants' position, because I wan to get the position of the proxies directly. There is an error message as the following:

d <- get_proxies(chrom = "12", pos = 583090, window_size = 1e5, pop = "AFR") Error in function (type, msg, asError = TRUE) : Could not resolve host: tabix.iobio.io

The following method can solve the problem when I want to find proxies by querying rsid.

Issue #10 shows a viable alternative:


library(httr)
library(jsonlite)
library(xml2)

server <- "http://grch37.rest.ensembl.org"
ext <- "/ld/human/rs42/1000GENOMES:phase_3:EUR"

r <- GET(paste(server, ext, sep = ""), content_type("application/json"))
stop_for_status(r)
# use this if you get a simple nested list back, otherwise inspect its structure
# head(data.frame(t(sapply(content(r),c))))
head(fromJSON(toJSON(content(r))))
Created on 2020-08-07 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)