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

Add good orientation info

parent aa7ca893
No related branches found
No related tags found
No related merge requests found
Pipeline #25692 failed with stage
in 53 seconds
......@@ -103,22 +103,23 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
"off_target_pampos": off_t[2],
"off_target_strand": off_t[3],
"off_target_recid": off_t[4],
"off_target_good_orientation": None,
}
# Filter the off targets if the strand
# is not the opposite of the feature
off_t[5] = list(
filter(
lambda feat: get_strand_value(
off_target_dict["off_target_strand"]
)
!= get_strand_value(feat.location.strand),
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]:
if get_strand_value(
off_target_dict["off_target_strand"]
) != get_strand_value(feat.location.strand):
off_target_dict[
"off_target_good_orientation"
] = True
else:
off_target_dict[
"off_target_good_orientation"
] = False
feature_dict = {
"off_target_feat_strand": feat.location.strand,
"off_target_feat_start": feat.location.start,
......@@ -133,6 +134,8 @@ def on_target_predict(seq, genome=None, seed_sizes=[8, 9, 10, 11, 12]):
off_targets_list.append(
{**feature_dict, **off_target_dict}
)
# elif not has_feature:
# off_targets_list.append(off_target_dict)
else:
off_targets_list.append(off_target_dict)
off_targets_per_seed.append(
......
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