[Biojava-l] creating a new alphabet?

Dave Barkan dbarkan@snowball.pcbi.upenn.edu
Fri, 22 Nov 2002 16:46:24 -0500 (EST)


Hi, I have been running into a problem.  I have long strings representing
sequences, some of which contain the character 'n'.  I am working with
them using a client/server over RMI.  When the server attempt to create a
new SymbolList using the following method:

 SymbolList dna =  DNATools.createDNA(sequence) // sequence contains 'n'

I get this exception on the Client side:

java.lang.NullPointerException
	at
org.biojava.bio.symbol.AlphabetManager.alphabetForName(AlphabetManager.java:148)
	at
org.biojava.bio.symbol.AbstractAlphabet.readResolve(AbstractAlphabet.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	...lots more RMI exceptions

I am assuming this happens because 'n' is in the sequence because it works
fine when 'n' is not in the sequence, everything else being equal (If I'm
wrong, any other ideas as to why this might be occuring?)

I'm considering trying to create my own alphabet, symbolTokenization, etc
to get the functionality of everything I get using AlphabetManager
methods.  However, I've tried this before a while ago and as I recall it
was a little complicated.  I think I got stuck when I tried to create a
SymbolTokenization, the API for the Alphabet said I 'need a symbol
parser under the name "token" and one under the name "name"' and I wasn't
sure how to set names for SymbolTokenizations.

So I guess my options are
1) Continue trying to create my own alphabet or
2) An easier way which hopefully someone can suggest?

Any advice is appreciated, thanks.
Dave Barkan