This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Averaging dataTracks in Gviz

Hi,

I would like to average (and maybe also additional operations such as subtraction) 2 or more DataTracks and plot the result using the Gviz (https://bioconductor.org/packages/release/bioc/html/Gviz.html) package.

Say I have:

chr="chr2"
gen="mm10"
from=1000
to=5000

dTrep1 <- DataTrack(range = path/to/rep1.bw, genome = gen, 
             name = "bigWig",chromosome = chr)
dTrep2 <- DataTrack(range = path/to/rep2.bw, genome = gen, 
             name = "bigWig",chromosome = chr)

Instead of:

plotTracks(list(dTrep1,dTrep2),type="polygon",from=from,to=to)

I would like to:

plotTracks(mean(dTrep1,dTrep2),type="polygon",from=from,to=to)

Or:

plotTracks(dTrep1-dTrep2,type="polygon",from=from,to=to)

See also posted at: https://support.bioconductor.org/p/9137211/

Thanks.

r gviz

1 answer

Answer to myself, I switched to using Trackplot (https://github.com/PoisonAlien/trackplot) and experience great support by dev.

Log in to answer this question.