[BioPython] FW: Re : from Bio import db

Michiel De Hoon mdehoon at c2b2.columbia.edu
Wed Nov 7 22:44:14 EST 2007


Eric answer pasted below...

-----Original Message-----
From: Eric Gibert [mailto:ericgibert at yahoo.fr]
Sent: Wed 11/7/2007 10:09 PM
To: Michiel De Hoon
Subject: Re : [BioPython] from Bio import db
 
Dear Michiel,

Here is the code. Sorry for the trouble. BTW, your guess it correct:
NCBIDictionary... 
Here is my "debugging" script:
--------------------------------------------------------------
import Bio
from Bio import GenBank
from BioSQL import BioSeqDatabase
import BioSQL.BioSeq

list_to_load = []
def iterSeq():
    for s in list_to_load:
        yield s

if __name__ == '__main__':
    

    gi_list = GenBank.search_for("Archineura")
        
    record_parser = GenBank.FeatureParser()
    ncbi_dict = GenBank.NCBIDictionary("nucleotide", "genbank",
                                           parser = record_parser)  # <---
this is the line 18 causing the error
    
    biodb = BioSeqDatabase.open_database(driver = "MySQLdb", user = "yyyyy",
passwd = "xxxxx", host = "localhost", db = "BioSQL")
    selectedDb = biodb["allOdonata"]
    
#    gi_list.append('57282195')
#    gi_list.append('AJ459224')
    
        
    for seq in gi_list:
        gb_record = ncbi_dict[seq]
        print gb_record.id, 
        
        try:  
            db_record = selectedDb.lookup(version = gb_record.id) 
            print "already present"
        except IndexError:
            print "absent", seq
            list_to_load.append(gb_record)
            
    #print list_to_load
    itS = iterSeq()
    selectedDb.load(itS)  
----------------------------------------------------------------
Looking in the previous script version did not help me: the "import" is not
in the def but in the script header, except that, no difference in the 3
statements of the NCBIDictionary class. I hope you will find a solution.

Thank you,

Eric

----- Message d'origine ----
De : Michiel De Hoon <mdehoon at c2b2.columbia.edu>
À : Eric Gibert <ericgibert at yahoo.fr>; biopython at lists.open-bio.org
Envoyé le : Jeudi, 8 Novembre 2007, 10h19mn 30s
Objet : RE: [BioPython] from Bio import db

Dear Eric,

Some significant changes were needed in Biopython release 1.44 for
 reasons of
compatibility with the new version of mxTextTools. Unfortunately, as
 you
found, some code may break as a result.

In your code:
>   File "/home/eric/workspace/PySeq/src/GenbankSearch.py", line 18, in
<module>
>    parser = record_parser)
>   File "/usr/lib64/python2.5/site-packages/Bio/GenBank/__init__.py",
>   line 1283, in __init__
>     from Bio import db
> ImportError: cannot import name db

It looks like we missed an "import db" statement in
 Bio/GenBank/__init__.py.
Can you show us the code leading up to this point? I'm guessing that
 you are
trying to use NCBIDictionary, but it would be helpful to see how
 exactly you
are trying to use it, so that we can come up with a solution.

Sorry for the trouble.

--Michiel.




Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1150 St Nicholas Avenue
New York, NY 10032



-----Original Message-----
From: biopython-bounces at lists.open-bio.org on behalf of Eric Gibert
Sent: Wed 11/7/2007 8:50 PM
To: biopython at lists.open-bio.org
Subject: [BioPython] from Bio import db
 
Hello,

I just upgraded to BioPython 1.44 and when I try to run my previous
 script, I
have
 the error:

Traceback (most recent call last):
  File "/home/eric/workspace/PySeq/src/GenbankSearch.py", line 18, in
 <module>
    parser = record_parser)
  File "/usr/lib64/python2.5/site-packages/Bio/GenBank/__init__.py",
 line 1283, in __init__
    from Bio import db
ImportError: cannot import name db


(I am on Fedora 7 64bit)

Any suggestions?

Thank you

Eric



 
_____________________________________________________________________________

Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
 Mail 
_______________________________________________
BioPython mailing list  -  BioPython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython







 
_____________________________________________________________________________

Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 




More information about the BioPython mailing list