Search
Question: displaying coverage RNAseq Gviz
0
gravatar for florian.hahne@novartis.com
3.5 years ago by
Switzerland
Hi Estefania, I would suggest you upgrade to the latest R and Bioconductor versions. There is much nicer support for Bam files in version 1.8. You should take a look at the new AlignmentsTrack class. Let me know if you have remaining questions after that. Cheers, Florian From: Estefania Mancini <mancini.estefania@gmail.com<mailto:mancini.estefania@gmail.com>> Date: Tuesday 13 May 2014 17:55 To: Florian Hahne <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>> Subject: displaying coverage RNAseq Gviz Dear Florian, I'm trying to plot bam coverage with Gviz. I'd like to mimic IGB picture but I dont know which parameter is missing Can you help me? I suspect I have to change the "range" in which bars are defined. I need to plot a point/bar per base. I attach both pictures, and Gviz chunk of code. Many thanks in advance Estefania ############################################################ #genome genomeAT<-loadDb(file="c1.sqlite") class(genomeAT) [1] "TranscriptDb" attr(,"package") [1] "GenomicFeatures" GeneRegionTrack(genomeAT) GeneRegionTrack(txdb) txTrAT <- GeneRegionTrack(genomeAT, chromosome = "1", start = 3631, end = 5899, options(ucscChromosomeNames=FALSE)) feature(txTrAT) plotTracks(txTrAT) #OK ###coverage bamfile="ColA.c1.bam" gen1Cov <- DataTrack(range = bamfile, genome = "genomeAT", type = "h", name = "Coverage", windowSize=1, chromosome = "1", options(ucscChromosomeNames=FALSE)) gen1Cov2<- DataTrack( range = bamfile, genome = "genomeAT", name = "Coverage", chromosome = "1", options(ucscChromosomeNames=FALSE), type="b" ) gen1Cov3 <- DataTrack(range = bamfile, genome = "genomeAT", type = "histogram", name = "Coverage", windowSize=1, chromosome = "1", col.histogram="blue", fill.histogram="blue", options(ucscChromosomeNames=FALSE)) plotTracks(list(gen1Cov, gen1Cov2,gen1Cov3, txTrAT), from = 3631, to = 5899, chromosome = "1" ) ############################################# sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] grid parallel stats graphics grDevices utils datasets methods base other attached packages: [1] Rsamtools_1.14.3 Biostrings_2.30.1 Gviz_1.6.0 multicore_0.1-7 ASpli_1.6 [6] edgeR_3.4.2 limma_3.18.13 GenomicFeatures_1.14.5 AnnotationDbi_1.24.0 Biobase_2.22.0 [11] GenomicRanges_1.14.4 XVector_0.2.0 IRanges_1.20.7 BiocGenerics_0.8.0 loaded via a namespace (and not attached): [1] biomaRt_2.18.0 biovizBase_1.10.8 bitops_1.0-6 BSgenome_1.30.0 cluster_1.15.2 colorspace_1.2-4 [7] DBI_0.2-7 dichromat_2.0-0 Formula_1.1-1 Hmisc_3.14-4 lattice_0.20-29 latticeExtra_0.6-26 [13] munsell_0.4.2 plyr_1.8.1 RColorBrewer_1.0-5 Rcpp_0.11.1 RCurl_1.95-4.1 RSQLite_0.11.4 [19] rtracklayer_1.22.7 scales_0.2.4 splines_3.0.2 stats4_3.0.2 survival_2.37-7 tools_3.0.2 [25] XML_3.98-1.1 zlibbioc_1.8.0 [[alternative HTML version deleted]]
ADD COMMENTlink modified 3.5 years ago • written 3.5 years ago by florian.hahne@novartis.com1.5k
0
gravatar for florian.hahne@novartis.com
3.5 years ago by
Switzerland
Hi Estefania, You can control the size of the individual track using the ‘size’ display parameter. Of course those values are only relative to the overall device size, and you may need a couple of trial and error iterations to get it right. The resolution of your plot has nothing to do with Gviz, this is handled by the graphics device that you are plotting to. I am not quite sure what you mean by “scaling coverage plots”. If you want to control the Y-axis scaling, you should take a look at the “ylim” parameter. In order to increase the size of the gene model, again the “size” parameter is your friend. The highlighting track placement is unfortunate indeed. In my use cases it always looked better in the background, but this is clearly not the case for your example. I will have to add a parameter to control the placement, but that could take a week or two. Will get back to you. Florian From: Estefania Mancini <mancini.estefania@gmail.com<mailto:mancini.estefania@gmail.com>> Date: Wednesday 14 May 2014 19:56 To: Florian Hahne <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>> Subject: Re: displaying coverage RNAseq Gviz Dear Florian, I've got few new questions. I'd like to plot gene models a little bigger and also I'd like to scale coverage plot between conditions. How do you configure the final size and resolution of the picture? And the last one, is there any way of telling the picture that highlight box is in front of everything. In my case, sometimes it is in the top and sometimes is in the bottom I attach some examples. Thank you very much, Estefania 2014-05-14 11:10 GMT-03:00 Estefania Mancini <mancini.estefania@gmail.com<mailto:mancini.estefania@gmail.com>>: Thank you Florian for your prompt reply. I've update R and Bioc and now I've solved the problem!!! I attach the picture. Now I will play a little trying to have nice pictures for my next presentation. Due to we are working with alternative splicing and RNA seq, I'd like to keep in touch with you in the future. Have a nice day, Estefania 2014-05-14 8:35 GMT-03:00 Hahne, Florian <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>>: Hi Estefania, I would suggest you upgrade to the latest R and Bioconductor versions. There is much nicer support for Bam files in version 1.8. You should take a look at the new AlignmentsTrack class. Let me know if you have remaining questions after that. Cheers, Florian From: Estefania Mancini <mancini.estefania@gmail.com<mailto:mancini.estefania@gmail.com>> Date: Tuesday 13 May 2014 17:55 To: Florian Hahne <florian.hahne@novartis.com<mailto:florian.hahne@novartis.com>> Subject: displaying coverage RNAseq Gviz Dear Florian, I'm trying to plot bam coverage with Gviz. I'd like to mimic IGB picture but I dont know which parameter is missing Can you help me? I suspect I have to change the "range" in which bars are defined. I need to plot a point/bar per base. I attach both pictures, and Gviz chunk of code. Many thanks in advance Estefania ############################################################ #genome genomeAT<-loadDb(file="c1.sqlite") class(genomeAT) [1] "TranscriptDb" attr(,"package") [1] "GenomicFeatures" GeneRegionTrack(genomeAT) GeneRegionTrack(txdb) txTrAT <- GeneRegionTrack(genomeAT, chromosome = "1", start = 3631, end = 5899, options(ucscChromosomeNames=FALSE)) feature(txTrAT) plotTracks(txTrAT) #OK ###coverage bamfile="ColA.c1.bam" gen1Cov <- DataTrack(range = bamfile, genome = "genomeAT", type = "h", name = "Coverage", windowSize=1, chromosome = "1", options(ucscChromosomeNames=FALSE)) gen1Cov2<- DataTrack( range = bamfile, genome = "genomeAT", name = "Coverage", chromosome = "1", options(ucscChromosomeNames=FALSE), type="b" ) gen1Cov3 <- DataTrack(range = bamfile, genome = "genomeAT", type = "histogram", name = "Coverage", windowSize=1, chromosome = "1", col.histogram="blue", fill.histogram="blue", options(ucscChromosomeNames=FALSE)) plotTracks(list(gen1Cov, gen1Cov2,gen1Cov3, txTrAT), from = 3631, to = 5899, chromosome = "1" ) ############################################# sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] grid parallel stats graphics grDevices utils datasets methods base other attached packages: [1] Rsamtools_1.14.3 Biostrings_2.30.1 Gviz_1.6.0 multicore_0.1-7 ASpli_1.6 [6] edgeR_3.4.2 limma_3.18.13 GenomicFeatures_1.14.5 AnnotationDbi_1.24.0 Biobase_2.22.0 [11] GenomicRanges_1.14.4 XVector_0.2.0 IRanges_1.20.7 BiocGenerics_0.8.0 loaded via a namespace (and not attached): [1] biomaRt_2.18.0 biovizBase_1.10.8 bitops_1.0-6 BSgenome_1.30.0 cluster_1.15.2 colorspace_1.2-4 [7] DBI_0.2-7 dichromat_2.0-0 Formula_1.1-1 Hmisc_3.14-4 lattice_0.20-29 latticeExtra_0.6-26 [13] munsell_0.4.2 plyr_1.8.1 RColorBrewer_1.0-5 Rcpp_0.11.1 RCurl_1.95-4.1 RSQLite_0.11.4 [19] rtracklayer_1.22.7 scales_0.2.4 splines_3.0.2 stats4_3.0.2 survival_2.37-7 tools_3.0.2 [25] XML_3.98-1.1 zlibbioc_1.8.0 [[alternative HTML version deleted]]
ADD COMMENTlink written 3.5 years ago by florian.hahne@novartis.com1.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 238 users visited in the last hour