Entering edit mode
                    Simon Anders
        
    
        ▴
    
    150
        @simon-anders-2626
        Last seen 11.2 years ago
        
    Hi Michael,
I've just tried to use rtracklayer, following your vignette, and ran
into two problems.
1. I cannot add any tracks to a session.
I entered the code in the vignette to produce the "targets" track and
exported it as "targets.bed". To make things easier to follow, let's
say, I start from there with a fresh R session:
   library(rtracklayer)
   # Import the data
   targets <- import("targets.bed")
   # targets is now a RangedData object with 3052 ranges and
   # sequence names chr1 chr10 chr11 chr12 ...
   # Create a session
   session <- browserSession("UCSC")
   # Add the 'targets' track to the session:
   track(session, "MYTRACK") <- targets
Is this last command correct? It does not produce an error, but it
does
not seem to do anything, either. If I list all the tracks in the
session
with
   trackNames(session)
I get a list of 196 UCSC standard tracks, but "MYTRACK" is not
mentioned.
How do I correctly add a track?
2. There is some mangling happening with the chromosome names.
The man page for 'browserView' suggests to try:
    browserView(session, GenomicRanges(20000, 50000, "chr2"))
Doing this asks my web browser to open the following URL:
http://genome.ucsc.edu/cgi-
bin/hgTracks?position=chrchr2%3a20000-50000&hgsid=133834314
Note that it says "chrchr2", i.e., a superfluous "chr" got prefixed to
the sequence name. Obviously, the UCSC page cannot deal with this and
one gets an error message displayed by JavaScript that "chrchr2" is
not
known.
I run into the same problem if I follow the vignette's code to
demonstrate 'browserView'.
If I try
    browserView(session, GenomicRanges(20000, 50000, "2"))
I get the range chr2:20000-50000 correctly displayed in my web
browser.
There is, however, still now sight of "MYTRACK".
What's going wrong here?
 > sessionInfo()
R version 2.9.0 (2009-04-17)
x86_64-unknown-linux-gnu
locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB
.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_N
AME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTI
FICATION=C
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base
other attached packages:
[1] rtracklayer_1.4.0 RCurl_0.94-1
loaded via a namespace (and not attached):
[1] Biobase_2.4.0     Biostrings_2.12.0 BSgenome_1.12.0
IRanges_1.2.0
[5] XML_2.3-0
Cheers
   Simon
+---
| Dr. Simon Anders, Dipl. Phys.
| European Bioinformatics Institute, Hinxton, Cambridgeshire, UK
| office phone +44-1223-492680, mobile phone +44-7505-841692
| preferred (permanent) e-mail: sanders at fs.tum.de
                    
                
                