Dear Friends,
I want to bin my txt file into 100bp size based on position(column=2). And condition for bining is , there should be at least three cytosine position (column=7) in each 100 bp bin. Thank you
CcLG01 22 + CHH 0.200 5.00 1 5 0 0 0.036 0.624
CcLG01 23 + CHH 1.000 1.00 1 1 0 0 0.207 1.000
CcLG01 28 + CHH 0.200 5.00 1 5 0 0 0.036 0.624
CcLG01 29 + CHH 1.000 1.00 1 1 0 0 0.207 1.000
CcLG01 30 + CHH 1.000 1.00 1 1 0 0 0.207 1.000
CcLG01 33 + CHH 0.250 4.00 1 4 0 0 0.046 0.699
CcLG01 39 - CHH 0.500 2.00 1 2 2 2 0.095 0.905
CcLG01 42 - CHH 0.000 2.00 0 2 1 1 0.000 0.658
CcLG01 49 + CHH 0.000 1.00 0 1 3 3 0.000 0.793
CcLG01 60 - CHH 0.000 3.00 0 3 1 1 0.000 0.562
CcLG01 61 + CHH 0.000 1.00 0 1 3 3 0.000 0.793
CcLG01 62 + CHH 0.000 1.00 0 1 3 3 0.000 0.793
CcLG01 72 - CHH 0.000 4.00 0 4 1 1 0.000 0.490
CcLG01 75 - CHH 0.000 4.00 0 4 0 0 0.000 0.490
CcLG01 80 - CHH 0.000 4.00 0 4 0 0 0.000 0.490
CcLG01 94 - CHH 0.000 4.00 0 4 0 0 0.000 0.490
CcLG01 97 - CHH 0.000 4.00 0 4 0 0 0.000 0.490
CcLG01 99 - CHH 0.000 4.00 0 4 0 0 0.000 0.490
CcLG01 116 - CHH 0.000 2.00 0 2 0 0 0.000 0.658
CcLG01 126 - CHH 0.000 1.00 0 1 0 0 0.000 0.793
CcLG01 133 - CHH 0.000 1.00 0 1 0 0 0.000 0.793
CcLG01 199 - CHH 0.000 1.00 0 1 0 0 0.000 0.793
Sorry,you description is faint,maybe you can give an example. I think Perl is more suitable for your tesk.
Dear zjhzwang
Please find the attached example.
Fine,I know that,but what output format you want?
i want to add column 7 based on the column 2. But the addition should be based on a another file which have start and end position
like I have a another file2 (position information) in this format chr start end CcLG01 1 45 CcLg 58 135 So based on start and end position given in file 2. column 7 should be added in file1 (mentioned above)