Re: biopython

2010-06-14 Thread Thomas Jollans
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 :)
 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2010-06-14 Thread Mark Lawrence

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, inmodule
 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


Re: biopython

2010-06-14 Thread Benjamin Kaplan
On Mon, Jun 14, 2010 at 8:45 AM, madhuri vio madhuri@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?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2010-06-14 Thread Thomas Jollans
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?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2010-06-14 Thread Mark Lawrence

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



--
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2010-06-14 Thread Ajit Kumar
On Mon, Jun 14, 2010 at 9:38 AM, Thomas Jollans tho...@jollans.com wrote:
 On 06/14/2010 05:45 PM, madhuri vio wrote:

 i am still waiting for some help.

 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 the incessant posts and lack of mention of the previous helps she
has received, it seems that the OP isn't even subscribed to this list!

A reply by Mark points the exact solution:
http://www.biopython.org/wiki/SeqIO#Sequence_Input
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2010-06-14 Thread geremy condra
On Mon, Jun 14, 2010 at 9:38 AM, Thomas Jollans tho...@jollans.com wrote:
 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?

That was beautiful. I think I've got something in my eye.

Geremy Condra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2010-06-14 Thread Sebastian Bassi
On Mon, Jun 14, 2010 at 11:02 AM, madhuri vio madhuri@gmail.com wrote:
 TypeError: Need a file handle, not a string (i.e. not a filename)

This says that the error is that you are using a filename where you
should be using a filehandle.
So this line:

for seq_record in SeqIO.read(ls_MTbH37Rv.fasta, fasta):

Should be changed to:

fh = open(ls_MTbH37Rv.fasta)
for seq_record in SeqIO.read(fh, fasta):

I think that in some version of Biopython you would be able to use
just the name.

Best,
SB.
Python for Bioinformatics book: http://www.tinyurl.com/biopython
Python for Bioinformatics blog: http://www.py4bio.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2008-09-09 Thread skip

 from Bio import Entrez
Traceback (most recent call last):
  File stdin, line 1, in ?
ImportError: cannot import name Entrez

Can you import Bio, e.g.:

import Bio

?  If not, check to see where it's installed and make sure the directory
containing Bio (or Bio.py) is in sys.path, either by setting the PYTHONPATH
environment variable before running Python or adding a Bio.pth file to a
directory which is in sys.path so it can be found.

http://docs.python.org/lib/module-site.html
http://docs.python.org/tut/node8.html

Skip
--
http://mail.python.org/mailman/listinfo/python-list


Re: biopython

2008-09-09 Thread Gabriel Genellina
En Tue, 09 Sep 2008 05:53:19 -0300, Beema Shafreen  
[EMAIL PROTECTED] escribió:



Hi all,
I am using Biopython to fetch pumed Id's ,The module i use is (from Bio
import Entrez)

But i am getting this error


from Bio import Entrez

Traceback (most recent call last):
  File stdin, line 1, in ?
ImportError: cannot import name Entrez


what should i do know can anybody suggest me an alternative for this


Ensure that you don't have *another* Bio module that is being imported  
instead of the true one.


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list