[Biojava-l] creating a new alphabet?

Thomas Down td2@sanger.ac.uk
Sat, 23 Nov 2002 01:49:50 +0000


Okay, I think this should be fixed now -- haven't actually
tested it over the wire for RMI, but ambiguity symbols now
serialize to disk and deserialize okay, so RMI should work too.

    Thomas.

On Fri, Nov 22, 2002 at 04:46:24PM -0500, Dave Barkan wrote:
> 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.
A
> Dave Barkan