From 0ae5937fc46b2e5dbda6c04fe44aefb1b544ff27 Mon Sep 17 00:00:00 2001
From: Remi Planel <rplanel@pasteur.fr>
Date: Thu, 16 Apr 2020 18:04:09 +0200
Subject: [PATCH] Add fully matched target #12

---
 crisprbact/predict.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/crisprbact/predict.py b/crisprbact/predict.py
index f0e09b8..0c395eb 100644
--- a/crisprbact/predict.py
+++ b/crisprbact/predict.py
@@ -12,6 +12,7 @@ with open_binary("crisprbact", "reg_coef.pkl") as handle:
     coef = np.load(handle, allow_pickle=True)
 
 bases = ["A", "T", "G", "C"]
+GUIDE_LEN = 20
 
 
 def encode(seq):
@@ -40,7 +41,7 @@ def find_targets(seq):
             guide_start = start - start_min
             guide_end = end - 16 - 3
             guide = seq_revcomp[guide_start:guide_end]
-            assert len(guide) == 20
+            assert len(guide) == GUIDE_LEN
             pos_seq_start = L - guide_end
             pos_seq_stop = L - guide_start
             pos_seq_pam = pos_seq_start - 3
@@ -62,7 +63,7 @@ def get_strand_value(value):
     return strand_dict[str(value)]
 
 
-def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
+def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12, GUIDE_LEN]):
 
     seq = seq.upper()  # make uppercase
     seq = re.sub(r"\s", "", seq)  # removes white space
-- 
GitLab