This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Genbank to bed conversion for bedtools analysis

Hi,

I need to use bedtools to obtain the coverage across two bam files for comparison. However, to do this, I need a .bed file of the genome features (of the reference genome used to generate the bams). However, I only have genbank format, and whatever else I can get from NCBI etc. (not .bed). Is there a tool / script to convert the annotation in genbank to .bed? Don't want ot have to start writing a script when it must have been done already.

Thanks,
Theo

bedtools coverage conversion genbank

2 answers

First result of a google search, a python script to do just this: (biopython dependency)

https://gist.github.com/brantfaircloth/893580

Hi, yes I tried that one and it is set up for a particular genome, so couldn't get it to work. But found another now, genbank.py (sorry, don't have link atm) that does work. Thanks.

I was trying to use this script: genbank.py

http://code.ohloh.net/file?fid=vNbzWnp6snEEfndwCm_GanCWcMg&cid={cid!?html}&dl

but it does not use the gene tags, just a set prefix - which is not much use. I started trying to edit the code, but instead of wasting time (though I may need to come back to it for large batches of files) I am now using Geneous import / export to do it.

Seems very strange to me this isn't needed more often!

Thanks anyway.

Log in to answer this question.