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
You need to sign in or sign up before continuing.
Show more breadcrumbs
David BIKARD
CRISPRbact
Commits
510a8c82
Commit
510a8c82
authored
5 years ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Rename off-target feature keys
parent
5b5aa399
No related branches found
No related tags found
1 merge request
!4
Multi seed size
Pipeline
#24818
passed with stage
in 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crisprbact/predict.py
+10
-5
10 additions, 5 deletions
crisprbact/predict.py
with
10 additions
and
5 deletions
crisprbact/predict.py
+
10
−
5
View file @
510a8c82
...
...
@@ -71,11 +71,12 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
for
i
,
target
in
enumerate
(
alltargets
):
target_id
=
i
+
1
target
.
update
({
"
id
"
:
target_id
})
target
.
update
({
"
target_
id
"
:
target_id
})
target
.
update
({
"
pred
"
:
preds
[
i
]})
if
genome
:
off_targets_per_seed
=
[]
for
seed_size
in
seed_sizes
:
# off-target found for a guide
off_target_df
=
compute_off_target_df
(
target
[
"
guide
"
],
seed_size
,
records
,
genome_features
)
...
...
@@ -87,7 +88,7 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
]
for
j
,
off_t
in
enumerate
(
off_targets
.
values
.
tolist
()):
off_target_dict
=
{
"
id
"
:
str
(
target_id
)
"
off_target_
id
"
:
str
(
target_id
)
+
"
-
"
+
str
(
seed_size
)
+
"
-
"
...
...
@@ -98,7 +99,8 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
"
off_target_strand
"
:
off_t
[
3
],
"
off_target_recid
"
:
off_t
[
4
],
}
# Filter the off targets if the strand
# is not the opposite of the feature
off_t
[
5
]
=
list
(
filter
(
lambda
feat
:
get_strand_value
(
...
...
@@ -108,6 +110,7 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
off_t
[
5
],
)
)
# Loop through features associated to an off-target position
if
len
(
off_t
[
5
])
>
0
:
# Loop for each feature
for
feat
in
off_t
[
5
]:
...
...
@@ -119,7 +122,9 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
}
for
k
,
feat
in
feat
.
qualifiers
.
items
():
if
k
!=
"
translation
"
:
feature_dict
[
k
]
=
"
::
"
.
join
(
feat
)
feature_dict
[
"
off_target_
"
+
k
]
=
"
::
"
.
join
(
feat
)
off_targets_list
.
append
(
{
**
feature_dict
,
**
off_target_dict
}
)
...
...
@@ -137,7 +142,7 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
{
"
id
"
:
str
(
i
)
+
"
-
"
+
str
(
seed_size
),
"
seed_size
"
:
seed_size
,
"
off_targets
"
:
off_targets_list
,
"
off_targets
"
:
[]
,
}
)
# target.update({"off_targets": off_targets_list})
...
...
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