Skip to content

Commit f480b91

Browse files
committed
more informative error msg
1 parent c3c97b9 commit f480b91

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

smcpp/analysis.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ def _validate_data(self):
7272
np.all(c.data[:, 2::3] == c.n[None, :], axis=1))
7373
if np.any(bad):
7474
logger.error("In file %s, observations %s:", c.fn, np.where(bad)[0])
75-
raise RuntimeError("Error: data set contains sites where every "
76-
"individual is homozygous recessive. Please encode / "
77-
"fold these as non-segregating (homozygous dominant).")
75+
logger.error("Data set contains sites where every "
76+
"individual is homozygous for the derived allele. "
77+
"Please recode these as non-segregating (homozygous ancestral).")
78+
sys.exit(1)
7879
bad = (np.any(c.data[:, 1::3] > c.a[None, :], axis=1) |
7980
np.any(c.data[:, 2::3] > c.data[:, 3::3], axis=1) |
8081
np.any(c.data[:, 3::3] > c.n[None, :], axis=1))

0 commit comments

Comments
 (0)