@@ -200,6 +200,7 @@ def get_modified_ts(self, result, eps):
200
200
tables = ts .dump_tables ()
201
201
nodes = tables .nodes
202
202
mutations = tables .mutations
203
+ tables .time_units = self .time_units
203
204
204
205
# Add posterior mean and variance to node/mutation metadata
205
206
meta_timing = time .time ()
@@ -215,6 +216,8 @@ def get_modified_ts(self, result, eps):
215
216
# Constrain node ages for positive branch lengths
216
217
constr_timing = time .time ()
217
218
nodes .time = util .constrain_ages (ts , node_mean_t , eps , self .constr_iterations )
219
+ constr_timing -= time .time ()
220
+ logger .info (f"Constrained node ages in { abs (constr_timing ):.2f} seconds" )
218
221
# Possibly change mutation nodes if phasing singletons
219
222
mutations .node = mut_node
220
223
# Deal with mutations. These may have had nodes switched by singleton phasing
@@ -227,17 +230,12 @@ def get_modified_ts(self, result, eps):
227
230
tables .sort () # need to sort before computing parents and times
228
231
tables .build_index ()
229
232
# If mutation nodes have been switched, we may need to recalculate parents
230
- # As we have zapped the time, mutations on the same edge at the same site
231
- # will ordered using the original mutation order
232
233
tables .compute_mutation_parents ()
233
234
tables .compute_mutation_times ()
234
235
num_root_muts = np .sum (mutations .time == nodes .time [mutations .node ])
235
236
logging .info (
236
237
f"Set ages of { num_root_muts } nonsegregating mutations to root times."
237
238
)
238
- tables .time_units = self .time_units
239
- constr_timing -= time .time ()
240
- logger .info (f"Constrained node ages in { abs (constr_timing ):.2f} seconds" )
241
239
if self .provenance_params is not None :
242
240
# Note that the time recorded in provenance excludes numba compilation time
243
241
provenance .record_provenance (
0 commit comments