Logo Search packages:      
Sourcecode: python-biopython version File versions  Download package

def Bio::MarkovModel::save (   mm,
  handle 
)

save(mm, handle)

Definition at line 92 of file MarkovModel.py.

00092                     :
    """save(mm, handle)"""
    # This will fail if there are spaces in the states or alphabet.
    w = handle.write
    w("STATES: %s\n" % ' '.join(mm.states))
    w("ALPHABET: %s\n" % ' '.join(mm.alphabet))
    w("INITIAL:\n")
    for i in range(len(mm.p_initial)):
        w("  %s: %g\n" % (mm.states[i], mm.p_initial[i]))
    w("TRANSITION:\n")
    for i in range(len(mm.p_transition)):
        x = map(str, mm.p_transition[i])
        w("  %s: %s\n" % (mm.states[i], ' '.join(x)))
    w("EMISSION:\n")
    for i in range(len(mm.p_emission)):
        x = map(str, mm.p_emission[i])
        w("  %s: %s\n" % (mm.states[i], ' '.join(x)))

# XXX allow them to specify starting points
def train_bw(states, alphabet, training_data, 


Generated by  Doxygen 1.6.0   Back to index