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

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
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
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")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