Skip to content
Snippets Groups Projects
Commit 0ae5937f authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Add fully matched target #12

parent 8ce8bb98
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ with open_binary("crisprbact", "reg_coef.pkl") as handle: ...@@ -12,6 +12,7 @@ with open_binary("crisprbact", "reg_coef.pkl") as handle:
coef = np.load(handle, allow_pickle=True) coef = np.load(handle, allow_pickle=True)
bases = ["A", "T", "G", "C"] bases = ["A", "T", "G", "C"]
GUIDE_LEN = 20
def encode(seq): def encode(seq):
...@@ -40,7 +41,7 @@ def find_targets(seq): ...@@ -40,7 +41,7 @@ def find_targets(seq):
guide_start = start - start_min guide_start = start - start_min
guide_end = end - 16 - 3 guide_end = end - 16 - 3
guide = seq_revcomp[guide_start:guide_end] guide = seq_revcomp[guide_start:guide_end]
assert len(guide) == 20 assert len(guide) == GUIDE_LEN
pos_seq_start = L - guide_end pos_seq_start = L - guide_end
pos_seq_stop = L - guide_start pos_seq_stop = L - guide_start
pos_seq_pam = pos_seq_start - 3 pos_seq_pam = pos_seq_start - 3
...@@ -62,7 +63,7 @@ def get_strand_value(value): ...@@ -62,7 +63,7 @@ def get_strand_value(value):
return strand_dict[str(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 = seq.upper() # make uppercase
seq = re.sub(r"\s", "", seq) # removes white space seq = re.sub(r"\s", "", seq) # removes white space
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment