[Bioc-sig-seq] rtracklayer and wig manipulation

Simon Anders anders at ebi.ac.uk
Thu Jul 23 19:45:23 CEST 2009


Hi Michael

Michael Lawrence wrote:
> Well, to get the scores:
> 
> track <- import("foo.wig")
> scores <- score(track)
> 
> Now you are free to use any of the functions in R for smoothing a numeric
> vector. Like loess(), runmed(), etc.

Careful! This does not work, as you ignore the ranges.

Take, for example, this wiggle file here, which starts with:

track type=wiggle_0 name="coverage 06-GL3"
06      1       40128   0
06      40128   40164   0.881
06      40164   40245   0
06      40245   40257   0.881
06      40257   40281   1.444
[...]

Observe:

> w <- import( "igb/06-GL3-coverage.wig" )
> s <- score( w )
> str(s)
 num [1:338864] 0 0.881 0 0.881 1.444 ...

The score vector 's' should start with 40127 times a '0' but we have
only a single 0.


  Simon



More information about the Bioc-sig-sequencing mailing list