def validate(self):
"""
Raises an informative ``ValueError`` if the time points in the analysis are not suitable.
Calls validate method on all child SeqLibs.
"""
# check the time points
if 0 not in self.timepoints:
raise ValueError("Missing timepoint 0 [{}]".format(self.name))
if self.timepoints[0] != 0:
raise ValueError("Invalid negative timepoint [{}]".format(self.name))
if len(self.timepoints) < 2:
raise ValueError("Multiple timepoints required [{}]".format(self.name))
elif len(self.timepoints) < 3 and self.scoring_method in ("WLS", "OLS"):
raise ValueError("Insufficient number of timepoints for regression scoring [{}]".format(self.name))
# check the wild type sequences
if self.has_wt_sequence():
for child in self.children[1:]:
if self.children[0].wt != child.wt:
logging.warning("Inconsistent wild type sequences", extra={'oname' : self.name})
break
# check that we're not doing wild type normalization on something with no wild type
#if not self.has_wt_sequence() and self.logr_method == "wt":
# raise ValueError("No wild type sequence for wild type normalization [{}]".format(self.name))
# validate children
for child in self.children:
child.validate()
评论列表
文章目录