Entering edit mode
7.4 years ago
a.rex
▴
350
I have the following befile:
name start end id length
scaffold1 1 160 NB501801:1:HN3WLBGXY:4:11601:9830:10032 159
scaffold1 1 164 NB501801:1:HN3WLBGXY:3:13412:18598:13811 163
scaffold1 1 167 NB501801:1:HN3WLBGXY:3:22404:14294:20264 166
scaffold1 15 189 NB501801:1:HN3WLBGXY:2:23204:7996:11409 174
scaffold1 1 201 NB501801:1:HN3WLBGXY:3:21609:2881:5564 200
scaffold1 46 230 NB501801:1:HN3WLBGXY:4:23510:23247:4818 184
I want to generate an extra column in this file with the midpoint. Is there a quick method for doing this using bedtools? How can I do this with python?
Thanks for your help. However, when I run this code an error appears. It seems that there is a concatenation of string and integer in the last line. I can't seem to rectify this. Sorry - any further help would be appreciated.
Wow, had some ridiculous blunders in my code. Can you check again?
Works perfectly now! Thank you.