[BioPython] where is SeqIO.parse()?
Frederico Arnoldi
fredgca at hotmail.com
Mon Oct 15 13:02:27 UTC 2007
Dear Kiradi,
Concerning your subject question: where is SeqIO.parse()?
>>> from Bio import SeqIO
>>> SeqIO
So, in my system, it is at /usr/lib/python2.4/site-packages/Bio/SeqIO/__init__.py. Try the same command in your python console and see where it is in yours.
Concerning your problem:
Try
>>> from Bio import SeqIO
>>> dir()
['SeqIO', '__builtins__', '__doc__', '__name__']
>>> dir(SeqIO)
['Alignment', 'ClustalIO', 'FastaIO', 'InsdcIO', 'Interfaces', 'NexusIO', 'PhylipIO', 'Seq', 'SeqRecord', 'StockholmIO', 'StringIO', 'SwissIO', '_FormatToIterator', '_FormatToWriter', '__builtins__', '__doc__', '__file__', '__name__', '__path__', 'generic_alphabet', 'generic_protein', 'os', 'parse', 'to_alignment', 'to_dict', 'write']
Do you get the same result? See that "parse" is in my SeqIO. Is it in yours?
I noted that installing biopython via apt in Ubunutu, the __init__.py in Bio/SeqIO was empty. Maybe it is the source of your problem. But if I am right, when you type, in your system, dir(SeqIO), you get ['__builtins__', '__doc__', '__file__', '__name__', '__path__'], confirming your __init__.py is empty. Check it.
If this is your problem, try installing biopyton by the tar.gz file available in Biopython home page.
Good luck,
Fred
---------------------------------------------------------------------->> Message: 1> Date: Wed, 10 Oct 2007 17:47:26 +0530> From: Prashantha Hebbar Kiradi > Subject: [BioPython] where is SeqIO.parse()?> To: biopython at biopython.org> Message-ID: > Content-Type: text/plain; charset=ISO-8859-1; format=flowed>> Hi everybody,>> While trying the example of 'Parsing sequence file formats' from section> 2.4 of Biopython tutorial:> -------------------------------------------------> from Bio import SeqIO> handle = open("ls_orchid.fasta")> for seq_record in SeqIO.parse(handle, "fasta") :> print seq_record.id> print seq_record.seq> print len(seq_record.seq)> handle.close()> ------------------------------------------------->>> I get this error:> -------------------------------------------------> Traceback (most recent call last):> File "fastEx.py", line 5, in > for seq_record in SeqIO.parse(handle, "fasta") :> AttributeError: 'module' object has no attribute 'parse'> ------------------------------------------------->> Importing SeqIO doesn't raise any error and the ls_orchid.fasta file I'm> using is opening correctly.>> API documentation reports that the 'parse' function is there. What am I> doing wrong?>> I'm using biopython 1.42 installed from Ubuntu repository and python 2.5.1.>> Thanks in advance,>> Prashantha Hebbar> Institute of Bioinformatics> ITPL,
_________________________________________________________________
Receba as últimas notícias do Brasil e do mundo direto no seu Messenger com Alertas MSN! É GRÁTIS!
http://alertas.br.msn.com/
More information about the Biopython
mailing list