TSSD_ID Chr Start End Count + Strand ID_1 chr21 9417056 9417076 1 - ID_2 chr21 9417667 9417687 1 - ID_3 chr21 9512082 9512102 2 - ID_3 chr21 9512082 9512102 2 - ID_5 chr21 9535321 9535341 1 - ID_6 chr21 9540527 9540547 1 - ID_7 chr21 9544899 9544919 1 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_8 chr21 9564970 9564990 48 - ID_56 chr21 9575389 9575409 1 - ID_57 chr21 9652071 9652091 1 - ID_58 chr21 9671166 9671186 3 - ID_58 chr21 9671166 9671186 3 - ID_58 chr21 9671166 9671186 3 - ID_61 chr21 9700592 9700612 1 - ID_62 chr21 9704082 9704102 1 - ID_63 chr21 9705333 9705353 1 -
if you look at the first column the ID number is jumping from 2 to 5 and from 8 to 52 as you see it adds the counting the column 5 to the ID ! but I dont want it to do that ! I want to add +1 to ID number when the entries in column three (start column) for example 1st entry - 2nd entry > 2 and add +1 to column5 when 1st entry - 2nd entry < 2 (in column 3 (start) ) I mean for entry and the next entry and give me unique output instead of printing for many times like :
TSSD_ID Chr Start End Count + Strand ID_1 chr21 9417056 9417076 1 - ID_2 chr21 9417667 9417687 1 - ID_3 chr21 9512081 9512102 1 - ID_3 chr21 9512082 9512102 3 - ID_3 chr21 9512083 9512104 1 - ID_3 chr21 9512085 9512120 1 - ID_5 chr21 9535321 9535341 1 - ID_6 chr21 9540527 9540547 1 - ID_7 chr21 9544899 9544919 1 - ID_8 chr21 9564970 9564990 1 - ID_8 chr21 9564975 9564993 2 - ID_9 chr21 9564970 9564990 8 - ID_10 chr21 9564970 9564990 4 - ID_11 chr21 9564970 9564990 7 -
as you see in ID_3 in one line count is 3 which I means at that position there are three identical clusters again in ID_3 there are some with counting 1 which are in that area and covered in 2bp but are not same like this :
|=====| |=====| there are identical in ID_3 and count as 3 |=====| |=====| |=====| and these two are again in ID_3 but there are not Identical so they have different counting as each of them count as one! and when |=====| |=====| they do not have 2bp overlap the ID will change to ID_4 as you see in ID_3 all of them had 2bp overlapped

In reply to Re^2: Help the counting! by g-alone
in thread Help the counting! by g-alone

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.