Entering edit mode
6.6 years ago
dzisis1986
▴
70
Hello i have a bed file like this
1 3004104 3004110
1 3005819 3005825
1 3008315 3008321
1 3008893 3008899
1 3009812 3009818
1 3012422 3012428
1 3015794 3015800
1 3016183 3016189
1 3024019 3024025
1 3025279 3025285
and i would like to create another one out of this to in this format :
1 1 3004110
1 3004104 3005825
1 3005819 3008321
1 3008315 3008899
1 3008893 3009818
1 3009812 3012428
1 3012422 3015800
1 3015794 3016189
1 3016183 3024025
1 3024019 3025285
Do you know an easy way to do it in R or in Python ?
Thank you in advance
what have you tried ?
I tried R i can read each column but i can't create a for loop as i want in order to select each time the 2nd column as start and the next row 3rd column as end position
Is bed file per chromosome?
Yes it is a bed file with chr-start-end
What happened to the last row?
1 3025279 3025285
i was thinking about the same but the last row stays like that .. 1 3024019 3025285 The 3025279 postion is into the rage above so no more line needed