@@ -141,7 +141,7 @@ def write_slim_script(outfile, format_dict):
141141 initializeRecombinationRate({RHO});
142142 }}
143143 // create a population
144- 1
144+ 1 early()
145145 {{
146146 {POP_STRS};
147147 sim.tag = 0;
@@ -151,11 +151,11 @@ def write_slim_script(outfile, format_dict):
151151 {{
152152 if (sim.tag == 0) {{
153153 if (sim.treeSeqCoalesced()) {{
154- sim.tag = sim.generation ;
154+ sim.tag = sim.cycle ;
155155 catn(sim.tag + ': COALESCED');
156156 }}
157157 }}
158- if (sim.generation == sim.tag * 10) {{
158+ if (sim.cycle == sim.tag * 10) {{
159159 sim.simulationFinished();
160160 catn('Ran a further ' + sim.tag * 10 + ' generations');
161161 sim.treeSeqOutput('{OUTFILE}');
@@ -185,7 +185,7 @@ def write_sweep_slim_script(outfile, format_dict):
185185 sim.simulationFinished();
186186 }}
187187
188- 1 {{
188+ 1 early() {{
189189 // save this run's identifier, used to save and restore
190190 defineConstant("simID", getSeed());
191191 sim.addSubpop("p1", {POPSIZE});
@@ -195,7 +195,7 @@ def write_sweep_slim_script(outfile, format_dict):
195195 2 late() {{
196196 // save the state of the simulation
197197 sim.treeSeqOutput("/tmp/slim_" + simID + ".trees");
198- target = sample(p1.genomes , 1);
198+ target = sample(p1.haplosomes , 1);
199199 target.addNewDrawnMutation(m2, {SWEEPPOS});
200200 }}
201201 2:2000 late() {{
@@ -208,15 +208,15 @@ def write_sweep_slim_script(outfile, format_dict):
208208 if (fixed)
209209 {{
210210 if (sim.getValue("flag") == 1){{
211- sim .rescheduleScriptBlock(s1,
212- start=sim.generation +{TAU}, end=sim.generation +{TAU});
211+ community .rescheduleScriptBlock(s1,
212+ start=sim.cycle +{TAU}, end=sim.cycle +{TAU});
213213 }}
214214 }}
215215 else
216216 {{
217217 sim.readFromPopulationFile("/tmp/slim_" + simID + ".trees");
218218 setSeed(rdunif(1, 0, asInteger(2^62) - 1));
219- target = sample(p1.genomes , 1);
219+ target = sample(p1.haplosomes , 1);
220220 target.addNewDrawnMutation(m2, {SWEEPPOS});
221221 }}
222222 }}
@@ -946,9 +946,9 @@ def sample_recap_simplify(slim_ts, sample_size, Ne, r, mu):
946946 demography = demography ,
947947 recombination_rate = r ,
948948 # TODO is this needed now? Shouldn't be, right?
949- start_time = slim_ts .metadata ["SLiM" ]["generation " ],
949+ start_time = slim_ts .metadata ["SLiM" ]["cycle " ],
950950 )
951- logging .debug (f"pyslim: slim generation:{ slim_ts .metadata ['SLiM' ]['generation ' ]} " )
951+ logging .debug (f"pyslim: slim generation:{ slim_ts .metadata ['SLiM' ]['cycle ' ]} " )
952952 alive_inds = pyslim .individuals_alive_at (recap , 0 )
953953 keep_indivs = np .random .choice (alive_inds , sample_size , replace = False )
954954 keep_nodes = []
@@ -3823,7 +3823,9 @@ def test_gc_correlation_between_trees(self):
38233823 seq_length = 500
38243824 # tests both Hudson as well as SMC K
38253825 # by setting hull_offset to seq_length are essentially simulating Hudson
3826- models = ["hudson" , msprime .SmcKApproxCoalescent (hull_offset = seq_length )]
3826+ # models = ["hudson", msprime.SmcKApproxCoalescent(hull_offset=seq_length)]
3827+ # GC for smck is currently not supported
3828+ models = ["hudson" ]
38273829 predicted_prob = np .zeros ([gc_length_rate_ratio .size , seq_length ], dtype = float )
38283830 empirical_prob_first = np .zeros (
38293831 [2 , gc_length_rate_ratio .size , seq_length ], dtype = float
@@ -4949,6 +4951,8 @@ def test_smck_vs_smckapprox_multiple_bottleneck(self):
49494951 sequence_length = 5e7 ,
49504952 )
49514953
4954+ '''
4955+ Commented as gc is not yet supported in SmcKApproxCoalescent
49524956 def test_gc_tract_length_smc(self):
49534957 """
49544958 Runs the check for the mean length of gene conversion tracts.
@@ -5132,6 +5136,7 @@ def test_smc_k_num_trees_gc(self):
51325136 pyplot.tight_layout()
51335137 pyplot.savefig(self.output_dir / "breakpoints_boxplot.png")
51345138 pyplot.close()
5139+ '''
51355140
51365141 def test_out_of_africa_migration_model (self ):
51375142 s_no = 10
0 commit comments