Hi
I need a small help with a script. i have a file in the given format it is tab-seperated file

id orient co-ordinates

Contig0 + 109027 162520 184045 324019 375437
Contig0 - 165846 193861 243737 243740 243741 395893
Contig1 + 126334 145895 150562
Contig1 - 126804 152668 152671 152672 152673
Contig10 + 1069 126046 126047 126048
Contig10 - 281973 83318 83395
Contig100 + 249511 249557 51059
Contig100 - 161016 161020 245920
Contig10003 + 17593 17594
Contig1001 + 15558 15559 55338 55345 92236

So i need to compare the co-ordinates for a particular id on particular orientation and filter out co-ordiantes which are within 50 bases and keep the smallest co-ordiante amongst them. Basically comparison linewise

eg:
Contig10 + 1069 126046 126047 126048
Contig1001 + 15558 15559 55338 55345 92236

output :
Contig10 + 1069 126046
Contig1001 + 15558 55338 92236

I hope I explained it properly.
Can you please help me with this problem.
Thank you in advance

Best
Deepak


In reply to Compare elements of a line in a file 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.