On Thu, Sep 11, 2008 at 08:19:15PM +0900, Namshin Kim wrote:
-> Hi Chris,
->
-> I tried to make annotation database, but I am getting strange errors. I am
-> using same scripts, thus there should be some changed during last update.
->
-> First thing is maxlen and maxint is not working in cnestedlist.NLMSA. I
-> calculated and set the max idb size to be 1GB, but it grows upto 4GB and
-> stopped due to a memory error. Memory error is caused by excessive memory
-> usage in Collection. seqdb.AnnotationDB.clear() function does not exist any
-> more. I reported this excessive memory usage in shelve and AFAIK
-> writeback=False option would prevent excessive memory usage. Please let me
-> know if I made a mistake.
Hi, Namshin,
Chris checked in a few patches of mine last night, and several of them
had to do with caching. One that almost certainly is affecting you is
my removal of 'clear' from AnnotationDB -- it now returns an error, as
it should, because AnnotationDB is a read-only database! I think we
should add a new function, 'clear_cache', which does what 'clear' used
to do: remove the cached AnnotationDB objects. How does that sound?
There is, in general, a confusion in the pygr code caused by inheriting
from 'dict'. In several places, as in AnnotationDB, the built-in 'dict'
functions that *aren't* overridden deal with the internal 'dict' data
structures, while the ones that *are* overridden do other things. It
can be hard to tell what any particular function is supposed to be
doing, frankly. I've been working on regularizing the dict interfaces,
hence the removal of 'clear' on AnnotationDB.
I am beginning to think the best way forward would be to go in and
remove 'dict' from the superclasses of any of the pygr classes; for
example AnnotationDB would change from this:
class AnnotationDB(UserDict.DictMixin, dict):
def __init__(self, ...):
dict.__init__(self)
to
class AnnotationDB(UserDict.DictMixin):
def __init__(self, ...):
self.cache = {}
That is, rather than using the internal dict data structures as a cache,
the cache would be explicitly declared and managed.
Any thoughts?
cheers,
--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
-~----------~----~----~----~------~----~------~--~---