[Biojava-l] DNA Strider Format and SeqIOListener problem

Marc Colosimo MEColosimo@alumni.carnegiemellon.edu
Mon, 11 Mar 2002 11:17:28 -0500


Hi,

I've been working on porting a format reader for DNA Strider files (a
very popular Mac program). About 50 to 80 percent of it has been coded
(20% documented). I have limited time to work on this and each
time I pick it up I get stuck with implementing the SeqIOListener
interface. There is very little documentation on how this works. I
understand that I need to chain them together when calling StreamReader:

SequenceBuilderBase at the start that can be followed by either another
base or filter class.

I need to implement a Listener, but I don't know what to add for
properties. There is only one property for these files (if any) and that

is a comment line(s)/description. I looked at FastaDescriptionLineParser

(which doesn't follow that same naming as Genebank/EMBLProcessor) and I
have several questions:

What is the URI?

Is there a list of common Properties/Features?

How to call addSequenceProperty? (what does
StringTokenizer.nextToken"******", do?)

Somewhat off topic: I understand the idea behind using SeqIOListeners,
but, for a new biojava programer, the API is hard to understand. For
example:

interface SeqIOListener
    ~10 methods

interface SequenceBuilder extends SeqIOListener
    one method:public Sequence makeSequence

interface SequenceBuilderFactory
    one method: public SequenceBuilder makeSequenceBuilder

class SequenceBuilderFilter implements SequenceBuilder
    12 methods, public Sequence makeSequence

class SequenceBuilderBase implements SequenceBuilder
    ~13 methods, public Sequence makeSequence

class SimpleSequenceBuilder extends SequenceBuilderBase
     has static FACTORY class that implements SequenceBuilderFactory
    which  returns Sequence SequenceBuilder

Instead of chaining them together by calling each with the other, make
the method addSequenceBuilder to SequenceBuilderBase. So instead of
mySeqBuilderFilter(SimpleSeqBuilder.FACTORY);

something like this,
SeqBuilderBase.addSequenceBuilder(mySeqBuilderFilter)


As you might see there are a lot of interfaces and classes that call
each other, sub-classes, or are inside the other. This gets confusing
rather quickly.

Marc