Hi all,

I have a small problem, I am not able to find a logic to do it.

Question is: I have a file of exons like this where col1 is chromosome name col2 is orientation and rest are start and stop.

Contig0 + 127874 130761
Contig0 + 129936 129984
Contig0 + 130572 133438
Contig0 + 130573 130607
Contig0 + 130630 130761
Contig0 + 130732 130767
Contig0 + 130784 130818
Contig0 + 130832 130866
Contig0 + 130832 130867
Contig0 + 130893 130928
Contig0 + 130970 131004
Contig0 + 130982 131017

As this coordinates have overlapping

Contig0 + 127874 130761
Contig0 + 129936 129984
Contig0 + 130572 133438
Contig0 + 130573 130607
Contig0 + 130630 130761
Contig0 + 130732 130767

It will be

Contig0 + 127874 130767

then

Contig0 + 130784 130818

doesn't have any over lap. Then,

Contig0 + 130832 130866
Contig0 + 130832 130867

will be

Contig0 + 130832 130867

After that no overlap for

Contig0 + 130893 130928

and for

Contig0 + 130970 131004
Contig0 + 130982 131017

it will be

Contig0 + 130970 131017

So at last the result for the example block will be

Contig0 + 127874 130767
Contig0 + 130893 130928
Contig0 + 130970 131017

I hope the question is clear.
Can anyone please help me with this.
Thank you in advance,
Deepak


In reply to Finding Overlapping Regions on Genome by oxydeepu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.