[Bioperl-l] Bio::SeqFeature::OntologyTypedI Proposal

Ewan Birney birney at ebi.ac.uk
Wed Aug 10 05:00:29 EDT 2005


Hi guys...


In my spare time (read... train time) I'm back on a little
bit of bioperl. I hope to in the future set up an
Ensembl->Bioperl Bridge (ie, seeing Ensembl objects as
fully compliant bioperl objects) but before I did that
I wanted to do my bit for 1.6


So... following on from Chris' proposal of sorting
out SeqFeature typing, here is my proposal:


Bio::SeqFeature::OntologyTypedI - extends Bio::SeqFeatureI
and has a method $sf->ontology_term() which returns a
Bio::Ontology::TermI compliant object.

ie, the synopsis would look like:


=head1 NAME

Bio::SeqFeature::OntologyTypedI - a strongly typed SeqFeature

=head1 SYNOPSIS


    # get Sequence Features in some manner, eg
    # from a Sequence object

     foreach $sf ( $seq->get_SeqFeatures() ) {
         # all sequence features must have primary_tag() return a string
         $type_as_string = $sf->primary_tag();

         # ontologytyped seqfeatures have an ontology term
         if( $sf->isa("Bio::SeqFeature::OntologyTypedI") ) {
             $ot = $sf->ontology_term();
             print "Ontology identifier:",$ot->identifier()," name:",$ot->name()," Description:",$ot->description(),"\n";
         } else {
             print "Sequence Feature does not have an ontology type - tag is $type_as_string\n";
         }

     }


I would then implement this in

    Bio::SeqFeature::OntologyCompliant

which would inheriet its implementation from Bio::SeqFeature::Generic, but
chain primary_tag to

    $sf->ontology_term()->name();


Having done this I don't know how much "magic" I should put into
SeqIO to automatically promote things into Ontology compliant terms,
or perhaps we should have a converter - which one can register
with a SeqIO EMBL or GenBank stream being something like

     $new_sf = $converter->convert($old_sf,$seq);



This might conflict with an unflattener or something.



What do people think about this proposal? What else do I need
to do to tidy this up?












More information about the Bioperl-l mailing list