convert GenBank formatted sequence file to FASTA format
how to Write a python program that asks the user for a sequence in GenBank format and convert the GenBank formatted sequence into FASTA format then Write the FASTA formatted sequence to a file.
• 2,815 views
•
link
1 answer
Biopython is great for working with sequence data in python. Taken almost verbatim from their documentation (https://biopython.org/wiki/SeqIO):
from Bio import SeqIO
import sys
count = SeqIO.convert(sys.argv[1], "genbank", sys.argv[2], "fasta")
print("Converted %i records" % count)
Save as anything, e.g. script.py, then:
python3 script.py example.gb example.fasta
• 0 views
•
link
Log in to answer this question.
sounds like a homework. What did you write so far ?