[Bioc-sig-seq] rtracklayer and wig manipulation
Ivan Gregoretti
ivangreg at gmail.com
Thu Jul 23 20:51:22 CEST 2009
That would be great. Smoothing is a very common manipulation of a wig file.
Thank you all.
Ivan
Ivan Gregoretti, PhD
National Institute of Diabetes and Digestive and Kidney Diseases
National Institutes of Health
5 Memorial Dr, Building 5, Room 205.
Bethesda, MD 20892. USA.
Phone: 1-301-496-1592
Fax: 1-301-496-9878
On Thu, Jul 23, 2009 at 2:35 PM, Patrick Aboyoun<paboyoun at fhcrc.org> wrote:
> 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
>>
>
> _______________________________________________
> 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