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

def Bio::MarkovModel::save (   mm,

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))
    for i in range(len(mm.p_initial)):
        w("  %s: %g\n" % (mm.states[i], mm.p_initial[i]))
    for i in range(len(mm.p_transition)):
        x = map(str, mm.p_transition[i])
        w("  %s: %s\n" % (mm.states[i], ' '.join(x)))
    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