Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CRISPRbact
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David BIKARD
CRISPRbact
Commits
0ae5937f
Commit
0ae5937f
authored
4 years ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Add fully matched target #12
parent
8ce8bb98
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crisprbact/predict.py
+3
-2
3 additions, 2 deletions
crisprbact/predict.py
with
3 additions
and
2 deletions
crisprbact/predict.py
+
3
−
2
View file @
0ae5937f
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment