Ah, I see! Thanks for the clarification. That makes perfect sense.
@Martin, I will provide a fix for the Gviz package in the next couple of days.
Florian

From: Michael Lawrence <lawrence.michael@gene.com<mailto:lawrence.michael@gene.com>>
Date: Friday, February 21, 2014 2:23 PM
To: Florian Hahne <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>>
Cc: Tiphaine Martin <tiphaine.martin@kcl.ac.uk<mailto:tiphaine.martin@kcl.ac.uk>>, "bioconductor@r-project.org<mailto:bioconductor@r-project.org>" <bioconductor@r-project.org<mailto:bioconductor@r-project.org>>, Michael Lawrence <lawrence.michael@gene.com<mailto:lawrence.michael@gene.com>>
Subject: Re: Gviz problem to extract some track with UcscTrack like Broad ChromHMM

Hi Florian,

trackNames,UCSCSession will only return the tracks in the actual browser. To get the track names from the table browser, just use trackNames,UCSCTableQuery. In other words, UCSCTableQuery is the interface to the table browser, while UCSCSession is the interface to the actual browser.

Michael


On Fri, Feb 21, 2014 at 1:40 AM, Hahne, Florian <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>> wrote:
Hi Martin,
This seems to be a problem in the rtracklayer package:

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

> grep("Broad", trackNames(session))
integer(0)

> grep("Broad", names(trackNames(session)))
integer(0)

But:
> query <- ucscTableQuery(session, "Broad ChromHMM")
> tableNames(query)
[1] "wgEncodeBroadHmmGm12878HMM" "wgEncodeBroadHmmH1hescHMM"
[3] "wgEncodeBroadHmmK562HMM"    "wgEncodeBroadHmmHepg2HMM"
[5] "wgEncodeBroadHmmHuvecHMM"   "wgEncodeBroadHmmHmecHMM"
[7] "wgEncodeBroadHmmHsmmHMM"    "wgEncodeBroadHmmNhekHMM"
[9] "wgEncodeBroadHmmNhlfHMM"

Even though the Broad ChromHMM track exists, it is not listed by trackNames(). The output of trackNames is used by Gviz to check whether the requested track exists in order to give a more useful error message. As a quick fix for now you could simply download the track data via rtracklayer into a GRanges object and use that as the input for your AnnotationTrack() constructor.

Michael, is that a bug in rtracklayer, or is it intentional that trackNames does not list all available tracks? Broad ChromHMM is also listed in the table browser:
http://genome.ucsc.edu/cgi-bin/hgTables?hgsid=363821417&clade=mammal&org=Human&db=hg19&hgta_group=allTracks&hgta_track=wgEncodeBroadHmm&hgta_table=0&hgta_regionType=range&position=chr21%3A33%2C031%2C597-33%2C041%2C570&hgta_outputType=bed&hgta_outFileName=

> sessionInfo()
R version 3.0.2 Patched (2013-10-27 r64116)
Platform: i386-apple-darwin12.5.0/i386 (32-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] rtracklayer_1.22.0   GenomicRanges_1.14.4 XVector_0.2.0
[4] IRanges_1.20.6       Biobase_2.22.0       BiocGenerics_0.8.0
[7] Gviz_1.6.0           BiocInstaller_1.12.0

loaded via a namespace (and not attached):
 [1] AnnotationDbi_1.24.0   biomaRt_2.18.0         Biostrings_2.30.1
 [4] biovizBase_1.10.7      bitops_1.0-6           BSgenome_1.30.0
 [7] cluster_1.14.4         colorspace_1.2-4       DBI_0.2-7
[10] dichromat_2.0-0        Formula_1.1-1          GenomicFeatures_1.14.2
[13] Hmisc_3.13-0           labeling_0.2           lattice_0.20-24
[16] latticeExtra_0.6-26    munsell_0.4.2          plyr_1.8
[19] RColorBrewer_1.0-5     RCurl_1.95-4.1         Rsamtools_1.14.2
[22] RSQLite_0.11.4         scales_0.2.3           splines_3.0.2
[25] stats4_3.0.2           stringr_0.6.2          survival_2.37-4
[28] XML_3.98-1.1           zlibbioc_1.8.0

Florian





Hi,

My genome is hg19 and I try to have the list of tables related to track "Broad ChromHMM ". I used the command line from rtracklayer to create the vector of potential tables.

I put my sessionInfo(). Sorry to have forgotten to give you it.

Also, I don't know if I am alone in this situation but when I read your documentation from web navigator (safari or firefox) or preview in mac OS X 10.6, I don't see the picture.

Regards,
Tiphaine

On 17/02/14 08:31, Hahne, Florian wrote:
Hi Martin,
I'd really like to help, but from you code below I can't tell for which genome you are trying to do this (the value of 'gen'). I also have no idea how you came up with the 'track.name<http://track.name>' vector.
In general, Gviz is using rtracklayer::tableNames to figure out which tables and tracks are available. So you should get the same results, assuming that you checked for the same chromosome.
Also please always include the output of sessionInfo() when asking for help in order for us to know which R and package version we are dealing with.
Florian

From: <Martin>, Tiphaine <tiphaine.martin@kcl.ac.uk<mailto:tiphaine.martin@kcl.ac.uk>>
Date: Thursday, February 13, 2014 11:18 PM
To: Florian Hahne <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>>
Subject: Gviz problem to extract some track with UcscTrack like Broad ChromHMM

Dear Florian,

I am trying to use your package Gviz to visualise my data and some data from UCSC, for example: "Broad ChromHMM”. But I have a error message.
I don’t understand because I have checked with the package rtracklayer, whose your package inherits, the name of tracks and tables. Could you help me ?

Regards

Tiph
R Command used to find the name of track and table
>track.names["Broad ChromHMM"]
    Broad ChromHMM
“wgEncodeBroadHmm"

 >sapply(track, function(track) {
+     tableNames(ucscTableQuery(mySession, track=track))
+     })
      Broad ChromHMM
 [1,] "wgEncodeBroadHmmGm12878HMM"
 [2,] "wgEncodeBroadHmmH1hescHMM"
 [3,] "wgEncodeBroadHmmK562HMM"
 [4,] "wgEncodeBroadHmmHepg2HMM"
 [5,] "wgEncodeBroadHmmHuvecHMM"
 [6,] "wgEncodeBroadHmmHmecHMM"
 [7,] "wgEncodeBroadHmmHsmmHMM"
 [8,] "wgEncodeBroadHmmNhekHMM"
 [9,] "wgEncodeBroadHmmNhlfHMM"
> UcscTrack(genome = gen, chrom

My errors when I try to use  UcscTrack:
> UcscTrack(genome = gen, chromosome = chr, track = "Broad ChromHMM",
+           table="wgEncodeBroadHmmGm12878HMM",
+           from = start, to = end, trackType = "AnnotationTrack",
+           rstarts = "chromStart", rends = "chromEnd", gene = "name",
+           symbol = "name", strand = "strand",
+           fill = "itemRgb", name = "UCSC Genes”)

Error in match.arg(track, sort(c(availTracks, names(availTracks)))) :
  'arg' should be one of “1000G Ph1 Accsbl”, “1000G Ph1 Vars”, “46-Way Cons”, “5% Lowest S”, “acembly”, “AceView Genes”, “Affy Exon Array”, “Affy GNF1H”, “Affy RNA Loc”, “Affy U133”, “Affy U133Plus2”, “Affy U95”, “affyExonArray”, “affyGnf1h”, “affyU133”, “affyU133Plus2”, “affyU95”, “All SNPs(132)”, “All SNPs(135)”, “All SNPs(137)”, “All SNPs(138)”, “Allen Brain”, “allenBrainAli”, “allHg19RS_BW”, “altSeqComposite10”, “Assembly”, “BAC End Pairs”, “bacEndPairs”, “Base Position”, “BU ORChID”, “Burge RNA-seq”, “burgeRnaSeqGemMapperAlign”, “CCDS”, “ccdsGene”, “CD34 DnaseI”, “CGAP SAGE”, “cgapSage”, “chainSelf”, “Chromosome Band”, “clinvar”, “ClinVar Variants”, “Common SNPs(132)”, “Common SNPs(135)”, “Common SNPs(137)”, “Common SNPs(138)”, “Cons Indels MmCf”, “cons100way”, “cons46way”, “Conserv


> UcscTrack(genome = gen, chromosome = chr, track = "wgEncodeBroadHmm",
+           table="wgEncodeBroadHmmGm12878HMM",
+           from = start, to = end, trackType = "AnnotationTrack",
+           rstarts = "chromStart", rends = "chromEnd", gene = "name",
+           symbol = "name", strand = "strand",
+           fill = "itemRgb", name = "UCSC Genes”)

Error in match.arg(track, sort(c(availTracks, names(availTracks)))) :
  'arg' should be one of “1000G Ph1 Accsbl”, “1000G Ph1 Vars”, “46-Way Cons”, “5% Lowest S”, “acembly”, “AceView Genes”, “Affy Exon Array”, “Affy GNF1H”, “Affy RNA Loc”, “Affy U133”, “Affy U133Plus2”, “Affy U95”, “affyExonArray”, “affyGnf1h”, “affyU133”, “affyU133Plus2”, “affyU95”, “All SNPs(132)”, “All SNPs(135)”, “All SNPs(137)”, “All SNPs(138)”, “Allen Brain”, “allenBrainAli”, “allHg19RS_BW”, “altSeqComposite10”, “Assembly”, “BAC End Pairs”, “bacEndPairs”, “Base Position”, “BU ORChID”, “Burge RNA-seq”, “burgeRnaSeqGemMapperAlign”, “CCDS”, “ccdsGene”, “CD34 DnaseI”, “CGAP SAGE”, “cgapSage”, “chainSelf”, “Chromosome Band”, “clinvar”, “ClinVar Variants”, “Common SNPs(132)”, “Common SNPs(135)”, “Common SNPs(137)”, “Common SNPs(138)”, “Cons Indels MmCf”, “cons100way”, “cons46way”, “Conserv



--
----------------------------
Tiphaine Martin
PhD Research Student | King's College
The Department of Twin Research & Genetic Epidemiology
Genetics & Molecular Medicine Division
St Thomas' Hospital
4th Floor, Block D,
South Wing
SE1 7EH London
United Kingdom

email : tiphaine.martin@kcl.ac.uk<mailto:tiphaine.martin@kcl.ac.uk>
Fax: +44 (0) 207 188 6761<tel:%2B44%20%280%29%20207%20188%206761>


	[[alternative HTML version deleted]]

