Trimming local GB file with Biopython
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.
• 2,743 views
•
link
1 answer
I wrote a script that does exactly this a while back.
https://github.com/jrjhealey/bioinfo-tools/blob/master/Genbank_slicer.py
• 0 views
•
link
Log in to answer this question.
You can. Look into into SeqIO, and string slicing.
will that keep the gene annotations associated with the gb file for that slice?
Yes, just edit the
seqrecord, and output the Seq object to a new file.