So, I wrote the following program that does exactly that:
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
sequences = []
handle = open('sampledata.fasta', 'r')
for record in SeqIO.parse(handle, 'fasta'):
sequence = ''
for nt in record.seq:
sequence += nt
sequences.append(sequence)
handle.close()
long_seq = sequences[0]
introns = sequences[1:]
for i in range(len(introns)):
long_seq = long_seq.replace(introns[i], '')
long_seq = Seq(long_seq)
print(long_seq.translate(to_stop=True))
No comments:
Post a Comment