dennogumi/content/post/2007-03-13-a-bed-file-builder.markdown
Luca Beltrame 64b24842b8
All checks were successful
continuous-integration/drone/push Build is passing
Update all posts to not show the header text
2021-01-13 00:05:30 +01:00

1.6 KiB

author categories comments date header slug title omit_header_text disable_share wordpress_id
einar
Linux
Science
true 2007-03-13T20:00:17Z
image_fullwidth
banner_other.jpg
a-bed-file-builder A BED file builder true true 196

As I anticipated, I can finally release this small script. Its purpose is to build BED files out of tab-delimited text files. I made this because I had several files to make and moving columns left and right (not to mention writing a heading line for the Genome Browser) was becoming annoying. Its use is fairly straightforward, as the help itself says:

usage: make_bed_file.py [options] [destination]

options: -h, --help show this help message and exit -i FILE, --input=FILE Use ranges from FILE -n NAME, --name=NAME Use NAME as BED track name -t TYPE, --tracks=TYPE Format other annotation tracks according to TYPE (default: pack) -v TYPE, --visibility=TYPE Set visibility of the BED track to TYPE (default: full) -d DISPLAY, --display=DISPLAY Select specific annotation tracks (comma-delimited list; default: all)

The input file format is rather simple as well:

Chromosome | Identifier | Start Position | End position | Score

The score column is optional. The file must be tab-delimited. If you want to change the format of the file, have a look at the ncbi class inside the source. The result is a BED file with chromosome, position, name and score.

[Get the script]({{ site.url }}/files/make_bed_file.py) and make it executable. If you have any problems, please report.