[Bioperl-l] Identifiable and Describable

Ewan Birney birney@ebi.ac.uk
Wed, 24 Jul 2002 00:20:48 +0100 (BST)


On Tue, 23 Jul 2002, Hilmar Lapp wrote:

> I've seen lsid_string() there too, which I think shouldn't be there.
> It pertains to a specific implementation of IdentifiableI, namely the
> LSID implementation. Another one might have mobyid_string(), or
> whatever.


I don't consider LSID a specific *implementation* but a specific
*encoding* of the information. 

> 
> This leads to my other suggestion: I'd plead to have Identifiable in
> most if not all cases implemented by composition and not direct
> inheritance. This keeps the implementation flexible and open. With the
> design that Bio::PrimarySeq is-a IdentifiableI you've got to inherit
> from the interface, but internally the methods should all delegate to
> an object that implements IdentifiableI.

I though about this but when I cam to PrimarySeq I only had to modify 2 or
3 methods and to keep backward compatibility this seemed the easiest route
- we can always switch over to delegation if we want to later on - feel
free to code it up ;)

> 
> I.e., you would have
> 
> 	Bio::Identifier::SimpleID is-a IdentifiableI
> 	Bio::Identifier::LSID is-a IdentifiableI
> 	Bio::Identifier::MobyID is-a IdentifiableI
> 	Bio::Identifier::EnsemblID is-a IdentifiableI
> 	# ... and whatever more you wish
> 

I still don't think LSID/MOBY/Ensembl's are different implemetnations -
they use the same slots in semantically identical ways and it is more
encoding things...


> 	Bio::PrimarySeqI is-a IdentifiableI
> 
> 	Bio::PrimarySeq
> 
> 		sub identifier { ... } # get/set IdentifiableI impl.
> 
> 		sub object_id {
> 			my ($self, @args) = @_;
> 			return $self->identifiable()->object_id(@args);
> 		}
> 
> 		...
> 
> Those who want an LSID implementation can have it. Those who want another can have it too.
> 
> A somewhat unrelated question is how authority and namespace map to
> biosql. There is only biodatabase now with a name field ... Do we
> simply add an authority attribute? (i.e. one combination of
> authority/namespace makes one biodatabase entry?)


Maybe we should add an authority attribute. I think authority is a good
idea.



> 
> 	-hilmar
> 
> 
> > -----Original Message-----
> > From: Ewan Birney [mailto:birney@ebi.ac.uk]
> > Sent: Monday, July 22, 2002 4:12 PM
> > To: bioperl-l@bioperl.org
> > Subject: [Bioperl-l] Identifiable and Describable
> > 
> > 
> > 
> > I have put in two interfaces, IdentifiableI and DescribableI into
> > bioperl.
> > 
> > 
> > IdentifiableI defines
> > 
> >    ->object_id
> >    ->version
> >    ->namespace
> >    ->authority
> > 
> > I debated adding the common ideas of display_id and description which
> > also are often properties associated with Sequences/Go terms/Pfam
> > domains/Interpros whatever, but realised that ideally this is another
> > interface, which I described as DescribableI
> > 
> >   Methods
> > 
> >    display_name
> >    description
> > 
> > 
> > I made PrimarySeqI isa both an IdentifiableI and DescribableI 
> > and adjusted
> > PrimarySeq implementaiton - need to also handle Seq and then the SeqIO
> > system.
> > 
> > 
> > This is not written in stone yet, so people can still talk me 
> > out of this
> > route, but it feels comfortable for me so far....
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
> > 
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------