Skip to content

Commit

Permalink
Mark samples and index tables
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Jan 19, 2023
1 parent dd99990 commit 5d60e6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions c/examples/haploid_wright_fisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ main(int argc, char **argv)
check_tsk_error(ret);
srand((unsigned)atoi(argv[5]));
simulate(&tables, atoi(argv[1]), atoi(argv[2]), atoi(argv[3]));

/* Sort and index so that the result can be opened as a tree sequence */
ret = tsk_table_collection_sort(&tables, NULL, 0);
check_tsk_error(ret);
ret = tsk_table_collection_build_index(&tables, 0);
check_tsk_error(ret);
ret = tsk_table_collection_dump(&tables, argv[4], 0);
check_tsk_error(ret);

Expand Down
4 changes: 4 additions & 0 deletions c/examples/multichrom_wright_fisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ simulate(
simplify_tables(tcs, num_chunks, children, N);
}
}
/* Set the sample flags for final generation */
for (j = 0; j < N; j++) {
tcs[0].nodes.flags[children[j]] = TSK_NODE_IS_SAMPLE;
}
free(buffer);
}

Expand Down

0 comments on commit 5d60e6f

Please sign in to comment.