[BioC] Gviz - Beginner - Problem reproducing the provided examples

Martin Morgan mtmorgan at fhcrc.org
Thu Sep 5 19:10:29 CEST 2013


On 09/05/2013 10:02 AM, Dan Tenenbaum wrote:
> On Thu, Sep 5, 2013 at 9:51 AM, Jager, Dominik <jager.9 at osu.edu> wrote:
>> Hi,
>>
>> Sorry for the double post!
>>
>> I'm a R and Bioconductor beginner currently trying to get myself familiar with the Gviz package,
>> thus "playing" around with the examples provided in the package manual. I'm using
>> Bioconductor version 2.12 and this is what is happening:
>>
>>> library(GenomicRanges)
>>> library(Gviz)
>>> data(cpgIslands)
>>> chr <- as.character(unique(seqnames(cpgIslands)))
>>> gen <- genome(cpgIslands)
>>> AnnotationTrack(cpgIslands, name = "CpG") -> atrack
>>> GenomeAxisTrack() -> gtrack
>>> plotTracks(atrack, gtrack)
>>
>
> I don't see this code in either the manual pages or the vignette of Gviz 1.4.5.
> Furthermore, this code doesn't look right. Assignments go on the left,
>   and use ",-", so  instead of
>
> GenomeAxisTrack() -> gtrack
>
> You want to say:
>
> gtrack <- GenomeAxisTrack()

actually, one of those fun things about R is that left and right assignments are 
both defined

     x <- 1 -> y

I think the correct syntax for the final line is

     plotTracks(list(atrack, gtrack))

Martin

>
> I suggest that you copy and paste the example you're interested in,
> and then make one small change at a time until you get it to do what
> you want.
>
> Dan
>
>
>
>> Fehler in rep(no, length.out = length(ans)) :
>>    attempt to replicate an object of type 'S4'
>>
>> Further information:
>>
>> --------------------------------------------
>>> traceback()
>> 8: ifelse(is.null(from), -Inf, from)
>> 7: ifelse(is.null(from), -Inf, from)
>> 6: .local(x, ...)
>> 5: FUN(X[[1L]], ...)
>> 4: FUN(X[[1L]], ...)
>> 3: lapply(trackList, subset, from = from, to = to, chromosome = chromosome,
>>         sort = FALSE, stacks = FALSE, use.defaults = FALSE)
>> 2: lapply(trackList, subset, from = from, to = to, chromosome = chromosome,
>>         sort = FALSE, stacks = FALSE, use.defaults = FALSE)
>> 1: plotTracks(atrack, gtrack)
>>
>> -----------------------------------------------------
>>
>>> sessionInfo()
>> R version 3.0.1 (2013-05-16)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>>
>> locale:
>>   [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
>>   [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=C                 LC_NAME=C
>>   [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] parallel  grid      stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] GenomicRanges_1.12.5 IRanges_1.18.3       BiocGenerics_0.6.0   Gviz_1.4.5           BiocInstaller_1.10.3
>>
>> loaded via a namespace (and not attached):
>>   [1] AnnotationDbi_1.22.6   Biobase_2.20.1         biomaRt_2.16.0         Biostrings_2.28.0      biovizBase_1.8.1
>>   [6] bitops_1.0-6           BSgenome_1.28.0        cluster_1.14.4         colorspace_1.2-2       DBI_0.2-7
>> [11] dichromat_2.0-0        GenomicFeatures_1.12.3 Hmisc_3.12-2           labeling_0.2           lattice_0.20-23
>> [16] munsell_0.4.2          plyr_1.8               RColorBrewer_1.0-5     RCurl_1.95-4.1         rpart_4.1-3
>> [21] Rsamtools_1.12.4       RSQLite_0.11.4         rtracklayer_1.20.4     scales_0.2.3           stats4_3.0.1
>> [26] stringr_0.6.2          tools_3.0.1            XML_3.98-1.1           zlibbioc_1.6.0
>> ------------------------------------------------
>>
>> Thanks for you help!
>>
>> Dominik
>>
>>
>> [The Ohio State University]
>> Dr. Dominik Jäger
>> Biological Sciences Department of Microbiology
>> 405 Biological Science Building | 484 West 12th Avenue Columbus, OH 43210
>> (614)-682-6890 Office
>> jager.9 at osu.edu<mailto:jager.9 at osu.edu> osu.edu<http://osu.edu>
>>
>>          [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list