tracks() and plotIdeogram() with non desired results in ggbio 1.10.9
1
0
Entering edit mode
Tengfei Yin ▴ 490
@tengfei-yin-6162
Last seen 10.2 years ago
Hi Leo, Forget to mention, it's being fixed last week, Ideogram track is not updated to accommodate new class set that's what caused the bug. cheers Tengfei On Mon, Nov 25, 2013 at 2:37 PM, Leonardo Collado Torres <lcollado@jhsph.edu> wrote: > Ok, and thank you as always for the quick fixes! > > Cheers, > Leo > > > On Mon, Nov 25, 2013 at 2:27 PM, Tengfei Yin <tengfei.yin@sbgenomics.com>wrote: > >> Thanks for reporting the issue, it's clearly another bug, I will work on >> that today! >> >> cheers >> >> Tengfei >> >> >> On Mon, Nov 25, 2013 at 2:20 PM, Leonardo Collado Torres < >> lcollado@jhsph.edu> wrote: >> >>> Hello Tengfei and BioC list, >>> >>> I believe that tracks() and plotIdeogram() are not working as intended >>> in ggbio 1.10.9 Page 20 of >>> http://www.bioconductor.org/packages/release/bioc/vignettes/ggbio/ inst/doc/ggbio.pdf shows >>> a tracks example plot with an ideogram. I think that tracks() is not >>> handling properly the ggplot2 controls for the ideogram track as it is >>> adding what looks like a layer label ("chr1" in grey) and a discrete scale >>> (probably scale_fill_discrete) for the cytobands. >>> >>> You can produce the plot using the code in pages 19 and 20 from the >>> vignette (pasted below): >>> >>> > library(ggbio) >>> > ## require internet connection >>> > p.ideo <- plotIdeogram(genome = "hg19") >>> Loading... >>> Done >>> use chr1 automatically >>> > library(TxDb.Hsapiens.UCSC.hg19.knownGene) >>> > txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene >>> > wh <- GRanges("chr16", IRanges(30064491, 30081734)) >>> > p1 <- autoplot(txdb, which = wh, names.expr = "gene_id") >>> Aggregating TranscriptDb... >>> Parsing exons... >>> Parsing cds... >>> Parsing transcripts... >>> Parsing utrs... >>> ------exons... >>> ------cdss... >>> ------introns... >>> ------utr... >>> aggregating... >>> Done >>> Constructing graphics... >>> Warning message: >>> In ans[] <- x : >>> number of items to replace is not a multiple of replacement length >>> > p2 <- autoplot(txdb, which = wh, stat = "reduce", color = "brown", >>> + fill = "brown") >>> Aggregating TranscriptDb... >>> Parsing exons... >>> Parsing cds... >>> Parsing transcripts... >>> Parsing utrs... >>> ------exons... >>> ------cdss... >>> ------introns... >>> ------utr... >>> aggregating... >>> Done >>> Constructing graphics... >>> Warning message: >>> In ans[] <- x : >>> number of items to replace is not a multiple of replacement length >>> > tracks(p.ideo, full = p1, reduce = p2, heights = c(1.5, 5, 1)) + >>> + ylab("") + theme_tracks_sunset() >>> >>> I noticed this when using: >>> >>> > library(derfinder) ## From https://github.com/lcolladotor/derfinder >>> > example("plotCluster", "derfinder") >>> >>> >>> Session info: >>> >>> > sessionInfo() >>> R version 3.0.2 (2013-09-25) >>> Platform: x86_64-apple-darwin10.8.0 (64-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] parallel stats graphics grDevices utils datasets methods >>> base >>> >>> other attached packages: >>> [1] bumphunter_1.3.3 locfit_1.5-9.1 >>> iterators_1.0.6 >>> [4] foreach_1.4.1 derfinder_0.0.37 >>> RcppArmadillo_0.3.920.3 >>> [7] Rcpp_0.10.6 >>> TxDb.Hsapiens.UCSC.hg19.knownGene_2.10.1 GenomicFeatures_1.14.2 >>> >>> [10] AnnotationDbi_1.24.0 Biobase_2.22.0 >>> rtracklayer_1.22.0 >>> [13] GenomicRanges_1.14.3 XVector_0.2.0 >>> IRanges_1.20.6 >>> [16] BiocGenerics_0.8.0 ggbio_1.10.9 >>> ggplot2_0.9.3.1 >>> >>> loaded via a namespace (and not attached): >>> [1] biomaRt_2.18.0 Biostrings_2.30.1 biovizBase_1.10.4 >>> bitops_1.0-6 BSgenome_1.30.0 >>> [6] cluster_1.14.4 codetools_0.2-8 colorspace_1.2-4 >>> DBI_0.2-7 dichromat_2.0-0 >>> [11] digest_0.6.3 doRNG_1.5.5 Formula_1.1-1 >>> grid_3.0.2 gridExtra_0.9.1 >>> [16] gtable_0.1.2 Hmisc_3.13-0 itertools_0.1-1 >>> labeling_0.2 lattice_0.20-24 >>> [21] MASS_7.3-29 matrixStats_0.8.12 munsell_0.4.2 >>> pkgmaker_0.17.4 plyr_1.8 >>> [26] proto_0.3-10 qvalue_1.36.0 R.methodsS3_1.5.2 >>> RColorBrewer_1.0-5 RCurl_1.95-4.1 >>> [31] registry_0.2 reshape2_1.2.2 rngtools_1.2.3 >>> Rsamtools_1.14.2 RSQLite_0.11.4 >>> [36] scales_0.2.3 splines_3.0.2 stats4_3.0.2 >>> stringr_0.6.2 survival_2.37-4 >>> [41] tcltk_3.0.2 tools_3.0.2 >>> VariantAnnotation_1.8.6 XML_3.95-0.2 xtable_1.7-1 >>> [46] zlibbioc_1.8.0 >>> >>> >>> Best, >>> Leonardo >>> >>> Leonardo Collado Torres, PhD student >>> Department of Biostatistics >>> Johns Hopkins University >>> Bloomberg School of Public Health >>> Website: http://www.biostat.jhsph.edu/~lcollado/<http: bit.ly="" lcolladotorres=""> >>> Blog: http://lcolladotor.github.io/ <http: bit.ly="" fellbit=""> >>> >>> >>> >>> >> >> >> -- >> Tengfei Yin, PhD >> Seven Bridges Genomics >> sbgenomics.com >> 625 Mt. Auburn St. Suite #208 >> Cambridge, MA 02138 >> (617) 866-0446 >> > > -- Tengfei Yin, PhD Seven Bridges Genomics sbgenomics.com 625 Mt. Auburn St. Suite #208 Cambridge, MA 02138 (617) 866-0446 [[alternative HTML version deleted]]
TranscriptDb ideogram ggbio TranscriptDb ideogram ggbio • 1.3k views
ADD COMMENT
0
Entering edit mode
@lcolladotor
Last seen 4 weeks ago
United States
Hi Tengfei, Thank you for fixing this issue! I have a related issue with tracks() though as illustrated with the following code: library("ggbio") p.ideo <- plotIdeogram(genome = "hg19") library("TxDb.Hsapiens.UCSC.hg19.knownGene") txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene wh <- GRanges("chr16", IRanges(30064491, 30081734)) p1 <- autoplot(txdb, which = wh, names.expr = "gene_id") p2 <- autoplot(txdb, which = wh, stat = "reduce", color = "brown", fill = "brown") ## Plot 1 tracks(p.ideo, full = p1, reduce = p2, heights = c(1.5, 5, 1)) + ylab("") + theme_tracks_sunset() ## Plot 2 tracks(p.ideo, full = p1, reduce = p2, heights = c(1.5, 5, 1), title="test title") + ylab("") + theme_tracks_sunset() When using tracks(title="something"), the labels on the left side get shifted up by one. On "plot 1", "full" is the label for the detailed exons track. However on "plot 2", "full" becomes the label for the ideogram track. Cheers, Leo > sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-apple-darwin10.8.0 (64-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] parallel stats graphics grDevices utils datasets methods base other attached packages: [1] TxDb.Hsapiens.UCSC.hg19.knownGene_2.10.1 GenomicFeatures_1.14.2 [3] AnnotationDbi_1.24.0 Biobase_2.22.0 [5] rtracklayer_1.22.0 GenomicRanges_1.14.3 [7] XVector_0.2.0 IRanges_1.20.6 [9] BiocGenerics_0.8.0 ggbio_1.10.10 [11] ggplot2_0.9.3.1 loaded via a namespace (and not attached): [1] biomaRt_2.18.0 Biostrings_2.30.1 biovizBase_1.10.5 bitops_1.0-6 [5] BSgenome_1.30.0 cluster_1.14.4 colorspace_1.2-4 DBI_0.2-7 [9] dichromat_2.0-0 digest_0.6.4 Formula_1.1-1 grid_3.0.2 [13] gridExtra_0.9.1 gtable_0.1.2 Hmisc_3.13-0 labeling_0.2 [17] lattice_0.20-24 MASS_7.3-29 munsell_0.4.2 plyr_1.8 [21] proto_0.3-10 RColorBrewer_1.0-5 RCurl_1.95-4.1 reshape2_1.2.2 [25] Rsamtools_1.14.2 RSQLite_0.11.4 scales_0.2.3 splines_3.0.2 [29] stats4_3.0.2 stringr_0.6.2 survival_2.37-4 tools_3.0.2 [33] VariantAnnotation_1.8.7 XML_3.95-0.2 zlibbioc_1.8.0 On Thu, Dec 5, 2013 at 11:06 AM, Tengfei Yin <tengfei.yin@sbgenomics.com>wrote: > Hi Leo, > > Forget to mention, it's being fixed last week, Ideogram track is not > updated to accommodate new class set that's what caused the bug. > > cheers > > Tengfei > > > On Mon, Nov 25, 2013 at 2:37 PM, Leonardo Collado Torres < > lcollado@jhsph.edu> wrote: > >> Ok, and thank you as always for the quick fixes! >> >> Cheers, >> Leo >> >> >> On Mon, Nov 25, 2013 at 2:27 PM, Tengfei Yin <tengfei.yin@sbgenomics.com>wrote: >> >>> Thanks for reporting the issue, it's clearly another bug, I will work on >>> that today! >>> >>> cheers >>> >>> Tengfei >>> >>> >>> On Mon, Nov 25, 2013 at 2:20 PM, Leonardo Collado Torres < >>> lcollado@jhsph.edu> wrote: >>> >>>> Hello Tengfei and BioC list, >>>> >>>> I believe that tracks() and plotIdeogram() are not working as intended >>>> in ggbio 1.10.9 Page 20 of >>>> http://www.bioconductor.org/packages/release/bioc/vignettes/ggbio /inst/doc/ggbio.pdf shows >>>> a tracks example plot with an ideogram. I think that tracks() is not >>>> handling properly the ggplot2 controls for the ideogram track as it is >>>> adding what looks like a layer label ("chr1" in grey) and a discrete scale >>>> (probably scale_fill_discrete) for the cytobands. >>>> >>>> You can produce the plot using the code in pages 19 and 20 from the >>>> vignette (pasted below): >>>> >>>> > library(ggbio) >>>> > ## require internet connection >>>> > p.ideo <- plotIdeogram(genome = "hg19") >>>> Loading... >>>> Done >>>> use chr1 automatically >>>> > library(TxDb.Hsapiens.UCSC.hg19.knownGene) >>>> > txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene >>>> > wh <- GRanges("chr16", IRanges(30064491, 30081734)) >>>> > p1 <- autoplot(txdb, which = wh, names.expr = "gene_id") >>>> Aggregating TranscriptDb... >>>> Parsing exons... >>>> Parsing cds... >>>> Parsing transcripts... >>>> Parsing utrs... >>>> ------exons... >>>> ------cdss... >>>> ------introns... >>>> ------utr... >>>> aggregating... >>>> Done >>>> Constructing graphics... >>>> Warning message: >>>> In ans[] <- x : >>>> number of items to replace is not a multiple of replacement length >>>> > p2 <- autoplot(txdb, which = wh, stat = "reduce", color = "brown", >>>> + fill = "brown") >>>> Aggregating TranscriptDb... >>>> Parsing exons... >>>> Parsing cds... >>>> Parsing transcripts... >>>> Parsing utrs... >>>> ------exons... >>>> ------cdss... >>>> ------introns... >>>> ------utr... >>>> aggregating... >>>> Done >>>> Constructing graphics... >>>> Warning message: >>>> In ans[] <- x : >>>> number of items to replace is not a multiple of replacement length >>>> > tracks(p.ideo, full = p1, reduce = p2, heights = c(1.5, 5, 1)) + >>>> + ylab("") + theme_tracks_sunset() >>>> >>>> I noticed this when using: >>>> >>>> > library(derfinder) ## From https://github.com/lcolladotor/derfinder >>>> > example("plotCluster", "derfinder") >>>> >>>> >>>> Session info: >>>> >>>> > sessionInfo() >>>> R version 3.0.2 (2013-09-25) >>>> Platform: x86_64-apple-darwin10.8.0 (64-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] parallel stats graphics grDevices utils datasets methods >>>> base >>>> >>>> other attached packages: >>>> [1] bumphunter_1.3.3 locfit_1.5-9.1 >>>> iterators_1.0.6 >>>> [4] foreach_1.4.1 derfinder_0.0.37 >>>> RcppArmadillo_0.3.920.3 >>>> [7] Rcpp_0.10.6 >>>> TxDb.Hsapiens.UCSC.hg19.knownGene_2.10.1 GenomicFeatures_1.14.2 >>>> >>>> [10] AnnotationDbi_1.24.0 Biobase_2.22.0 >>>> rtracklayer_1.22.0 >>>> [13] GenomicRanges_1.14.3 XVector_0.2.0 >>>> IRanges_1.20.6 >>>> [16] BiocGenerics_0.8.0 ggbio_1.10.9 >>>> ggplot2_0.9.3.1 >>>> >>>> loaded via a namespace (and not attached): >>>> [1] biomaRt_2.18.0 Biostrings_2.30.1 biovizBase_1.10.4 >>>> bitops_1.0-6 BSgenome_1.30.0 >>>> [6] cluster_1.14.4 codetools_0.2-8 colorspace_1.2-4 >>>> DBI_0.2-7 dichromat_2.0-0 >>>> [11] digest_0.6.3 doRNG_1.5.5 Formula_1.1-1 >>>> grid_3.0.2 gridExtra_0.9.1 >>>> [16] gtable_0.1.2 Hmisc_3.13-0 itertools_0.1-1 >>>> labeling_0.2 lattice_0.20-24 >>>> [21] MASS_7.3-29 matrixStats_0.8.12 munsell_0.4.2 >>>> pkgmaker_0.17.4 plyr_1.8 >>>> [26] proto_0.3-10 qvalue_1.36.0 R.methodsS3_1.5.2 >>>> RColorBrewer_1.0-5 RCurl_1.95-4.1 >>>> [31] registry_0.2 reshape2_1.2.2 rngtools_1.2.3 >>>> Rsamtools_1.14.2 RSQLite_0.11.4 >>>> [36] scales_0.2.3 splines_3.0.2 stats4_3.0.2 >>>> stringr_0.6.2 survival_2.37-4 >>>> [41] tcltk_3.0.2 tools_3.0.2 >>>> VariantAnnotation_1.8.6 XML_3.95-0.2 xtable_1.7-1 >>>> [46] zlibbioc_1.8.0 >>>> >>>> >>>> Best, >>>> Leonardo >>>> >>>> Leonardo Collado Torres, PhD student >>>> Department of Biostatistics >>>> Johns Hopkins University >>>> Bloomberg School of Public Health >>>> Website: http://www.biostat.jhsph.edu/~lcollado/<http: bit.ly="" lcolladotorres=""> >>>> Blog: http://lcolladotor.github.io/ <http: bit.ly="" fellbit=""> >>>> >>>> >>>> >>>> >>> >>> >>> -- >>> Tengfei Yin, PhD >>> Seven Bridges Genomics >>> sbgenomics.com >>> 625 Mt. Auburn St. Suite #208 >>> Cambridge, MA 02138 >>> (617) 866-0446 >>> >> >> > > > -- > Tengfei Yin, PhD > Seven Bridges Genomics > sbgenomics.com > 625 Mt. Auburn St. Suite #208 > Cambridge, MA 02138 > (617) 866-0446 > [[alternative HTML version deleted]]
ADD COMMENT

Login before adding your answer.

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