Gviz error 'Expectation Failed'
5
1
Entering edit mode
Tom ▴ 10
@tom-10763
Last seen 5.3 years ago

Hello, I want to draw a methylation heatmap by chromosome location using a package 'Gviz', but got an error w/ 'IdeogramTrack' function.

> library(Gviz)
Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: grid
> itr=IdeogramTrack(genome="hg19",chromosome="chr1")
Error: Expectation Failed

 

Any help?
Tom

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

locale:
[1] C

attached base packages:
[1] grid      parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Gviz_1.16.1          GenomicRanges_1.24.0 GenomeInfoDb_1.8.1   IRanges_2.6.0        S4Vectors_0.10.1   
[6] BiocGenerics_0.18.0 

loaded via a namespace (and not attached):
[1] SummarizedExperiment_1.2.2    VariantAnnotation_1.18.1      splines_3.3.0               
[4] lattice_0.20-33               colorspace_1.2-6              htmltools_0.3.5             
[7] rtracklayer_1.32.0            GenomicFeatures_1.24.2        chron_2.3-47                
[10] interactiveDisplayBase_1.10.3 survival_2.39-4               XML_3.98-1.4                
[13] foreign_0.8-66                DBI_0.4-1                     ensembldb_1.4.5             
[16] BiocParallel_1.6.2            RColorBrewer_1.1-2            matrixStats_0.50.2          
[19] plyr_1.8.3                    zlibbioc_1.18.0               Biostrings_2.40.1           
[22] munsell_0.4.3                 gtable_0.2.0                  latticeExtra_0.6-28         
[25] Biobase_2.32.0                biomaRt_2.28.0                BiocInstaller_1.22.2        
[28] httpuv_1.3.3                  AnnotationDbi_1.34.3          Rcpp_0.12.5                 
[31] acepack_1.3-3.3               xtable_1.8-2                  BSgenome_1.40.0             
[34] scales_0.4.0                  Hmisc_3.17-4                  XVector_0.12.0              
[37] mime_0.4                      Rsamtools_1.24.0              gridExtra_2.2.1             
[40] AnnotationHub_2.4.2           ggplot2_2.1.0                 digest_0.6.9                
[43] biovizBase_1.20.0             shiny_0.13.2                  tools_3.3.0                 
[46] bitops_1.0-6                  RCurl_1.95-4.8                RSQLite_1.0.0               
[49] dichromat_2.0-0               Formula_1.2-1                 cluster_2.0.4               
[52] Matrix_1.2-6                  data.table_1.9.6              httr_1.1.0                  
[55] R6_2.1.2                      rpart_4.1-10                  GenomicAlignments_1.8.0     
[58] nnet_7.3-12                  
gviz ucsc • 5.6k views
ADD COMMENT
0
Entering edit mode

Although the error message "Expectation failed" would be given when connection to the server is troubled, I could access to UCSC (http://genome.ucsc.edu), which the function 'IdeogramTrack' requires access to.

Could anyone help me w/ possible solutions?

Best,

Tom

ADD REPLY
1
Entering edit mode

Bummer. Hate when we fail expectations :-)

I very much think that this was/is an issue with connectivity to UCSC. I can't reproduce the error on any of the machines that I have tried. Could have been a temporary timeout of the UCSC API. Being able to access the UCSC home page does not rule out problems in the REST API that Gviz/rtracklayer is using for the connection. You may also suffer from network access issues from within R. Are you behind a proxy? And can you access the web from within R at all. (e.g., can you do readLines("http://genome.ucsc.edu") )

Can you try again to check whether the problem still exists? And if so, please attach the output of traceback() after the error occurs in order to get a better idea of the call stack.

Florian

ADD REPLY
0
Entering edit mode

Dear Florian,

Thank you for your helping hands!

As you mentioned, I am behind a proxy using in-hospital LAN.

readLines("http://genome.ucsc.edu") generated a 485-line output w/o error, but the original codes still end up w error...

Attached please see the output of traceback().

Thanks,

Tom

> itr=IdeogramTrack(genome="hg19",chromosome="chr1")
Error: Expectation Failed
> traceback()
21: stop(err)
20: stop.if.HTTP.error(http.header)
19: postForm(url, .params = .form, .opts = list(..., useragent = "rtracklayer"))
18: httpPost(ucscURL(object, key), .form, ..., cookie = ucscCookie(object))
17: ucscPost(browserSession(query), "tables", c(ucscForm(query, tracks = tracks), 
        list(...)), .parse = .parse)
16: ucscTablePost(query, hgta_enteredUserRegionFile = upload, hgta_enteredUserRegions = "", 
        hgta_doSubmitUserRegions = "submit", hgsid = hgsid)
15: .uploadTableBrowserRanges(object, hgsid)
14: ucscExport(object)
13: .local(object, ...)
12: getTable(query)
11: getTable(query)
10: eval(expr, envir, enclos)
9: eval(expression, envir = callEnv)
8: eval(expression, envir = callEnv)
7: .doCache(genomesToken, expression({
       if (!genome %in% as.character(genomes[, "db"])) stop("'", 
           genome, "' is not a valid UCSC genome.")
       sessionToken <- paste("session", genome, sep = "_")
       session <- .doCache(sessionToken, expression({
           myUcscUrl <- getOption("Gviz.ucscUrl")
           tmp <- if (is.null(myUcscUrl)) browserSession() else browserSession(url = myUcscUrl)
           genome(tmp) <- genome
           tmp
       }), env, cenv)
       query <- tryCatch(ucscTableQuery(session, "cytoBandIdeo"), 
           error = function(e) {
               warning("There doesn't seem to be any cytoband data available for genome '", 
                   genome, "' at UCSC or the service is temporarily down. Trying to fetch the chromosome length data.")
               tryCatch(ucscTableQuery(session, table = "chromInfo"), 
                   error = function(e) stop("There doesn't seem to be any chromosome length data available for genome '", 
                     genome, "' at UCSC or the service is temporarily down."))
           })
       out <- getTable(query)
       if (all(c("chrom", "size") %in% colnames(out))) {
           out <- data.frame(chrom = out$chrom, chromStart = 0, 
               chromEnd = out$size, name = "", gieStain = "gneg", 
               stringsAsFactors = F)
       }
       out
   }), env, cenv)
6: .cacheGenomes(genome = genome)
5: .local(.Object, ...)
4: initialize(value, ...)
3: initialize(value, ...)
2: new("IdeogramTrack", chromosome = chromosome, genome = genome, 
       name = name, bands = bands, ...)
1: IdeogramTrack(genome = "hg19", chromosome = "chr1")

 

ADD REPLY
0
Entering edit mode

Dear Florian,

I switched to mobile network and the codes passed!

I didn't realise the in hospital LAN was the cause.

Thank you!!

Tom

ADD REPLY
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 6.3 years ago
Switzerland

No problem. If you google for proxy and R, or look it up in the R administration guide you will find more details on how to set this up properly.

ADD COMMENT
0
Entering edit mode

Florian,

Now I am suffering from different errors even using previously successful mobile network...

I also set up proxy parameters on Rstudio, still cannot solve it.

Following are my codes and errors. Could you suggest any solutions?

library(Gviz)

itr=IdeogramTrack(chromosome="chr1",genome="hg19")

Error messages were:

Error in `genome<-`(`*tmp*`, value = "hg19") : 
  Failed to set session genome to 'hg19'

Then I set up "http_proxy" (XXXX & YYYY were replaced with actual proxy host name and port num)

Sys.setenv("http_proxy"="http://XXXX:YYYY")

itr=IdeogramTrack(chromosome="chr1",genome="hg19")

Then the following error appeared:

Error in function (type, msg, asError = TRUE)  : 
  Failed connect to genome.ucsc.edu:YYYY; Operation timed out

traceback() output were as follows:

28: fun(structure(list(message = msg, call = sys.call()), class = c(typeName, 
        "GenericCurlError", "error", "condition")))
27: function (type, msg, asError = TRUE) 
    {
        if (!is.character(type)) {
            i = match(type, CURLcodeValues)
            typeName = if (is.na(i)) 
                character()
            else names(CURLcodeValues)[i]
        }
        typeName = gsub("^CURLE_", "", typeName)
        fun = (if (asError) 
            stop
        else warning)
        fun(structure(list(message = msg, call = sys.call()), class = c(typeName, 
            "GenericCurlError", "error", "condition")))
    }(7L, "Failed connect to genome.ucsc.edu:YYYY; Operation timed out", 
        TRUE)
26: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding, 
        PACKAGE = "RCurl")
25: curlPerform(curl = curl, .opts = opts, .encoding = .encoding)
24: getURL(url, useragent = "rtracklayer", ...)
23: httpGet(gwURL, cookiefile = tempfile(), header = TRUE, .parse = FALSE, 
        ...)
22: .local(.Object, ...)
21: initialize(value, ...)
20: initialize(value, ...)
19: new(class, ...)
18: browserSession("UCSC", ...)
17: browserSession("UCSC", ...)
16: browserSession()
15: browserSession()
14: eval(expr, envir, enclos)
13: eval(expression, envir = callEnv)
12: eval(expression, envir = callEnv)
11: .doCache(sessionToken, expression({
        myUcscUrl <- getOption("Gviz.ucscUrl")
        tmp <- if (is.null(myUcscUrl)) browserSession() else browserSession(url = myUcscUrl)
        genome(tmp) <- genome
        tmp
    }), env, cenv)
10: eval(expr, envir, enclos)
9: eval(expression, envir = callEnv)
8: eval(expression, envir = callEnv)
7: .doCache(genomesToken, expression({
       if (!genome %in% as.character(genomes[, "db"])) stop("'", 
           genome, "' is not a valid UCSC genome.")
       sessionToken <- paste("session", genome, sep = "_")
       session <- .doCache(sessionToken, expression({
           myUcscUrl <- getOption("Gviz.ucscUrl")
           tmp <- if (is.null(myUcscUrl)) browserSession() else browserSession(url = myUcscUrl)
           genome(tmp) <- genome
           tmp
       }), env, cenv)
       query <- tryCatch(ucscTableQuery(session, "cytoBandIdeo"), 
           error = function(e) {
               warning("There doesn't seem to be any cytoband data available for genome '", 
                   genome, "' at UCSC or the service is temporarily down. Trying to fetch the chromosome length data.")
               tryCatch(ucscTableQuery(session, table = "chromInfo"), 
                   error = function(e) stop("There doesn't seem to be any chromosome length data available for genome '", 
                     genome, "' at UCSC or the service is temporarily down."))
           })
       out <- getTable(query)
       if (all(c("chrom", "size") %in% colnames(out))) {
           out <- data.frame(chrom = out$chrom, chromStart = 0, 
               chromEnd = out$size, name = "", gieStain = "gneg", 
               stringsAsFactors = F)
       }
       out
   }), env, cenv)
6: .cacheGenomes(genome = genome)
5: .local(.Object, ...)
4: initialize(value, ...)
3: initialize(value, ...)
2: new("IdeogramTrack", chromosome = chromosome, genome = genome, 
       name = name, bands = bands, ...)
1: IdeogramTrack(chromosome = "chr1", genome = "hg19")
ADD REPLY
0
Entering edit mode

You'll want to set the proxy for RCurl, rather than / as well as R, as described in this post. You should be able to test that you've got the proxy configured correctly by doing a direct getURL() as in the post, and then go for the ideogram. I think the URL being queried is

url = "http://genome.ucsc.edu/cgi-bin/hgGateway"

so you're trying to get something like the following to work

opts <- list(
  proxy         = "http://****",
  proxyport     = ****
)
options(RCurlOptions = opts)
xx = RCurl::getURL(url)

 

ADD REPLY
0
Entering edit mode

Dear Martin,

Thank you very much for the comment.

I tried to set the proxy for RCurl, did getURL() and got the same timeout error...

I got the proxy host name and port num using online inspector. I am not sure if it is correct because the port num differs every time reload the page.

I may not understand the basics of proxy. I would really appreciate your help.

Best,

Tom

ADD REPLY
0
Entering edit mode

I think you should be able to discover the proxy settings from safari / network preferences or other system preferences, but I'm not a mac user so can't tell you specifically where to look, sorry. Your IT help desk should also be able / willing to provide you with this information. The port on the page you reference is the port you are connecting to on their server (I think) rather than the port your proxy server uses.

ADD REPLY
0
Entering edit mode

Martin,

If I do getURL("http://genome.ucsc.edu/cgi-bin/hgGateway") w/o Sys.setenv() nor RCurlOptions for proxy, it successfully finishes though Gviz::IdeogramTrack() still gets an error:

Error in `genome<-`(`*tmp*`, value = "hg19") : 
  Failed to set session genome to 'hg19'

I wonder whether this is surely a proxy problem(?) because I've never experienced network problems on R, for instance no troubles in package installations, and actually getURL() passes w/o errors.

Is there any special settings required for Gviz??

Best,

Tom

ADD REPLY
0
Entering edit mode

That's not the error that you reported initially ("Expectation failed") so there are moving pieces that you'll have to control. You'll also need to provide more information about why the error you now mention occurs, via trackback(). It's very hard to debug this sort of problem when it cannot be reproduced by others. Since getURL works without any special settings, it does suggest that a proxy was not a problem.

ADD REPLY
0
Entering edit mode

Martin,

Thank you for your reply.

> library(Gviz)

> itr=IdeogramTrack(chromosome="chr1",genome="hg19")

Error in `genome<-`(`*tmp*`, value = "hg19") : 
  Failed to set session genome to 'hg19'

After the error, traceback() says as follows:

> traceback()

17: stop("Failed to set session genome to '", value, "'")
16: `genome<-`(`*tmp*`, value = "hg19")
15: `genome<-`(`*tmp*`, value = "hg19")
14: eval(expr, envir, enclos)
13: eval(expression, envir = callEnv)
12: eval(expression, envir = callEnv)
11: .doCache(sessionToken, expression({
        myUcscUrl <- getOption("Gviz.ucscUrl")
        tmp <- if (is.null(myUcscUrl)) browserSession() else browserSession(url = myUcscUrl)
        genome(tmp) <- genome
        tmp
    }), env, cenv)
10: eval(expr, envir, enclos)
9: eval(expression, envir = callEnv)
8: eval(expression, envir = callEnv)
7: .doCache(genomesToken, expression({
       if (!genome %in% as.character(genomes[, "db"])) stop("'", 
           genome, "' is not a valid UCSC genome.")
       sessionToken <- paste("session", genome, sep = "_")
       session <- .doCache(sessionToken, expression({
           myUcscUrl <- getOption("Gviz.ucscUrl")
           tmp <- if (is.null(myUcscUrl)) browserSession() else browserSession(url = myUcscUrl)
           genome(tmp) <- genome
           tmp
       }), env, cenv)
       query <- tryCatch(ucscTableQuery(session, "cytoBandIdeo"), 
           error = function(e) {
               warning("There doesn't seem to be any cytoband data available for genome '", 
                   genome, "' at UCSC or the service is temporarily down. Trying to fetch the chromosome length data.")
               tryCatch(ucscTableQuery(session, table = "chromInfo"), 
                   error = function(e) stop("There doesn't seem to be any chromosome length data available for genome '", 
                     genome, "' at UCSC or the service is temporarily down."))
           })
       out <- getTable(query)
       if (all(c("chrom", "size") %in% colnames(out))) {
           out <- data.frame(chrom = out$chrom, chromStart = 0, 
               chromEnd = out$size, name = "", gieStain = "gneg", 
               stringsAsFactors = F)
       }
       out
   }), env, cenv)
6: .cacheGenomes(genome = genome)
5: .local(.Object, ...)
4: initialize(value, ...)
3: initialize(value, ...)
2: new("IdeogramTrack", chromosome = chromosome, genome = genome, 
       name = name, bands = bands, ...)
1: IdeogramTrack(chromosome = "chr1", genome = "hg19")

What does this suggest is the problem?

Best,

Tom

 

 

ADD REPLY
0
Entering edit mode

Sorry Tom I'm not really familiar enough with the code to help without being able to reproduce this. Maybe Michael Lawrence or Florian Hahne or someone else will be able to chime in.

ADD REPLY
0
Entering edit mode

Martin,

Okay, I will wait for them.

Many thanks for your help.

Tom

ADD REPLY
0
Entering edit mode

Since the error said "timed out", I changed the timeout option:

library(RCurl)

curlSetOpt(timeout=200)

itr=IdeogramTrack(chromosome="chr1", genome="hg19")

output the same timeout error.

Any of your suggestions will be really helpful and appreciated.

Best regards,

Tom

ADD REPLY
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 6.3 years ago
Switzerland

Tom, 

the issue here is that for whatever reason you are not able to connect to UCSC from within R via the rtracklayer package functionality. Since this is not reproducible by anybody else so far the only thing that I can think of is networking. There may be quite a lot that can go wrong here. Maybe your institution is blocking communication to the USCS API. Or maybe your IP got blocked by UCSC for whatever reason. 

Here is the minimal example that you should be able to run:

library(rtracklayer)
session <- browserSession()
genome(session) <- "hg19"

If that fails there is an issue with your rtracklayer connection, and there is rather little that I can do from here. You may want to try one of the UCSC mirror site, the alternative URL can be passed in as the url parameter to browserSession(). If you want to use that within the Gviz package it can be set a an option (options(Gviz.ucscUrl="your/mirror/URL")

Florian

ADD COMMENT
0
Entering edit mode

Florian,

library(rtracklayer)
session <- browserSession()
genome(session) <- "hg19"

also ended up with the same error:

Error in `genome<-`(`*tmp*`, value = "hg19") : 
  Failed to set session genome to 'hg19'

I also tried the european mirror using options(Gviz.ucscUrl="http://genome-euro.ucsc.edu") but IdeogramTrack() got a different error:

Error in function (type, msg, asError = TRUE)  : 
  Could not resolve host: genome-euro.ucsc.eduhgGateway

Totally at a loss for possibly successful solutions. Hopefully, someone who experienced the same errors will leave comments here...

Thanks,

Tom

 

ADD REPLY
0
Entering edit mode

Frustrating...

There is somebody else experiencing a similar issue:

C: Error when using Gviz

From the error message above I'd guess that you are missing a trailing slash in your URL:

options(Gviz.ucscUrl="http://genome-euro.ucsc.edu/")

That other person seems to be able to fetch data for the latest hg38 genome. Does that also work for you?

As a final workaround that completely avoids all of this: You can provide you own version of the chromosome band table to the IdeogramTrack() constructor. Just download the table through the UCSC table browser (https://genome.ucsc.edu/cgi-bin/hgTables?hgsid=499906731_kDO4s0FcQAI0C5fLZVfICwtkjZlh&clade=mammal&org=Human&db=hg19&hgta_group=allTables&hgta_track=hg19&hgta_table=cytoBandIdeo&hgta_regionType=genome&position=chr21%3A33031597-33041570&hgta_outputType=primaryTable&hgta_outFileName=) and read it in into R:

it <- IdeogramTrack(bands=read.delim("~/Downloads/cyto.txt", col.names=c("chrom", "chromStart", "chromEnd", "name", "gieStain")), genome="hg19")

Florian

 

 

ADD REPLY
0
Entering edit mode

Yes, absolutely frustrating...  and I really appreciate Martin's and your help.

As Asma wrote on C: Error when using Gviz , IdeogramTrack() and

library(rtracklayer)
session <- browserSession()
genome(session) <- "hg38"

passed w/ "genome" set to the latest hg38. Seems like the problem is some sort of access control settings by UCSC rather than something debuggable on our end.

How can it be fixed?

Tom

ADD REPLY
0
Entering edit mode

I wonder if this gets any useful output, especially comparing hg19 and hg38

library(rtracklayer)
options(RCurlOptions=list(verbose=TRUE))
session <- browserSession()
genome(session) <- "hg19"

 

ADD REPLY
0
Entering edit mode

Martin,

I tried your test codes.

The outputs with genome(session)="hg19" were:

> genome(session)="hg19"
* Adding handle: conn: 0x111004800
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 2 (0x111004800) send_pipe: 1, recv_pipe: 0
* About to connect() to genome-euro.ucsc.edu port 80 (#2)
*   Trying 129.70.40.120...
* Connected to genome-euro.ucsc.edu (129.70.40.120) port 80 (#2)
> GET /cgi-bin/hgGateway?db=hg19 HTTP/1.1
User-Agent: rtracklayer
Host: genome-euro.ucsc.edu
Accept: */*
Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v

< HTTP/1.1 200 OK
< Date: Thu, 23 Jun 2016 23:10:16 GMT
* Server Apache/2.2.15 (CentOS) is not blacklisted
< Server: Apache/2.2.15 (CentOS)
< Set-Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v; path=/; domain=.ucsc.edu; expires=Thu, 31-Dec-2037 23:59:59 GMT
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
< 
* Connection #2 to host genome-euro.ucsc.edu left intact
* Adding handle: conn: 0x111029800
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 3 (0x111029800) send_pipe: 1, recv_pipe: 0
* About to connect() to genome-euro.ucsc.edu port 80 (#3)
*   Trying 129.70.40.120...
* Connected to genome-euro.ucsc.edu (129.70.40.120) port 80 (#3)
> GET /cgi-bin/cartDump HTTP/1.1
User-Agent: rtracklayer
Host: genome-euro.ucsc.edu
Accept: */*
Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v

< HTTP/1.1 200 OK
< Date: Thu, 23 Jun 2016 23:10:18 GMT
* Server Apache/2.2.15 (CentOS) is not blacklisted
< Server: Apache/2.2.15 (CentOS)
< Set-Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v; path=/; domain=.ucsc.edu; expires=Thu, 31-Dec-2037 23:59:59 GMT
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
< 
* Connection #3 to host genome-euro.ucsc.edu left intact
Error in `genome<-`(`*tmp*`, value = "hg19") : 
  Failed to set session genome to 'hg19'

and with genome(session)="hg38":

> genome(session)="hg38"
* Adding handle: conn: 0x113c57400
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 4 (0x113c57400) send_pipe: 1, recv_pipe: 0
* About to connect() to genome-euro.ucsc.edu port 80 (#4)
*   Trying 129.70.40.120...
* Connected to genome-euro.ucsc.edu (129.70.40.120) port 80 (#4)
> GET /cgi-bin/hgGateway?db=hg38 HTTP/1.1
User-Agent: rtracklayer
Host: genome-euro.ucsc.edu
Accept: */*
Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v

< HTTP/1.1 200 OK
< Date: Thu, 23 Jun 2016 23:10:25 GMT
* Server Apache/2.2.15 (CentOS) is not blacklisted
< Server: Apache/2.2.15 (CentOS)
< Set-Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v; path=/; domain=.ucsc.edu; expires=Thu, 31-Dec-2037 23:59:59 GMT
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
< 
* Connection #4 to host genome-euro.ucsc.edu left intact
* Adding handle: conn: 0x111004800
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 5 (0x111004800) send_pipe: 1, recv_pipe: 0
* About to connect() to genome-euro.ucsc.edu port 80 (#5)
*   Trying 129.70.40.120...
* Connected to genome-euro.ucsc.edu (129.70.40.120) port 80 (#5)
> GET /cgi-bin/cartDump HTTP/1.1
User-Agent: rtracklayer
Host: genome-euro.ucsc.edu
Accept: */*
Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v

< HTTP/1.1 200 OK
< Date: Thu, 23 Jun 2016 23:10:27 GMT
* Server Apache/2.2.15 (CentOS) is not blacklisted
< Server: Apache/2.2.15 (CentOS)
< Set-Cookie: hguid.genome-euro=359808026_9FKyveCJjMg8Ayk08PVmgpuAjY5v; path=/; domain=.ucsc.edu; expires=Thu, 31-Dec-2037 23:59:59 GMT
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
< 
* Connection #5 to host genome-euro.ucsc.edu left intact

hg38 was fine but hg19 failed. Do you have any ideas?

ADD REPLY
0
Entering edit mode

Nope, they look more or less the same!

ADD REPLY
0
Entering edit mode

Hmmm... Do you think we can solve it on our end? or should I make an inquiry at UCSC genome browser web page?

ADD REPLY
0
Entering edit mode
angie • 0
@angie-11015
Last seen 8.5 years ago
UCSC Genome Browser Group

It's not a network error now because you're getting a response with "HTTP/1.1 200 OK" -- but UCSC did recently make significant changes to the hgGateway page. Could it be that rtracklayer is looking for a specific pattern in the hgGateway HTML to confirm that the db was changed to hg19, and not finding that pattern? If so, I could help identify a new way to confirm that the database was changed.

 

ADD COMMENT
0
Entering edit mode

This really seems like a network configuration issue.  This code works for everyone except for the person reporting the issue.

ADD REPLY
0
Entering edit mode

I don't see how a network configuration issue would explain hg38 working OK but not hg19.  Also, as Florian noted C: Gviz error 'Expectation Failed', there is at least one other user who can access hg38 but not hg19: C: Error when using Gviz  .

Does rtracklayer look for a pattern in the HTML returned by hgGateway?

ADD REPLY
0
Entering edit mode

Might have figured out the issue. For some reason, browsing to the European mirror (genome-euro) hgGateway, with db=hg19, does not change the genome. But if I specify redirect=manual, it seems to work. That might just be due to me being located in the US though. So I'm not sure if I solved this problem.

ADD REPLY
0
Entering edit mode

How can I set redirect=manual for rtracklayer?

ADD REPLY
0
Entering edit mode

That was referring to the underlying query parameters on the URL, not specified by the user. You could try rtracklayer 1.33.9 (in devel), but I think it would only help people trying to use a mirror outside of their region. It would help to see the output of genome(x) after the error.

ADD REPLY
0
Entering edit mode

Dear all,

I tried the development version of rtracklayer and it worked perfectly. Because I have been working on this problem from Japan, that error seems to appear, as Michael mentioned, when we try to access UCSC (mirror) using the package from outside of their region.

Many thanks for all your assistance.

Tom

ADD REPLY
0
Entering edit mode
maximilianh ▴ 10
@maximilianh-11016
Last seen 7.8 years ago
UCSC

Is rtracklayer scraping the hgGateway page? If yes, why? What data is rtracklayer getting here? Isn't it a lot easier to get the data through the public mysql server?

ADD COMMENT
0
Entering edit mode
Tom ▴ 10
@tom-10763
Last seen 5.3 years ago

*Summary:

The error messages below seem to occur when you are in outside of the region of a UCSC mirror which you try to use.

Using rtracklayer 1.33.9 (now in devel) solved my problem.

 

*Error messages:

> library(rtracklayer)
> session <- browserSession()
> genome(session) <- "hg19"

Error in `genome<-`(`*tmp*`, value = "hg19") : 
  Failed to set session genome to 'hg19'
ADD COMMENT

Login before adding your answer.

Traffic: 577 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