On Tue, Sep 16, 2008 at 05:25:40PM -0700, Rob Kirkpatrick wrote:
-> This script is basically a pared-down version of the doctests in the
-> ExonAdaptor class of adaptor.py.

Hey Rob,

thanks for the script.  I could duplicate the problem with your script,
and it seems like a bug in pygr; the following patch to seqdb fixes it
for me:

index 6c27b81..c047a49 100644
--- a/pygr/seqdb.py
+++ b/pygr/seqdb.py
@@ -7,11 +7,13 @@ import classutil
 import UserDict
 import weakref

+def sql_sequence_init_subclass(cls, db, **kwargs):
+    db.seqInfoDict = db # db will act as its own seqInfoDict
+    SQLRow._init_subclass(db=db, **kwargs)
+
 class SQLSequence(SQLRow,SequenceBase):
     "Transparent access to a DB row representing a sequence; no caching."
-    def _init_subclass(cls, db, **kwargs):
-        db.seqInfoDict = db # db will act as its own seqInfoDict
-        SQLRow._init_subclass(db=db, **kwargs)
+    _init_subclass = classmethod(sql_sequence_init_subclass)
     def __init__(self, id):
         SQLRow.__init__(self, id)
         SequenceBase.__init__(self)

--

Basically _init_subclass *has* to be a classmethod; it is in SQLRow, but
it's not defined as such on SQLSequence.  This patch fixes that.

Rob, could you verify this fix?  Once you do, I'll post it to the
tracker.  Hmm, it'd be nice to get a simple test of this, by which I
mean one that doesn't require pyensembl... blech.  The code is pretty
complicated on a first glance :)

--titus
-- 
C. Titus Brown, [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to