Gvis: Adding colour and transparency to overlaid alignment tracks
1
0
Entering edit mode
camerond • 0
@camerond-15316
Last seen 5 weeks ago
United Kingdom

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 • 1.1k views
ADD COMMENT
3
Entering edit mode
Robert Ivanek ▴ 730
@robert-ivanek-5892
Last seen 5 months ago
Switzerland

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. 

library(Gviz)
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.

Robert

ADD COMMENT
0
Entering edit mode

Thanks Robert.

That's exactly what I needed. 

 

 

ADD REPLY

Login before adding your answer.

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