[Biopython-dev] [Bug 2947] Bio.HMM calculates wrong viterbi path
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Sat Feb 5 07:04:46 UTC 2011
http://bugzilla.open-bio.org/show_bug.cgi?id=2947
------- Comment #11 from walter_gillett at yahoo.com 2011-02-05 02:04 EST -------
Sounds good.
(I had been thinking about trying to preserve backward compatibility for
existing clients of this class. If we require that the caller sets a begin
state then all existing clients will break since none of them currently does
that. But the previous fix has already broken compatibility in any case, and
that was probably necessary since prior to the fix, the results were
incorrect.)
A possible variation would be to handle the transition from the begin state to
the first real state with special-case code, so that the begin state would not
be included in the set of real states. The upside would be that the methods you
mention would not have to change, and we wouldn't be cluttering the state
alphabet with a begin state that isn't real, which I think was a concern
mentioned in comment #6 (if I understood it properly). The downside is having
to add that special-case code. Not sure yet whether this is a good idea or not.
Walter
(In reply to comment #10)
> (In reply to comment #8)
> > I'll volunteer to do all of that (OK with you, Phillip?).
> >
> > Walter
>
> Sure. WRT my earlier comment, I realized that it's simpler for both the
> implementer and the user if the only user-visible change necessary to specify
> begin states is to add a variable to HiddenMarkovBuilder to hold the name of
> the begin state, and then let users use set_transition_score to specify
> transition probabilities from begin states. Then the relevant methods, e.g.
> _all_blank, allow_transition, allow_all_transitions, set_transition_score, etc
> have to be altered to forbid transitions to, or emissions from the begin state.
> And get_markov_model would raise an exception if a begin state hasn't been
> specified or if there isn't at least one transition from the begin state.
>
> So all users would have to do is (using the example from the bug report):
>
> ...
> build.begin_state_name = "begin"
> build.set_transition_score("begin", "u", 0.01)
> build.set_transition_score("begin", "f", 0.99)
> ...
>
> ~Phillip
>
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Biopython-dev
mailing list