[Bioperl-l] Re: Bio::SeqFeature::OntologyTypedI Proposal
Chris Mungall
cjm at fruitfly.org
Wed Aug 10 17:03:29 EDT 2005
Sounds like the beginnings of a plan! Perhaps we can come up with a
shorter/catchier name but I'm not that bothered.
The plan below will naturally extend to tag_values as well, with
OntologyCompliant delegating the existing methods.
We should also figure out how this ties in with
Bio::SeqFeature::{Gene,Transcript,Exon} etc - if at all. In many ways,
they are different ways of achieving the same thing, namely stronger
typing of features. One scenario is that the class-types
piggyback off of the ontology-typed classes. The other is that they are
completely independent.
Regarding 'magic' in SeqIO - not sure this is required. You can already
plug in your own factories here, we just need to extend this with feature
factories. The default method will continue to produce relatively light
SF::Generics?
On Wed, 10 Aug 2005, Ewan Birney wrote:
>
> 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