Hi, Here is the explanation of task I want to perform. 1. match the value of column 2 of file 1 with the value of column 1 of file 2 (i.e. chr11). and then fetch all lines of file2 which have chr11 value.

2. make the varables -500 and +500 of value 4 of file 1 (i.e. 650). From 150 to 1150 select a sliding window of 50 with window size 100. i.e. 150-250, 200-300, 250-350, 300-400....1050-1150.

3. Count the lines of file2, on the basis of value in the second column of file2, which lies in these windows....

4. For this examples... The answer should be

150 250 0

250 350 0

350 450 0

450 550 0

550 650 5

650 750 1

750 850 0

850 950 0

950 1050 0

1050 1150 0

1150 1250 0


In reply to Re^4: Sliding window perl program by genome
in thread Sliding window perl program by genome

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.