evpirnia / hmm-with-state-3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HMM-with-State-3

Assignment 3 of ICS 475
Generate the list of all paths with non-zero probabilities that could have generated the sequence CTTCATGTGAAAGCAGACGTAAGTCA, as well as the corresponding probability(log). Print the best path.

Implement the Hidden Markov Model (HMM) from S. R. Eddy (2004) and add one state “state 3” that should follow state I. Transition probabilities for state I should be 0.9 to stay on I and 0.1 to move to state 3. Emission probabilities for state 3 should be A = 0.01, C = 0, G = 0.99 and T = 0. Transitions probability for state 3 should be 1.0 to move to End state.

Instructions

$ javac HMMPaths.java
$ java HMMPaths

Example of program's output

Path: EEEEEEEEEEEEEEEEEEEEEE5IIIEnd
-41.7133978419
Path: EEEEEEEEEEEEEEEEEEEEE5IIIIEnd
-45.5741275529
Path: EEEEEEEEEEEEEEEEEEEE5IIIIIEnd
-45.1041239237
Path: EEEEEEEEEEEEEEEEEE5IIIIIIIEnd
-41.219677686
Path: EEEEEEEEEEEEEEEE5IIIIIIIIIEnd
-45.9966981289
Path: EEEEEEEEEEEEEEE5IIIIIIIIIIEnd
-42.5822555205
Path: EEEEEEEEEEEEEE5IIIIIIIIIIIEnd
-46.4429852316
Path: EEEEEEEEEEEE5IIIIIIIIIIIIIEnd
-43.944833355
Path: EEEEEEEEEEE5IIIIIIIIIIIIIIEnd
-47.8055630661
Path: EEEEEEEEEE5IIIIIIIIIIIIIIIEnd
-47.3355594368
Path: EEEEEEEEE5IIIIIIIIIIIIIIIIEnd
-46.8655558076
Path: EEEEEEEE5IIIIIIIIIIIIIIIIIEnd
-43.4511131992
Path: EEEEEE5IIIIIIIIIIIIIIIIIIIEnd
-43.8974003018
Path: EEEE5IIIIIIIIIIIIIIIIIIIIIEnd
-47.2881263836
Best : (-41.21967768602254, 'EEEEEEEEEEEEEEEEEE5IIIIIIIEnd')

About


Languages

Language:Java 100.0%