On 14/06/2010 15:02, madhuri vio wrote:
i have tried this still unable to get an output
from Bio import Seq
from Bio import SeqIO
from Bio import SeqRecord
for seq_record in SeqIO.read("ls_MTbH37Rv.fasta", "fasta"):
print seq_record.id
print repr(seq_record.seq)
print len(seq_record)
python bio.py
Traceback (most recent call last):
File "bio.py", line 10, in<module>
for seq_record in SeqIO.read("ls_MTbH37Rv.fasta", "fasta"):
File "/var/lib/python-support/python2.6/Bio/SeqIO/__init__.py", line 433,
in read
iterator = parse(handle, format, alphabet)
File "/var/lib/python-support/python2.6/Bio/SeqIO/__init__.py", line 342,
in parse
raise TypeError("Need a file handle, not a string (i.e. not a
filename)")
TypeError: Need a file handle, not a string (i.e. not a filename)
Please read this, it'll show you your mistake.
http://www.biopython.org/wiki/SeqIO#Sequence_Input
Regards.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list