[Bioperl-l]more inheritance

Richard Adams Richard.Adams at ed.ac.uk
Fri Aug 1 07:04:27 EDT 2003


Just while people are talking about inheritance:
    I'm writing some Bio::Tools:Analysis modules (they're in the CVS)
which run remote sequence analyses, and parse the results
into a variety of formats, including  Bio::Seq::Meta::Array objects
(which hold residue specific data)and Bio::SeqFeature objects (which
usually just hold significant results).

            e.g., my $tool =
Bio::Tools::Analysis::Protein::Domcut->new(-seq =>$seq);#predicts domain
boundaries in proteins
                    $tool->run; #submits query and retrieves result
                    my $meta = $tool->result('all');
                    my @fts = $tool->result(Bio::SeqFeatureI');

    The problem iswhether $seq  needs to be a PrimarySeq object (needed
for Bio::Seq::Meta::Array methods to work as it extends from
Bio::LocatableSeq, which ISA PrimarySeq ) or a Seq object (needed as
input if you want to  hangs SeqFeatures onto it), but what if you want
both?.

My  work around (implementing a suggestion by Heikki) at the moment is
to have Bio::Seq::Meta::Array inheriting from Bio::LocatableSeq by
default, but if the constructor
receives a -baseclass = Bio::Seq entry in its argument list it alters
@ISA to  inherit from Bio::Seq. This works (i.e., you can get meta
sequence methodsAND SeqFeature methods  now after a submitting a
Bio::Seq object to the analysis), but I'm not sure that dynamically
altering inheritance is  a good idea.

    So in this case might it be better for LocatableSeq or Seq objects
to <have> meta sequence methods by aggregation,
rather than <become> meta sequences?
Or alternatively just make the problem clear in the documentation aand
let the user deal with it?
Would be grateful for any suggestions - I have several of Analysis
modules to submit but would like to get this sorted out before
committing them.

Cheers

Richard






--
Dr Richard Adams
Bioinformatician,
Psychiatric Genetics Group,
Medical Genetics,
Molecular Medicine Centre,
Western General Hospital,
Crewe Rd West,
Edinburgh UK
EH4 2XU

Tel: 44 131 651 1084
richard.adams at ed.ac.uk




More information about the Bioperl-l mailing list