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

Factor out distributed SMC logic #2303

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixup GC left event and tests
  • Loading branch information
jeromekelleher committed Aug 5, 2024
commit 0b60d27a8b76828bbc2fdba5ecee82b0965c4a42
13 changes: 0 additions & 13 deletions lib/msprime.c
Original file line number Diff line number Diff line change
Expand Up @@ -5190,7 +5190,6 @@ msp_gene_conversion_left_event(msp_t *self, label_id_t label)
population_id_t population;
lineage_t *lineage, *new_lineage;
segment_t *y, *x, *alpha;
hull_t *rhs_hull;
hull_t *lhs_hull = NULL;

lhs_hull = NULL;
Expand Down Expand Up @@ -5306,18 +5305,6 @@ msp_gene_conversion_left_event(msp_t *self, label_id_t label)
self->sequence_length);
msp_reset_hull_right(
self, lhs_hull, lhs_old_right, lhs_new_right, y->lineage->population, label);

// rhs
tsk_bug_assert(alpha->left < lhs_old_right);
rhs_hull = msp_alloc_hull(self, alpha->left, lhs_old_right, alpha->lineage);
if (rhs_hull == NULL) {
ret = MSP_ERR_NO_MEMORY;
goto out;
}
ret = msp_insert_hull(self, rhs_hull);
if (ret != 0) {
goto out;
}
}

out:
Expand Down
10 changes: 5 additions & 5 deletions lib/tests/test_ancestry.c
Original file line number Diff line number Diff line change
Expand Up @@ -4201,7 +4201,6 @@ test_fenwick_rebuild_smc_k(void)
tsk_table_collection_free(&tables);
}

#if 0
static void
run_smc_k_gc_simulation(
double gc_rate, double tract_length, bool discrete_genome, double offset)
Expand Down Expand Up @@ -4230,10 +4229,12 @@ run_smc_k_gc_simulation(
CU_ASSERT_EQUAL_FATAL(msp_set_recombination_rate(&msp, recombination_rate), 0);
CU_ASSERT_EQUAL_FATAL(msp_set_gene_conversion_rate(&msp, gc_rate), 0);
CU_ASSERT_EQUAL_FATAL(msp_set_gene_conversion_tract_length(&msp, tract_length), 0);
ret = msp_initialise(&msp);
CU_ASSERT_EQUAL_FATAL(ret, 0);
ret = msp_set_simulation_model_smc_k(&msp, offset);
CU_ASSERT_EQUAL_FATAL(ret, 0);
ret = msp_initialise(&msp);
CU_ASSERT_EQUAL_FATAL(ret, 0);

msp_verify(&msp, 0);

ret = msp_run(&msp, DBL_MAX, ULONG_MAX);
CU_ASSERT_EQUAL(ret, 0);
Expand Down Expand Up @@ -4266,7 +4267,6 @@ test_smc_k_gc(void)
run_smc_k_gc_simulation(1.0, tract_lengths[j], false, 3.1);
}
}
#endif

int
main(int argc, char **argv)
Expand Down Expand Up @@ -4367,7 +4367,7 @@ main(int argc, char **argv)
{ "test_mixed_model_smc_k", test_mixed_model_smc_k },
{ "test_mixed_model_smc_k_large", test_mixed_model_smc_k_large },
{ "test_fenwick_rebuild_smc_k", test_fenwick_rebuild_smc_k },
/* { "test_smc_k_gc", test_smc_k_gc }, */
{ "test_smc_k_gc", test_smc_k_gc },
CU_TEST_INFO_NULL,
};

Expand Down