This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Manipulating Wig File In R,

I am new to this file type and rtracklayer package. Now I have a wig file and a matrix with certain ranges(several times the span in wig file) on several specific sites. I want to get average score in my certain ranges on specific sites. Is there any good command in this package I can use ? or any good ways to get a matrix with columns only on start, end, score ? Thanks you in advance guys :)

r wiggle

3 answers

I would highly recommend using GenomicRanges: http://www.bioconductor.org/packages/2.11/bioc/html/GenomicRanges.html

It is very easy to construct GRanges objects from WIG files - or any other matrix for that matter, and it has the functions built in that you are looking for (mean/median/sum etc over defined windows).

You could invoke a system command with the *wig tools developed by the UCSC: ( http://hgdownload.cse.ucsc.edu/admin/exe/ ) and grab the results.

thank you very much

Log in to answer this question.