Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GrAnnoT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DIADE
dynadiv
GrAnnoT
Commits
9b956e39
Commit
9b956e39
authored
1 year ago
by
nina.marthe_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
corrigé la position des délétions qui fonctionnait pas quand on deletait le premier segment
parent
352a4b24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Functions.py
+9
-6
9 additions, 6 deletions
Functions.py
Functions_output.py
+1
-1
1 addition, 1 deletion
Functions_output.py
with
10 additions
and
7 deletions
Functions.py
+
9
−
6
View file @
9b956e39
...
@@ -342,6 +342,7 @@ def reset_var(variation):
...
@@ -342,6 +342,7 @@ def reset_var(variation):
variation
.
type
=
''
# type énuméré.
variation
.
type
=
''
# type énuméré.
variation
.
size_var
=
0
variation
.
size_var
=
0
variation
.
start_var
=
''
variation
.
start_var
=
''
variation
.
start_var_index
=
0
variation
.
ref
=
''
variation
.
ref
=
''
variation
.
alt
=
''
variation
.
alt
=
''
...
@@ -359,27 +360,29 @@ def get_old_new_pos_insertion(variation,feat_start,list_segfeat_azu,feat):
...
@@ -359,27 +360,29 @@ def get_old_new_pos_insertion(variation,feat_start,list_segfeat_azu,feat):
pos_new
=
str
(
start_var
-
start_feat
+
1
)
pos_new
=
str
(
start_var
-
start_feat
+
1
)
return
[
pos_old
,
pos_new
]
# pos_old is the base right after the insertion. pos_new is the base after the first inserted base.
return
[
pos_old
,
pos_new
]
# pos_old is the base right after the insertion. pos_new is the base after the first inserted base.
def
get_old_new_pos_deletion
(
variation
,
feat_start
,
list_segfeat_azu
,
feat
,
i
):
def
get_old_new_pos_deletion
(
variation
,
feat_start
,
list_segfeat_azu
,
feat
):
i
=
variation
.
start_var_index
if
i
==
0
:
if
i
==
0
:
pos_old
=
int
(
Segments
[
variation
.
start_var
].
start
)
-
int
(
feat_start
)
+
Features
[
feat
].
pos_start
+
1
pos_old
=
int
(
Segments
[
variation
.
start_var
].
start
)
-
int
(
feat_start
)
+
Features
[
feat
].
pos_start
-
1
else
:
else
:
pos_old
=
int
(
Segments
[
variation
.
start_var
].
start
)
-
int
(
feat_start
)
+
1
pos_old
=
int
(
Segments
[
variation
.
start_var
].
start
)
-
int
(
feat_start
)
+
1
if
pos_old
<
1
:
if
pos_old
<
0
:
pos_old
=
1
pos_old
=
0
if
variation
.
last_seg_in_target
==
""
:
# deletion of the beggining of the feature, so no segment placed in the new genome yet.
if
variation
.
last_seg_in_target
==
""
:
# deletion of the beggining of the feature, so no segment placed in the new genome yet.
pos_new
=
1
pos_new
=
0
else
:
else
:
start_feat
=
get_feature_start_on_genome
(
list_segfeat_azu
[
0
][
1
:],
feat
)
start_feat
=
get_feature_start_on_genome
(
list_segfeat_azu
[
0
][
1
:],
feat
)
start_var
=
int
(
segments_on_target_genome
[
variation
.
last_seg_in_target
][
2
])
+
1
start_var
=
int
(
segments_on_target_genome
[
variation
.
last_seg_in_target
][
2
])
+
1
pos_new
=
str
(
start_var
-
start_feat
+
1
)
pos_new
=
str
(
start_var
-
start_feat
+
1
)
return
[
pos_old
,
pos_new
]
# pos_old
is the first base deleted.
pos_new
is
the base right
after
the deletion
return
[
pos_old
,
pos_new
]
# pos_old
and
pos_new
are
the base
s
right
before
the deletion
def
init_new_var
(
variation
,
type
,
list_segfeat_nb
,
list_segfeat_azu
,
i
,
j
,
seg_seq
,
feature
):
def
init_new_var
(
variation
,
type
,
list_segfeat_nb
,
list_segfeat_azu
,
i
,
j
,
seg_seq
,
feature
):
variation
.
type
=
type
variation
.
type
=
type
variation
.
start_var
=
list_segfeat_nb
[
i
][
1
:]
variation
.
start_var
=
list_segfeat_nb
[
i
][
1
:]
variation
.
start_var_index
=
i
if
type
==
"
substitution
"
:
if
type
==
"
substitution
"
:
variation
.
start_on_target
=
list_segfeat_azu
[
j
][
1
:]
variation
.
start_on_target
=
list_segfeat_azu
[
j
][
1
:]
variation
.
ref
=
get_segment_sequence
(
seg_seq
,
list_segfeat_nb
[
i
])
variation
.
ref
=
get_segment_sequence
(
seg_seq
,
list_segfeat_nb
[
i
])
...
...
This diff is collapsed.
Click to expand it.
Functions_output.py
+
1
−
1
View file @
9b956e39
...
@@ -250,7 +250,7 @@ def print_current_var(variation,feat_start,list_segfeat_azu,feat,i):
...
@@ -250,7 +250,7 @@ def print_current_var(variation,feat_start,list_segfeat_azu,feat,i):
line
=
f
'
{
variation
.
feature_id
}
\t
{
variation
.
feature_type
}
\t
{
variation
.
chr
}
\t
{
variation
.
start_new
}
\t
{
variation
.
stop_new
}
\t
{
variation
.
size_new
}
\t
{
variation
.
inversion
}
\t
{
variation
.
size_diff
}
\t
insertion
\t
-
\t
{
variation
.
alt
}
\t
{
len
(
variation
.
alt
)
}
\t
{
pos_old
}
\t
{
pos_new
}{
warning
}
\n
'
line
=
f
'
{
variation
.
feature_id
}
\t
{
variation
.
feature_type
}
\t
{
variation
.
chr
}
\t
{
variation
.
start_new
}
\t
{
variation
.
stop_new
}
\t
{
variation
.
size_new
}
\t
{
variation
.
inversion
}
\t
{
variation
.
size_diff
}
\t
insertion
\t
-
\t
{
variation
.
alt
}
\t
{
len
(
variation
.
alt
)
}
\t
{
pos_old
}
\t
{
pos_new
}{
warning
}
\n
'
write_line
(
line
,
output_variations
,
False
)
write_line
(
line
,
output_variations
,
False
)
elif
variation
.
type
==
'
deletion
'
:
elif
variation
.
type
==
'
deletion
'
:
[
pos_old
,
pos_new
]
=
get_old_new_pos_deletion
(
variation
,
feat_start
,
list_segfeat_azu
,
feat
,
i
)
[
pos_old
,
pos_new
]
=
get_old_new_pos_deletion
(
variation
,
feat_start
,
list_segfeat_azu
,
feat
)
line
=
f
'
{
variation
.
feature_id
}
\t
{
variation
.
feature_type
}
\t
{
variation
.
chr
}
\t
{
variation
.
start_new
}
\t
{
variation
.
stop_new
}
\t
{
variation
.
size_new
}
\t
{
variation
.
inversion
}
\t
{
variation
.
size_diff
}
\t
deletion
\t
{
variation
.
ref
}
\t
-
\t
{
len
(
variation
.
ref
)
}
\t
{
pos_old
}
\t
{
pos_new
}{
warning
}
\n
'
line
=
f
'
{
variation
.
feature_id
}
\t
{
variation
.
feature_type
}
\t
{
variation
.
chr
}
\t
{
variation
.
start_new
}
\t
{
variation
.
stop_new
}
\t
{
variation
.
size_new
}
\t
{
variation
.
inversion
}
\t
{
variation
.
size_diff
}
\t
deletion
\t
{
variation
.
ref
}
\t
-
\t
{
len
(
variation
.
ref
)
}
\t
{
pos_old
}
\t
{
pos_new
}{
warning
}
\n
'
write_line
(
line
,
output_variations
,
False
)
write_line
(
line
,
output_variations
,
False
)
elif
variation
.
type
==
'
substitution
'
:
elif
variation
.
type
==
'
substitution
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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