We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 385ffea commit ede50c6Copy full SHA for ede50c6
smcpp/analysis.py
@@ -75,6 +75,14 @@ def _validate_data(self):
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).")
78
+ bad = (np.any(c.data[:, 1::3] > c.a[None, :], axis=1) |
79
+ np.any(c.data[:, 2::3] > c.data[:, 3::3], axis=1) |
80
+ np.any(c.data[:, 3::3] > c.n[None, :], axis=1))
81
+ if np.any(bad):
82
+ logger.error("File %s has invalid observations "
83
+ "(a > 2 or b > n or n > sample size): %s",
84
+ c.fn, np.where(bad)[0])
85
+ sys.exit(1)
86
87
def _recode_nonseg(self, cutoff):
88
self._contigs = estimation_tools.recode_nonseg(self._contigs, cutoff)
0 commit comments