Quick thought.

What if you think about doing two reduce-like operations on your data, but
you would resize them to width=1, fix="start" and do some findOverlaps mojo
with those coords. Then do the same but play with width=1 transformations
web you fix at the end.

I'm writing from my phone so can't really tease that out, but perhaps you
get the direction I'm going?



On Tuesday, April 24, 2012, Abhishek Pratap wrote:

> Hi Steve
>
> That's precisely correct. Thanks for rewording it.
>
> I am trying to merge all the rows which have a tiling distance of 1 bp or
> less on both start and end.  If a range internal doesnt agree with that
> then it should not be collapsed.
>
> I agree it is somewhat related to clustering but not exactly it.
>
>  I will mention the data link again in case anyone else want to have look
> without digging deep in the thread.
> http://pastebin.com/cccZby2t
>
> Thanks for your help guys,
> -Abhi
>
> On Tue, Apr 24, 2012 at 3:54 PM, Steve Lianoglou <
> mailinglist.honeypot@gmail.com <javascript:_e({}, 'cvml',
> 'mailinglist.honeypot@gmail.com');>> wrote:
>
>> Hi,
>>
>> On Tue, Apr 24, 2012 at 6:43 PM, Kasper Daniel Hansen
>> <kasperdanielhansen@gmail.com <javascript:_e({}, 'cvml',
>> 'kasperdanielhansen@gmail.com');>> wrote:
>> >> ir <- IRanges(start = c(1,5), width = 3)
>> >> ir
>> > IRanges of length 2
>> >    start end width
>> > [1]     1   3     3
>> > [2]     5   7     3
>> >> reduce(ir)
>> > IRanges of length 2
>> >    start end width
>> > [1]     1   3     3
>> > [2]     5   7     3
>> >> reduce(ir, min.gapwidth = 2)
>> > IRanges of length 1
>> >    start end width
>> > [1]     1   7     7
>> >
>> > As far as I understand, this is exactly what you want.  If you have
>> > further questions, I suggest you read the help page.
>>
>> This actually isn't what he wants -- but what he wants isn't
>> answerable w/ `reduce`.
>>
>> All of the OP's ranges overlap eachother -- I think he's trying to
>> split his ranges into two groups because one group has ends that are
>> very close to each other and the other's are a bit different. Note
>> that the last two rows, the ends are a greater distance away from (but
>> still *within*) the ends of the first group of ranges he's trying to
>> group.
>>
>> It's almost trying to cluster groups of reads together, but again -- not
>> really.
>>
>> Not sure why you might want to do this, but ... just to say that
>> reduce isn't the answer here.
>>
>> -steve
>>
>> --
>> Steve Lianoglou
>> Graduate Student: Computational Systems Biology
>>  | Memorial Sloan-Kettering Cancer Center
>>  | Weill Medical College of Cornell University
>> Contact Info: http://cbio.mskcc.org/~lianos/contact
>>
>
>

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

	[[alternative HTML version deleted]]

