plotting coverage in log scale with Gviz
0
0
Entering edit mode
Alejandro Reyes ★ 1.9k
@alejandro-reyes-5124
Last seen 5 months ago
Novartis Institutes for BioMedical Rese…

Hi, 

Gviz is amazing to visualize genomic data (big thanks to the developers).

I was wondering, it possible to plot the coverage in a log scale from an AlignmentTrack? I have been trying to do this by passing the parameter 'transformation' but I don't see any effect in the plot:

library(Gviz)
afrom <- 2960000
ato <- 3160000
alTrack <- AlignmentsTrack(system.file(package = "Gviz", "extdata", "gapped.bam"),
                           isPaired = TRUE)
bmt <- BiomartGeneRegionTrack(genome = "hg19", chromosome = "chr12",
                              start = afrom, end = ato,
                              filter = list(with_ox_refseq_mrna = TRUE),
                              stacking = "dense")
plotTracks(c(bmt, alTrack), from = afrom, to = ato,
           chromosome = "chr12", type="coverage",
           transformation=function(x){log2(x+1)})

 

Am I missing something?

Alejandro Reyes

ps. My sessionInfo()

> sessionInfo()
R Under development (unstable) (2016-05-09 r70593)
Platform: x86_64-apple-darwin15.3.0 (64-bit)
Running under: OS X 10.11.5 (El Capitan)

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] grid      parallel  stats4    stats     graphics  grDevices utils    
 [8] datasets  methods   base     

other attached packages:
[1] Gviz_1.16.1           GenomicRanges_1.23.27 GenomeInfoDb_1.7.6   
[4] IRanges_2.5.46        S4Vectors_0.9.51      BiocGenerics_0.17.5  
[7] BiocInstaller_1.22.2 

loaded via a namespace (and not attached):
 [1] SummarizedExperiment_1.1.24   VariantAnnotation_1.18.1     
 [3] splines_3.4.0                 lattice_0.20-33              
 [5] colorspace_1.2-6              htmltools_0.3.5              
 [7] rtracklayer_1.31.10           GenomicFeatures_1.23.30      
 [9] interactiveDisplayBase_1.10.3 survival_2.39-2              
[11] XML_3.98-1.4                  foreign_0.8-66               
[13] DBI_0.3.1                     ensembldb_1.4.6              
[15] BiocParallel_1.5.21           RColorBrewer_1.1-2           
[17] matrixStats_0.50.2            plyr_1.8.3                   
[19] zlibbioc_1.17.1               Biostrings_2.39.14           
[21] munsell_0.4.3                 gtable_0.2.0                 
[23] latticeExtra_0.6-28           Biobase_2.31.3               
[25] biomaRt_2.27.2                httpuv_1.3.3                 
[27] AnnotationDbi_1.33.12         Rcpp_0.12.4.5                
[29] acepack_1.3-3.3               xtable_1.8-2                 
[31] BSgenome_1.40.0               scales_0.4.0                 
[33] Hmisc_3.17-3                  XVector_0.11.8               
[35] mime_0.4                      Rsamtools_1.24.0             
[37] gridExtra_2.2.1               AnnotationHub_2.4.2          
[39] ggplot2_2.1.0                 digest_0.6.9                 
[41] biovizBase_1.20.0             shiny_0.13.2                 
[43] tools_3.4.0                   bitops_1.0-6                 
[45] RCurl_1.95-4.8                RSQLite_1.0.0                
[47] dichromat_2.0-0               Formula_1.2-1                
[49] cluster_2.0.4                 Matrix_1.2-5                 
[51] httr_1.1.0                    R6_2.1.2                     
[53] rpart_4.1-10                  GenomicAlignments_1.7.21     
[55] nnet_7.3-12                   compiler_3.4.0               

 

Gviz gviz • 1.4k views
ADD COMMENT
0
Entering edit mode

Hi Alejandro,

yeah, that sounds like a perfectly reasonable thing to do. We didn't have the AlignmentTrack class inherit from the virtual NumericTrack class, so the transformation parameter is not being picked up. I do agree however that one should be able to do that. Will take a look at the necessary changes as soon as I find some free minutes. Shouldn't be too big of a deal. Will get back with more details once I am done.

Florian

ADD REPLY
0
Entering edit mode

Thanks Florian! I will stay tuned.
Alejandro

ADD REPLY
0
Entering edit mode

transfomations in coverage plots are now available in the dev version (already built). Also just committed a back-port to prod, should become available soon in version 1.16.2

Florian

ADD REPLY

Login before adding your answer.

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