From ad717c3d3c68b22f27cdfb7657735f56d90b7ffa Mon Sep 17 00:00:00 2001 From: Mehrdad Bakhtiari Date: Sat, 23 Mar 2019 19:52:16 -0700 Subject: [PATCH] fix addmodel bug with no false read --- advntr/vntr_finder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advntr/vntr_finder.py b/advntr/vntr_finder.py index 5fe57a8..97cca06 100644 --- a/advntr/vntr_finder.py +++ b/advntr/vntr_finder.py @@ -801,6 +801,8 @@ def find_recruitment_score_threshold(self, processed_true_reads, processed_false from sklearn.linear_model import LogisticRegression true_scores = [read.logp for read in processed_true_reads] false_scores = [read.logp for read in processed_false_reads] + if len(false_scores) == 0: + false_scores = [min(true_scores) - 2] clf = LogisticRegression() x = [[score] for score in true_scores + false_scores] y = [1] * len(true_scores) + [0] * len(false_scores)