Question: Gvis: Adding colour and transparency to overlaid alignment tracks
gravatar for camerond
19 months ago by
camerond0 wrote:

I'm trying to overlay alignment tracks in the Gvis package. I have data for 3 technical replicates from 2 different cell types, so 6 alignment datasets in total. 

I have managed to overlay the alignment tracks for the technical replicates in each cell type, so I have 2 composite alignment tracks in total, each with 3 overlaid alignment tracks; one from each technical replicate. However all tracks are currently in the default grey and I can't work out how to change the colour and transparency of the individual tracks so that when they are overlaid it is possible to discern the outline/colours of the individual tracks within the composite image. 

Can anyone suggest how to do this. Is it possible in the Gvis package?

gviz alignment tracks • 291 views
ADD COMMENTlink modified 19 months ago by Robert Ivanek640 • written 19 months ago by camerond0
Answer: Gvis: Adding colour and transparency to overlaid alignment tracks
gravatar for Robert Ivanek
19 months ago by
Robert Ivanek640
Robert Ivanek640 wrote:

I believe you can achieve that if you change colouring and alpha level of individual tracks before making an OverlayTrack in Gviz package. There is an example in the Gvivignette with DataTrack. But the same applies to other track types too. Here is an example using AlignmentTrack class. 

alTrack <- AlignmentsTrack(system.file(package="Gviz", "extdata", "GSM461179_S2_DRSC_CG8144_RNAi_1_bmm.bam"), isPaired=TRUE, col="#377EB8", fill="#B3CDE3")
alTrack2 <- AlignmentsTrack(system.file(package="Gviz", "extdata", "GSM461176_S2_DRSC_Untreated_1_bmm.bam"), isPaired=TRUE, col="#E41A1C", fill="#FBB4AE")
displayPars(alTrack) <- list(alpha.title=1, alpha=0.5)
displayPars(alTrack2) <- list(alpha.title=1, alpha=0.5)
ot <- OverlayTrack(trackList=list(alTrack, alTrack2))


Hope that helps.


ADD COMMENTlink written 19 months ago by Robert Ivanek640

Thanks Robert.

That's exactly what I needed. 



ADD REPLYlink written 18 months ago by camerond0
Please log in to add an answer.


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