Skip to content

Commit ba38d1b

Browse files
committed
exit with error if trying to use split with no JSFS
1 parent d435fb0 commit ba38d1b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

smcpp/analysis.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ def __init__(self, files, args):
409409
self._init_inference_manager(False)
410410
self._init_optimizer(args, files, args.outdir, args.algorithm, args.tolerance, args.blocks)
411411

412+
def _validate_data(self):
413+
BaseAnalysis._validate_data(self)
414+
if not any(c.npop == 2 for c in self._contigs):
415+
logger.error("Data contains no joint frequency spectrum information. Split estimation is impossible.")
416+
sys.exit(1)
417+
412418
def _init_optimizer(self, args, files, outdir, algorithm, tolerance, blocks, save=True):
413419
self._optimizer = optimizer.TwoPopulationOptimizer(self, algorithm, tolerance, blocks, args.solver_args)
414420
smax = np.sum(self._model.distinguished_model.s)

0 commit comments

Comments
 (0)