[Biojava-l] Problem with serialisation of Markov Models

Lachlan Coin lc1@sanger.ac.uk
Wed, 10 Jul 2002 15:43:47 +0100 (BST)


Hi,

I am trying to use serialisation to write a ProfileHMM  to
disk and then to read it from disk.  However, I get the following error in
reading the object from the disk when I write:

ProfileHMM model = (ProfileHMM) p.readObject();


java.lang.NullPointerException
        at org.biojava.bio.symbol.AlphabetManager.alphabetForName
(AlphabetManager.java:148) (pc 20)
        at org.biojava.bio.symbol.AbstractAlphabet.readResolve
(AbstractAlphabet.java:76) (pc 4)
        at java.lang.reflect.Method.invoke (Method.java)
        at java.io.ObjectStreamClass.invokeMethod
(ObjectStreamClass.java:1615) (pc 5)
        at
java.io.ObjectInputStream.readObject(boolean) (ObjectInputStream.java:393) (pc
...



This suggests that alphabet embedded in my ProfileHMM object hasn't been
correctly written to disk somehow, even though the in-memory version 
works fine?  Any ideas?

Thanks very much,

Lachlan