[Biojava-dev] DNASequence not being a bean

PATERSON Trevor trevor.paterson at roslin.ed.ac.uk
Tue May 11 14:45:43 UTC 2010


Hi

as you may be aware I am working with Andy Law at Roslin  to kick off development of a Java version of the ensembl-api.

It makes good sense for us to integrate with the new Bio-Java code, however we have a few fundamental issues with the immutability of Sequence objects.

Because the BioJava Sequence objects require initialization at construction time with the actual sequence we will have problems using Ibatis mapping to create Sequences from SQL queries, and we will not easily be able to use LazyLoad to fetch the sequence only when we need it.

 Ibatis uses bean setters to set properties on beans, which must have an empty constructor 

- so  setSequence(String seqString, CompoundSet<C> compoundSet) 
and setSequence(SequenceProxyLoader<C> proxyLoader, CompoundSet<C> compoundSet) would be very useful

alternatively we could hack round this if we could access the backing store in our own subclasses of DNASequence - i.e give the Sequence properties 'protected' rather than 'private' visibility.


In essence what we are wanting to do is implement DatasourceAware subclasses of BioJava DNASequence, which we can retrieve partially filled in from Ensembl, but only retrieve and set the actual DNASequence by LazyLoad when we want the DNA Sequence. 

It may be that we can implement this lazy loading using extensions of the SequenceProxyLoader interface (I am guessing that this is what it is for) but again we'd still benefit from accessing the backing store directly.

Obviously I am not up-to-speed with the design ideas behind the DNASequence Object and maybe I am barking  up the wrong tree in trying to subclass it to my own ends, so any hints and tips would be most welcome.

cheers for now

Trevor Paterson PhD
new email trevor.paterson at roslin.ed.ac.uk

Bioinformatics 
The Roslin Institute
The Royal (Dick) School of Veterinary Studies
University of Edinburgh
Scotland EH25 9PS
phone +44 (0)131 5274197
http://www.roslin.ed.ac.uk
http://www.resspecies.org
http://www.thearkdb.org




-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.





More information about the biojava-dev mailing list