[Biojava-dev] In which the Multihead DP traverses MagicalState repeatedly

David Huen david.huen at ntlworld.com
Sun Jan 4 16:46:04 EST 2004


With some combinations of parameters (rather poor ones for the sequences to 
aligned by Viterbi), our twohead DP implementation can generate a StatePath 
that traverses the magicalState on multiple occasions.

After investigating it at length, I think it comes about comes about because 
the EmissionCache treats the MagicalState as an EmissionState with advance 
(0, 0) and a finite probability.  However, traversal through the 
MagicalState should be explicitly forbidden in the Viterbi statepath.

I have implemented fixes in both LightPairDPCursor and EmissionCache to set 
the probability score of the MagicalState to -infinity at all points in the 
DP matrix other than at the origin and bottom right corner.  This seems to 
have fixed this problem within my dataset.

I have also retrofitted an equivalent fix into AbstractMatrixPairDPCursor 
but I am insufficiently familiar with that code to be certain of it being 
correct.

I don't know if there are consequences for DPCompiler.

Anyway, I have committed the fixes.

Incidentally, if you have been running 2-head DPs with the current code and 
do not usually examine the generated StatePaths, you may wish to repeat 
some of those runs and compare the results.  The ability to traverse the 
MagicalState does create amazing opportunities for the model to go where no 
model has ever been before :-)

Regards,
David Huen


More information about the biojava-dev mailing list