[Bioperl-guts-l] [Bug 2673] original fields not inherited by seq objects in alignment slices

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Nov 21 16:59:41 EST 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2673





------- Comment #6 from maj at fortinbras.us  2008-11-21 16:59 EST -------
Bumped into you, Chris--
Here's a brief summary of the uploaded, which you already grokked. Might be
quite valuable across the board as you say-
MAJ
****
Here's a solution that may work for the general problem. The subs bequeath()
and bequest() are set up as members of the base class. bequeath() sets a list
of fields names that the user desires to pass on to derived instances.
$self->bequest($referent) sets the fields of $self that are bequeathed by
$referent to $referent's values of those fields, unless the fields are already
set in $self. $self->isa(ref($referent)) must apply, and this is checked. The
.t attachment has a concrete example, but in particular the following works:

$seq = new PrimarySeq(-seq=>'atgc', -primary_id=>'THX1138', -id=>"OrigSeq",
-bequeath=>['primary_id']);
$lseq = new LocatableSeq(-seq=>tg', -id=>"DerivedSeq", -based_on=>$seq);

gives 

$lseq->primary_id  #returns 'THX1138'
$lseq->id          #returns 'DerivedSeq'


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Bioperl-guts-l mailing list