From: Thomas Jollans on
On 06/14/2010 02:59 PM, madhuri vio wrote:
> i cudnt run this!!!!!!

Take a deep breath, and read the error message. It's very informative,
and tells you exactly what the problem is, and how to fix it, if you'd
just try to understand it.

It would be much appreciated if you had a look at
http://www.catb.org/~esr/faqs/smart-questions.html
specifically the section "Before you ask", ideally the whole article.

>
> and this was the error occured
>
> for seq_record in SeqIO.parse("ls_MTbH37Rv.fasta","fasta"):
> ... print seq_record.id <http://seq_record.id>
> ... print repr(seq_record.seq)
> ... print len(seq_record)
> ...
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> 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)

I think this is a fabulous error message. The programmer of this module
actually anticipated the mistake you were going to make. Good for you.

>
>
> --
> madhuri :)
>
From: Mark Lawrence on
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.

From: Benjamin Kaplan on
On Mon, Jun 14, 2010 at 8:45 AM, madhuri vio <madhuri.vio(a)gmail.com> wrote:
>
> i am still waiting for some help.....
> --
> madhuri :)
>

You already have your help- the traceback tells you everything you
need to know. If you don't understand what the traceback is saying,
come back here and specifically ask about the part you have trouble
with. But we do expect that you will at least attempt to solve this on
your own before coming here.

>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)

Now, what does the traceback say you are doing wrong? What are you
handing the function and what should you be handing the function?
From: Thomas Jollans on
On 06/14/2010 05:45 PM, madhuri vio wrote:
>
> i am still waiting for some help.....

WHAT?! Your behaviour on this list is making me really, really angry. We
are not a tech support company. You are not paying for the privilege of
sending your mail here.
However, Sir, you are acting as if you were entitled to an instantaneous
response to all your silly little problems without even thinking about
the problem yourself!

If you showed us that you're an intelligent human being and that you
think before you post, that you're trying to understand what you're
working on, in short that you're worthy of an answer, I and no doubt
many other knowledgeable folk on this list would be happy to help you
along, but so far you have been but a nuisance, a spammer.

Besides: your original TWO (why two??) posts got a couple of replies.
One annoyed but in principle I think helpful one from myself, and one
rather forthcoming one from Mark Lawrence. Are you even subscribed to
the mailing list, or are you blind posting and hoping for people to CC
you in their replies?

From: Mark Lawrence on
On 14/06/2010 16:45, madhuri vio wrote:
> i am still waiting for some help.....

You cheeky git, this is simply *NOT* cricket! Your 1st post was timed
at 13:59 BST, the response from Thomas Jollans at 14:12. Your 2nd post
was at 15:02 and I replied at 15:12. Now you're back again at 16:45, to
which Thomas and Benjamin Kaplan have already responded.

Here is is the reference that I previously gave you.

http://www.biopython.org/wiki/SeqIO#Sequence_Input

If you don't understand something then please ask, but I suggest you
(re)read this first.

http://www.catb.org/~esr/faqs/smart-questions.html

HTH.

Mark Lawrence