Skip to content

Commit 36b2d15

Browse files
committed
[split] simplify split time estimation
1 parent 4a1c3e8 commit 36b2d15

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

smcpp/analysis.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def _perform_thinning(self, thinning):
130130
new_data = estimation_tools.thin_dataset(self._data, thinning)
131131
self._contigs = [Contig(data=d, pid=c.pid, fn=c.fn, n=c.n, a=c.a)
132132
for c, d in zip(self._contigs, new_data)]
133-
elif np.any(ns > 0):
134-
logger.warn("Not thinning yet undistinguished lineages are present")
133+
# elif np.any(ns > 0):
134+
# logger.warn("Not thinning yet undistinguished lineages are present")
135135

136136
def _normalize_data(self, length_cutoff, filter):
137137
## break up long spans
@@ -371,14 +371,14 @@ def __init__(self, files, args):
371371
assert self.npop == 2
372372
self._init_model(args.pop1, args.pop2)
373373
self._init_penalty()
374-
self._hidden_states = {k: np.r_[[0], self.model.distinguished_model._knots, [np.inf]]
375-
for k in self._populations}
376-
# After inferring initial split time, thin
377-
self._perform_thinning(args.thinning)
378-
self._normalize_data(args.length_cutoff, not args.no_filter)
374+
375+
self._hidden_states = {k: np.array([0.0, np.inf]) for k in self._populations}
379376
# Further initialization
380377
self._init_inference_manager(args.polarization_error)
381378
self._init_optimizer(args.outdir, args.algorithm, args.xtol, args.ftol)
379+
# Do not do any optimization, just fit the split
380+
self._optimizer._coordinates = lambda: []
381+
self._niter = 1
382382

383383
def _validate_data(self):
384384
BaseAnalysis._validate_data(self)

0 commit comments

Comments
 (0)