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")
def print_suffix_tree_weights(s): """Main driver to solve this problem.""" for x in rm.suffix_tree_weights(s): print x
def suff(f): """Main driver to solve this problem.""" for x in rm.suffix_tree_weights(ro.read_str(f)): print x