[Bioc-sig-seq] rtracklayer and wig manipulation
Patrick Aboyoun
paboyoun at fhcrc.org
Thu Jul 23 20:35:41 CEST 2009
I haven't started down this road yet, but I could add 1D smoothers for
Rle objects. Then you can convert the RangedData objects to Rle objects
and run smoothers over them.
Patrick
Michael Lawrence wrote:
> On Thu, Jul 23, 2009 at 11:06 AM, Simon Anders <anders at ebi.ac.uk> wrote:
>
>
>> Michael Lawrence wrote:
>>
>>> Oops, I meant:
>>> y <- rep(score(chr1), width(chr1))
>>>
>>>
>>>
>>>> x <- as.integer(unlist(ranges(chr1)))
>>>> lo <- loess(y ~ x)
>>>>
>> But what if the intervals in the wiggle file contain gaps? That's
>> perfectly legal, after all.
>>
>>
>
> This is what the as.integer(...) is handling. 'x' will contain the actual
> position of each value in 'y'.
>
>
>
>> I also fail to see what the effect of as.integer on IRanges is supposed
>> to be. For my wiggle file, I simply get
>>
>>
>>> head( as.integer( unlist( ranges(w) ) ) )
>>>
>> [1] 2 3 4 5 6 7
>>
>>
>
> It's like calling seq(start, end) on each range in the IRanges and
> concatenating the result.
>
> It could be implemented as:
> do.call("c", lapply(seq_along(chr1), function(i) seq(start(chr1)[i],
> end(chr1)[i])))
>
> But it's actually implemented in compiled code and is very fast.
>
>
>> ir <- IRanges(c(5, 12), c(10, 15))
>> as.integer(ir)
>>
> [1] 5 6 7 8 9 10 12 13 14 15
>
>
>
>> Simon
>>
>>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>
More information about the Bioc-sig-sequencing
mailing list