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
b9ee273f
Commit
b9ee273f
authored
5 years ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug no off-target feature. Fix #6
parent
aeac9e45
No related branches found
No related tags found
No related merge requests found
Pipeline
#23472
passed with stage
in 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+4
-0
4 additions, 0 deletions
CHANGELOG
crisprbact/predict.py
+31
-24
31 additions, 24 deletions
crisprbact/predict.py
with
35 additions
and
24 deletions
CHANGELOG
+
4
−
0
View file @
b9ee273f
# 0.3.2
- Fix bugg when no off-target feature
- Handle genome in fasta file
# 0.3.1
- Fix bug when no feature
- Add off-target strand to output
...
...
This diff is collapsed.
Click to expand it.
crisprbact/predict.py
+
31
−
24
View file @
b9ee273f
...
...
@@ -72,31 +72,38 @@ def on_target_predict(seq, genome=None, seed_size=7):
target
[
"
guide
"
],
seed_size
,
records
,
genome_features
)
off_targets_list
=
[]
off_targets
=
off_target_df
.
loc
[
0
:,
[
"
start
"
,
"
end
"
,
"
pampos
"
,
"
strand
"
,
"
features
"
]
]
for
index
,
off_t
in
enumerate
(
off_targets
.
values
.
tolist
()):
off_target_dict
=
{
"
off_target_start
"
:
off_t
[
0
],
"
off_target_end
"
:
off_t
[
1
],
"
pampos
"
:
off_t
[
2
],
"
strand
"
:
off_t
[
3
],
}
if
len
(
off_t
[
4
])
>
0
:
for
feat
in
off_t
[
4
]:
feature_dict
=
{
"
feat_strand
"
:
feat
.
location
.
strand
,
"
feat_start
"
:
feat
.
location
.
start
,
"
feat_end
"
:
feat
.
location
.
end
,
"
feat_type
"
:
feat
.
type
,
}
for
k
,
feat
in
feat
.
qualifiers
.
items
():
if
k
!=
"
translation
"
:
feature_dict
[
k
]
=
"
::
"
.
join
(
feat
)
if
not
off_target_df
.
empty
:
off_targets
=
off_target_df
.
loc
[
0
:,
[
"
start
"
,
"
end
"
,
"
pampos
"
,
"
strand
"
,
"
recid
"
,
"
features
"
]
]
for
index
,
off_t
in
enumerate
(
off_targets
.
values
.
tolist
()):
off_target_dict
=
{
"
off_target_start
"
:
off_t
[
0
],
"
off_target_end
"
:
off_t
[
1
],
"
pampos
"
:
off_t
[
2
],
"
strand
"
:
off_t
[
3
],
"
recid
"
:
off_t
[
4
],
}
if
len
(
off_t
[
5
])
>
0
:
# Loop for each feature
for
feat
in
off_t
[
5
]:
feature_dict
=
{
"
feat_strand
"
:
feat
.
location
.
strand
,
"
feat_start
"
:
feat
.
location
.
start
,
"
feat_end
"
:
feat
.
location
.
end
,
"
feat_type
"
:
feat
.
type
,
}
for
k
,
feat
in
feat
.
qualifiers
.
items
():
if
k
!=
"
translation
"
:
feature_dict
[
k
]
=
"
::
"
.
join
(
feat
)
off_targets_list
.
append
(
{
**
feature_dict
,
**
off_target_dict
}
)
else
:
off_targets_list
.
append
(
off_target_dict
)
else
:
off_targets_list
.
append
({
**
feature_dict
,
**
off_target_dict
})
target
.
update
({
"
off_targets
"
:
off_targets_list
})
target
.
update
({
"
off_targets
"
:
off_targets_list
})
else
:
target
.
update
({
"
off_targets
"
:
off_targets_list
})
else
:
target
.
update
({
"
off_targets
"
:
[]})
return
alltargets
...
...
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