[Biojava-l] Build Dp from profile HMM read from java serialization

Tisanai T.Krisanathamakul@dcs.shef.ac.uk
Thu, 3 Oct 2002 15:24:49 +0100


Hi

  I save profile HMM and read it back through java serialization. But the problem is sometimes it works but sometimes not.
  My code is as below:

       FileOutputStream fos_md = new FileOutputStream(md_file);
       ObjectOutputStream oos_md = new ObjectOutputStream(fos_md);
       oos_md.writeObject(dp[i].getModel());
       oos_md.close();

       FileInputStream fis_md = new FileInputStream(md_file);
       ObjectInputStream ois_md = new ObjectInputStream(fis_md);
       ProfileHMM model = (ProfileHMM) ois_md.readObject();
       ois_md.close();
       tdp[i] = DPFactory.DEFAULT.createDP(model);

  I got the error message like this:

            org.biojava.bio.BioError: State d-74 is known in states  but is not listed in the transFrom table
	at org.biojava.bio.dp.SimpleMarkovModel.transitionsFrom(SimpleMarkovModel.java:227)
	at org.biojava.bio.dp.DP$HMMOrderByTransition.transitionsTo(DP.java:599)
	at org.biojava.bio.dp.DP$HMMOrderByTransition.compare(DP.java:586)
	at org.biojava.bio.dp.DP.stateList(DP.java:123)
	at org.biojava.bio.dp.DP.update(DP.java:353)
	at org.biojava.bio.dp.onehead.SingleDP.update(SingleDP.java:49)
	at org.biojava.bio.dp.DP.<init>(DP.java:377)
	at org.biojava.bio.dp.onehead.SingleDP.<init>(SingleDP.java:41)
	at org.biojava.bio.dp.DPFactory$DefaultFactory.createDP(DPFactory.java:53)
	at Test.main(Test.java:96)

   Is There anytings to do with the length of the model? Because It's seem no problem with the short model.

Thanks

Tisanai