From c3b35e1fe8b1cf853133b98cbf8b8f724bc51cd2 Mon Sep 17 00:00:00 2001 From: Ben Cornett Date: Fri, 12 Oct 2018 18:14:20 -0400 Subject: [PATCH] Simplify sequence check --- indel_prediction/predictor/predict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indel_prediction/predictor/predict.py b/indel_prediction/predictor/predict.py index 8c34932..bc4f7ca 100644 --- a/indel_prediction/predictor/predict.py +++ b/indel_prediction/predictor/predict.py @@ -82,7 +82,7 @@ def plot_predictions(theta_file, target_seq, pam_idx): if pam_idx < 0 or pam_idx >= (len(target_seq)-3): raise Exception('PAM idx out of range') - if sum([x in ['A','T','G','C'] for x in target_seq]) != len(target_seq): + if set(target_seq) - set("ATGC"): raise Exception('Sequence must be composed of A,T,G,or C only') if len(target_seq) < 20 or pam_idx < 13 or pam_idx > len(target_seq)-7: