Question: Trimming local GB file with Biopython
0
gravatar for 13dsc
18 months ago by
13dsc0
13dsc0 wrote:

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.

ADD COMMENTlink modified 18 months ago by jrj.healey11k • written 18 months ago by 13dsc0
1

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

ADD REPLYlink written 18 months ago by st.ph.n2.4k

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

ADD REPLYlink written 18 months ago by 13dsc0

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

ADD REPLYlink written 18 months ago by st.ph.n2.4k
1
gravatar for jrj.healey
18 months ago by
jrj.healey11k
United Kingdom
jrj.healey11k wrote:

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

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

ADD COMMENTlink modified 18 months ago • written 18 months ago by jrj.healey11k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1368 users visited in the last hour