Created
January 26, 2009 14:06
-
-
Save zvoase/52824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput | |
import sys | |
from Bio.ExPASy import get_sprot_raw | |
from Bio.SeqIO import parse | |
from Bio.SeqIO.FastaIO import FastaWriter | |
fasta_out = FastaWriter(sys.stdout, | |
record2title=lambda record: record.id) | |
for accession_id in fileinput.input(): | |
sprot_file = get_sprot_raw(accession_id) | |
sprot_records = parse(sprot_file, 'swiss') | |
for record in sprot_records: | |
fasta_out.write_record(record) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment