I again run into some trobules. I have a file looking like this:
chr1 142936580 142936581 209
chr1 142936581 142936582 208
chr1 142936582 142936583 212
chr1 142936583 142936584 210
chr1 142936588 142936590 215
chr1 142936590 142936591 217
chr1 142936591 142936592 221
chr1 142936592 142936593 220
chr1 145034453 145034454 222
chr1 145034454 145034455 220
chr1 145034455 145034456 218
chr1 145034456 145034457 215
chr1 145034457 145034459 216
chr1 145034459 145034460 212
chr1 161418656 161418657 178
chr1 161418657 161418658 177
chr1 161418658 161418659 179
chr2 90386745 90386747 222
chr2 90386747 90386748 221
chr2 90386748 90386750 220
The problem here is that there are too many entries in my file, and I would like to reduce them to start:end intervals in a following way (at least that's the best I could thought of): Sorting with first column, then using only second column and reducing it. By this I mean, if entry lis in range starting from 142 keep the lowest and highest entry as start,end positions. Then moving to 145* positions and doing the same. So basically creating start,end positions for those sets of entries that are visaually apart from each other. We would end up more or less with:
chr1 142936580 142936592
chr1 145034453 145034459
chr1 161418656 161418658
chr2 90386745 90386748
Thats was my idea how to do this. However I am stuck at the point what code to use. Even suggestions are good Thanks, Irek