convert GenBank formatted sequence file to FASTA format
1
0
Entering edit mode
7 weeks ago
lauren • 0

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.

fasta python genback • 194 views
ADD COMMENT
0
Entering edit mode

sounds like a homework. What did you write so far ?

ADD REPLY
0
Entering edit mode
7 weeks ago
cfos4698 ▴ 270

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

ADD COMMENT

Login before adding your answer.

Traffic: 2272 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6