Trying to read a file that contains a genome sequence using Seq and SeqIO objects in BioPython. Cannot use the open command. The program should accept a command-line argument containing the name of FASTA file containing the input genome.
It made the file, but there is nothing in the file. Not sure what I am missing?
This is what I have:
from Bio.Seq import Seq
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
recordlist = []
for SeqRecord in SeqIO.parse('bacterium_genome.fna', 'fasta'):
myseq = SeqRecord.seq
myseq.alphabet = IUPAC.unambiguous_dna
recordlist.append(SeqRecord)
SeqIO.write(recordlist, 'bacterium_genome.gb', 'gb')