def find_stems_make_case(seq, foldnum, comment): foldings = unafold.parse_ct(unafold.run_hybrid_ss_min(seq)) tosave_filename = "tests/find_stems/" + seq + "_%d" % (foldnum - 1) tosave = open(tosave_filename, "w") test_case = [foldings[foldnum - 1], unafold.find_stems(foldings[foldnum - 1]), comment] pickle.dump(test_case, tosave) print ("find_stems_make_case(%s, %d, %s): pickling %s" % (seq, foldnum, comment, test_case)) tosave.close()
def _find_stems(folding, expected): results = unafold.find_stems(folding, True) print ("find_stems(): found %d stems" % (len(results))) if results != expected: print ("unafold_find_stems_test(): stems, expected %s, found %s" % (expected, str(results))) print "unafold_find_stems_test(): pretty printed sequence" print unafold.format_fold_debug(folding) assert False else: pass