Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement tskit treeseq from text mutations #2734

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions c/tests/test_trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -3739,13 +3739,13 @@ test_simplest_mutation_edges(void)
const char *mutations = "0 1 1\n"
"0 0 1\n"
"0 2 1\n"
"1 0 1\n"
"1 2 1\n"
"1 1 1\n"
"1 2 1\n";
"1 0 1\n";
tsk_treeseq_t ts;
tsk_tree_t tree;
/* We have mutations over roots, samples and just isolated nodes */
tsk_id_t mutation_edges[] = { -1, 0, -1, 1, -1, -1 };
tsk_id_t mutation_edges[] = { -1, 0, -1, -1, -1, 1 };
tsk_size_t i, j, k, t;
tsk_mutation_t mut;
tsk_site_t site;
Expand Down
7 changes: 7 additions & 0 deletions c/tests/testlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,13 @@ tsk_treeseq_from_text(tsk_treeseq_t *ts, double sequence_length, const char *nod
}
}

ret = tsk_table_collection_build_index(&tables, 0);
CU_ASSERT_EQUAL_FATAL(ret, 0);
if (mutations != NULL) {
ret = tsk_table_collection_compute_mutation_parents(&tables, 0);
CU_ASSERT_EQUAL_FATAL(ret, 0);
}

ret = tsk_treeseq_init(ts, &tables, TSK_TS_INIT_BUILD_INDEXES);
/* tsk_treeseq_print_state(ts, stdout); */
/* printf("ret = %s\n", tsk_strerror(ret)); */
Expand Down