Exemple #1
0
def test_suffix_tree_weights(file_name_prefix):
    s = ro.read_str("%s/%s.dat" % (ro.ROSALIND_HOME, file_name_prefix))
    actual = np.array(list(rm.suffix_tree_weights(s)))
    expected = np.loadtxt("%s/%s.out" % (ro.ROSALIND_HOME, file_name_prefix), dtype=str)
    np.savetxt("%s/%s.mine.out" % (ro.ROSALIND_HOME, file_name_prefix), np.array(sorted(actual)), fmt="%s")
    # print sorted(actual)
    # print sorted(expected)
    assert_equal(sorted(actual), sorted(expected), "Wrong suffix tree weight list")
Exemple #2
0
def print_suffix_tree_weights(s):
    """Main driver to solve this problem."""
    for x in rm.suffix_tree_weights(s):
        print x
Exemple #3
0
def suff(f):
    """Main driver to solve this problem."""
    for x in rm.suffix_tree_weights(ro.read_str(f)):
        print x