From 23901ee5a41fbcb61b00b723f7b8c94fb97d6795 Mon Sep 17 00:00:00 2001 From: andrewkern Date: Fri, 3 Jul 2020 18:29:57 +0000 Subject: [PATCH] bug fix from deterministic sweep set up check --- discoal_multipop.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/discoal_multipop.c b/discoal_multipop.c index 0643b2b..17393ec 100644 --- a/discoal_multipop.c +++ b/discoal_multipop.c @@ -246,12 +246,14 @@ int main(int argc, const char * argv[]){ if(breakPoints[k] - lastBreak > 0){ printf("[%d]",breakPoints[k] - lastBreak); - printTreeAtSite(tempSite); + printf("%g\n",allNodes[findRootAtSite(breakPoints[k])]->time); + //printTreeAtSite(tempSite); lastBreak = breakPoints[k]; } } printf("[%d]",nSites- lastBreak); - printTreeAtSite(1.0 - (1.0/nSites)); + printf("%g\n",allNodes[findRootAtSite(1.0-(1.0/nSites))]->time); + //printTreeAtSite(1.0 - (1.0/nSites)); } else{ @@ -662,7 +664,7 @@ void getParameters(int argc,const char **argv){ selCheck = 1; } if(events[i].type == 'n'){ - nChangeCheck = 1; + nChangeCheck += 1; } } if(selCheck == 1){ @@ -670,8 +672,8 @@ void getParameters(int argc,const char **argv){ printf("Error with event specification: a single sweep event has been found but recurrentSweep mode has been specified\n"); exit(666); } - if(nChangeCheck==1 && sweepMode=='d'){ - printf("Error with event specification: you chose 1 or more population size changes with a determinstic sweep. Please us -ws flag instead\n"); + if(nChangeCheck > 1 && sweepMode=='d'){ + printf("Error with event specification: you chose 1 or more population size changes with a deterministic sweep. Please us -ws flag instead\n"); exit(666); } if(softSweepMode == 1 && partialSweepMode == 1){