[Bioperl-l] Cloning seqfeatures

David Block dblock@gene.pbi.nrc.ca
Fri, 24 Aug 2001 15:40:58 -0600 (CST)


On Fri, 24 Aug 2001, Chris Mungall wrote:

> I'm in favour of reblessing
> 
That's what I ended up with doing :)

> I'm actually for getting the biology out of the object model as much as
> possible these days; ie everything is a SeqFeature.
>
> But if there are going to be biospecific subclasses I like the idea that
> all the core attributes are in the base class and the different methods
> are just lite wrappers for existing methods; eg $gene->exons() just calls
> grep {$_->type eq 'exon'} $self->sub_Features
>
pretty much, although we didn't want to restrict primary tag, so we
subclassed SeqFeature::Generic into Exon,Promoter,Intron, etc.
 
> a good test of whether this design pattern is working is whether you can
> just switch types by reblessing. i know it's maybe not in keeping with
> java style good software engineering practices but I kind of like it.
> 
Yep, that seems to work.  Everything's a SeqFeature::Generic.

The only thing that would change in switching from an exon to a promoter
would be the is_coding method would return false instead of true.

> On Fri, 24 Aug 2001, David Block wrote:
> 
> > I am having second thoughts after sleeping on my transcript object (ouch,
> > that prickly part hurt!)...
> > 
> > This is the point at which re-blessing looks
> > attractive.
> > 

-- 
David Block
dblock@gene.pbi.nrc.ca
http://bioinfo.pbi.nrc.ca/dblock/wiki
NRC Plant Biotechnology Institute
Saskatoon, SK, Canada