Intron extraction with Biopython.
Hello,
I would like to extrac intronic sequences from Genbank files.
I need the sequences of the introns in a FASTA format. So far I have a script which extracts the CDS sequences from a Genbank file. I think the complement of the CDS sequences (introns) should be given somehow to complete the task. Could somebody take a look at it?
My script:
from Bio import SeqIO
from Bio import GenBank
for rec in SeqIO.parse("nidulans.gb", "genbank"):
if rec.features:
for feature in rec.features:
if feature.type == "CDS":
print (feature.location)
print (feature.location.extract(rec).seq)
Please help me!
Thank you in advance!
• 153 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Based on your post, I'm not sure you're understanding is 100%.
This isn't what an intron is. Can you clarify what you mean?
The relevant part of a Genbank file is something like this:
The CDS is
(1..43,270..386,440..471,531..648,699..895,958..1407)→ I need the sequences between the CDS: 44...269, 387...439, 472...530, so on..I don't know if this is different in fungi. But the regions between the coding region aren't neccessarly the introns, because the start codon can between somewhere in the first exon or in a later exon, same for the stop codon.
In your genbank file there should be feature for exons, like this:
The region between two exons are introns.
fin swimmer
Yes, but you asked for the "complement" of the CDS sequences. Are you sure that's what you meant to say?