This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fasta Module In Biopython-Python, Again

Hello, I have a similar question regarding Fasta module in Biopython. I am using disembl predictor Disembl.py) for protein disorder and I have a mistake ImportError: cannot import name Fasta. I read an answer in "Fasta module in Python/Biopython" record - to change Fasta with SeqIO but since I don't know Python, I didn't succeed to change the script. The problem is in the following two lines:

parser = Fasta.RecordParser()
iterator = Fasta.Iterator(db,parser)

which functions should I use instead?

and later, in line:

cur_record = iterator.next()

what to use instead of this? I tried to do the same as in suggested in "Fasta module in Python/Biopython" () but it works only once..

biopython fasta

1 answer

Here is an updated version of DisEMBL.py using SeqIO:

https://gist.github.com/1675927

The original version is available from:

http://dis.embl.de/

Nice, just what I was looking for, thanks and +1. Thought I'd point out a typo in the gist I just downloaded, line 152 sys.stdout.write('> '+cur_record.id'_COILS ') should be sys.stdout.write('> '+cur_record.id+'_COILS ') (notice the + before '_COILS), otherwise you get a SyntaxError: invalid syntax error..

Log in to answer this question.