[Biojava-dev] Contributing chromatogram support to BioJava

Matthew Pocock matthew_pocock at yahoo.co.uk
Mon Mar 10 15:27:45 EST 2003


Hi Rhett,

I totaly see your point. Perhaps the simples should be made more 
visible. Darn, I guess we should have had a .symbols.spi package :) This 
sort of issue hits up hard against one of the limitations of java-like o 
o programming languages - it's hard to come up with a single right way 
to represent things, but it's also hard to dynamically map different 
interfaces and stoorage paradigms between one another without writing 
loads of adaptors.


The other way to do this named properties milarkie is to treat each 
property as an entry in an alignment. So, you could publish some 
well-known labels (say on a *Tools class, or an extention of the 
Alignment interface) called things like DNA, OFFSET etc., and then when 
you parse the scf file, spit out one of these alignments with all the 
bits labeled up. Then the access API would look something like:

   Alignment scf = // get an scf object from some source
   Symbol dna = scf.getSymbolAt(ScfTools.DNA, 7);
   Symbol offset = scf.getSymbolAt(ScfTools.OFFSET, 10);

and if someone wanted just one of the quality values (which I don't know 
the names of, but let's call it Q4)...

   SymbolList q4Vals = scf.symbolListForLabel(ScfTools.Q4);

This isn't perfect, but it may be better on the applications memory 
footprint (when looking at loads of traces) and will play nicer with the 
.gui.sequence package. Any way, see what you think. You're in charge of 
the package :)

Matthew

-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk



More information about the biojava-dev mailing list