[Bioperl-l] First commit of Bio::Structure objects
Kris Boulez
Kris.Boulez@algonomics.com
Tue, 20 Nov 2001 12:06:17 +0100
Quoting Ewan Birney (birney@ebi.ac.uk):
> On Tue, 20 Nov 2001, Kris Boulez wrote:
>
> >
> > The graph object you describe, is this available somewhere ? I looked at
> > http://www.informatics.jax.org/go/ (which I think is the GO browser you
> > are referrig to), but could find no link to source code.
> >
> > On CPAN I found a Graph package (Graph-0.201), which seems pretty
> > complete at first sight. It does require an other external package
> > (Heap). Thus adding two more external packages one needs to install to
> > get BioPerl running.
> >
> > Another option might be to do something pretty basic ourselves. Storing the
> > child-parent relations in a hash ( $c_p{$child} = $parent ) and the
> > parent-child relations in a hash to array refs
> > ( $p_c{$parent} = \@children ). It looks basic, but workable to me.
> >
> >
> > We (my collegues and I) still think that having methods like
> >
> > $atom->residue
> > $residue->chain
> > $chain->residue
> >
> > would make working with the objects more natural. To accomplish this we
> > only need a reference from every child object (at whatever layer) to the
> > grand parent ('holder object' in Ewan speak). Thus allowing the residue
> > method in Atom (first example) to translate the call to
> >
> > $self->_grand_parent->get_residue($atom)
> >
> > The only thing that is needed is a DESTROY method on the grand parent
> > which deletes the graph(s), thus breaking all circular refs.
>
> This still doesn't work - if the children hold onto the grandparents then
> it wont release.
>
Some more thinking on this side of the keyboard, showed where my
thinking was going wrong.
I still very much like the idea of having a small object (ProteinStructure)
on top of Entry which would just delegate calls to Entry and circumvent
all this trouble.
> you need to have weak references here for the $self->_grand_parent
>
Are 'weak references' and 'symbolic references' (as described in Damian
Conway's book) the same thing ?
>
>
> I still think you should go with Chris' proposal. Having a slightly more
> clumsy interface to work around Perl's garbage colleciton problems is
> better than leaking memory.
That I agree with completely, I'm just trying to get the best of both
worlds
Kris,
--
Kris Boulez Tel: +32-9-241.11.00
AlgoNomics NV Fax: +32-9-241.11.02
Technologiepark 4 email: kris.boulez@algonomics.com
B 9052 Zwijnaarde http://www.algonomics.com/