Trimming local GB file with Biopython
1
0
Entering edit mode
6.6 years ago
13dsc • 0

I was wondering if I could use Biopython in order to trim a local gb file.

Ex. I have a 100kb gb file but I am interested in a continuous 25kb portion. I know the location of the start and stop of the 25kb region. How do I create a gb file which contains only that 25kb portion from the larger file.

python biopython genbank parsing • 1.9k views
ADD COMMENT
1
Entering edit mode

You can. Look into into SeqIO, and string slicing.

ADD REPLY
0
Entering edit mode

will that keep the gene annotations associated with the gb file for that slice?

ADD REPLY
0
Entering edit mode

Yes, just edit the seq record, and output the Seq object to a new file.

ADD REPLY
2
Entering edit mode
6.6 years ago
Joe 21k

I wrote a script that does exactly this a while back.

https://github.com/jrjhealey/bioinfo-tools/blob/master/Genbank_slicer.py

ADD COMMENT

Login before adding your answer.

Traffic: 2637 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6