FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

Re: [Seqan-dev] Merging/Melting a bunch of intervals

<-- thread -->
<-- date -->
  • From: Knut Reinert <knut.reinert@fu-berlin.de>
  • To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Date: Thu, 16 Sep 2010 10:56:27 +0200
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] Merging/Melting a bunch of intervals

Ah sorry I meant [1,10] as the first solution.


But then the following algorithm should solve the problem.

1) insert all intervals in an interval tree
2) construct a graph G with nodes for the intervals and edges between nodes if the intervals intersect (edge computation is done using the interval tree)
3) compute the connected components.
4) on each connected component construct the interval as the minimum and maximum coordinates of the corresponding intervals

That can all be done in SeqAn.

my first example you would get a graph G=({1,2,3},{(1,2),(2,3)} and hence get the desired one component

in  your example  you would get two components.

Knut


On Sep 16, 2010, at 10:41 AM, Fabian Buske wrote:

> Hi Knut,
> 
>> Assume { [4,8], [1,5], [6,10]}
>> 
>> the second and third do not overlap. What should be the result?
>> 
>> [4,10]  ?
>> 
>> 
>> or 
>> 
>> [1,8] and [6,10]
>> 
>> 
> Neither of them.
> 
> The outcome should be the same whatever the order of the original intervals.
> 
> Since all of them are overlapping in some direct or indirect way the 
> final result should be [1-10]
> 
> 1-2-3-4-5
>      4-5-6-7-8
>          6-7-8-9-10
> ____________________
> 1-2-3-4-5-6-7-8-9-10
> 
> if there is another set that is completely separated, e.g. 
> {[12,15],[13-17]}, the result should be
> [1-10], [12-17]
> 
> Best,
> Fabian
> 
>>> I start of with a set of intervals. That is a set of pairs of integers 
>>> defining the interval start and end point. This two integers do not 
>>> necessarily span the same range in all the intervals in the set.
>>> 
>>> I then like to merge all overlapping/intersecting intervals. This may be 
>>> done on the fly while constructing a new data structure.
>>> 
>> 
>> 
> 
> 
> -- 
> Fabian Buske
> Institute for Molecular Bioscience
> The University of Queensland 
> Brisbane, Qld. 4072 Australia
> Phone: (61)-(7)-334-62608
> 
> 
> _______________________________________________
> seqan-dev mailing list
> seqan-dev@lists.fu-berlin.de
> https://lists.fu-berlin.de/listinfo/seqan-dev

Attachment: smime.p7s
Description: S/MIME cryptographic signature

<-- thread -->
<-- date -->
  • Follow-Ups:
    • Re: [Seqan-dev] Merging/Melting a bunch of intervals
      • From: Fabian Buske <f.buske@uq.edu.au>
  • References:
    • [Seqan-dev] Merging/Melting a bunch of intervals
      • From: Fabian Buske <f.buske@uq.edu.au>
    • Re: [Seqan-dev] Merging/Melting a bunch of intervals
      • From: Knut Reinert <knut.reinert@fu-berlin.de>
    • Re: [Seqan-dev] Merging/Melting a bunch of intervals
      • From: Fabian Buske <f.buske@uq.edu.au>
    • Re: [Seqan-dev] Merging/Melting a bunch of intervals
      • From: Knut Reinert <knut.reinert@fu-berlin.de>
    • Re: [Seqan-dev] Merging/Melting a bunch of intervals
      • From: Fabian Buske <f.buske@uq.edu.au>
  • seqan-dev - September 2010 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the seqan-dev mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal