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
2e40748e
Commit
2e40748e
authored
1 year ago
by
nina.marthe_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
corrigé la détection du codon en amont touché par l'indel pour les indel au milieu d'un codon
parent
b5415f39
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
inference.py
+20
-20
20 additions, 20 deletions
inference.py
with
20 additions
and
20 deletions
inference.py
+
20
−
20
View file @
2e40748e
...
...
@@ -71,7 +71,7 @@ def get_first_seg(list_seg,segments_on_target_genome):
return
first_seg_found
def
get_feature_path
(
paths
,
first_seg
,
last_seg
):
# find the path in
azucena.
# find the path in
the target genome
first_strand
=
convert_strand
(
segments_on_target_genome
[
first_seg
][
3
])
first_seg_stranded
=
first_strand
+
first_seg
last_strand
=
convert_strand
(
segments_on_target_genome
[
last_seg
][
3
])
...
...
@@ -308,10 +308,9 @@ for cds_id in cds_var.keys():
length_alt
=
len
(
var
[
10
])
if
abs
(
length_alt
-
length_ref
)
%
3
==
0
:
# taille diff 3k -> pas de frame shift.
print
(
"
pas de frame shift
"
)
if
pos_var
%
3
==
0
:
# position 3k
print
(
"
variation entre deux codons
"
)
print
(
"
variation entre deux codons
sans décalage du cadre de lecture
"
)
if
length_ref
%
3
==
0
:
# taille 3K -> pas d'impact sur l'aa en aval
deleted_aa
=
traduction
(
get_rna
(
var
[
9
]))
...
...
@@ -353,28 +352,29 @@ for cds_id in cds_var.keys():
print
(
"
changement de
"
,
"
,
"
.
join
(
deleted_aa
),
"
en
"
,
"
,
"
.
join
(
inserted_aa
))
else
:
# position !=3k, taille diff 3k
print
(
"
variation au milieu d
'
un codon
uuu
"
)
print
(
"
variation au milieu d
'
un codon
sans décalage du cadre de lecture
"
)
# récupérer le codon dans lequel on a inséré, le prendre en compte pour calculer les effets
# récupérer le
début du
codon dans lequel on a inséré, le prendre en compte pour calculer les effets
posVar_on_ref
=
int
(
var
[
12
])
reste_avant_len
=
(
posVar_on_ref
-
1
)
%
3
fin
_aa_avant
=
cds
.
sequence
[
posVar_on_ref
-
reste_avant_len
-
1
:
posVar_on_ref
-
1
]
print
(
fin
_aa_avant
)
complete
_avant_len
=
3
-
reste_avant_len
if
len
(
var
[
9
]
>=
complete
_avant_len
):
aa_modifie_
avant
=
fin_aa_avant
+
var
[
9
][
0
:
complete_avant_len
]
# else il faut aller chercher dans le segment d'apres !! max un apres pcq min 1 base par segment (avant=1min, var=1min, apres=1min.)
reste_
aa_
avant_len
=
(
posVar_on_ref
-
1
)
%
3
debut
_aa_avant
=
cds
.
sequence
[
posVar_on_ref
-
reste_
aa_
avant_len
-
1
:
posVar_on_ref
-
1
]
print
(
debut
_aa_avant
)
fin_aa
_avant_len
=
3
-
reste_
aa_
avant_len
aa_modifie_origin
=
debut_aa_avant
+
var
[
9
][
0
:
fin_aa
_avant_len
]
if
len
(
aa_modifie_
origin
)
<
3
:
# on va chercher la base manquante apres la var
aa_modifie_origin
+=
cds
.
sequence
[
posVar_on_ref
-
1
+
length_ref
]
if
len
(
var
[
10
])
>=
complete_avant_len
:
aa_modifie_apres
=
fin_aa_avant
+
var
[
10
][
0
:
complete_avant_len
]
print
(
aa_modifie_avant
,
aa_modifie_apres
)
# else il faut aller chercher dans le segment d'apres !! max un apres pcq min 1 base par segment (avant=1min, var=1min, apres=1min.)
aa_modifie_target
=
debut_aa_avant
+
var
[
10
][
0
:
fin_aa_avant_len
]
if
len
(
aa_modifie_target
)
<
3
:
# on va chercher la base manquante apres la var dans la séquence target
aa_modifie_target
+=
get_sequence_on_genome
(
cds_id
,
segments_on_target_genome
)[
int
(
var
[
13
])]
print
(
aa_modifie_origin
,
aa_modifie_target
)
# touche le codon d'avant
# touche le codon d'apres ? pas si reste_avant_len + taille_var%3 =3
if
reste_avant_len
+
(
length_ref
%
3
)
==
3
:
# touche le codon d'apres ? pas si reste_
aa_
avant_len + taille_var%3 =3
if
reste_
aa_
avant_len
+
(
length_ref
%
3
)
==
3
:
# modifie l'aa dans lequel on a inséré+délété, puis éventuellement insere ou delete
# ne modifie pas l'aa d'après.
a
=
1
...
...
@@ -384,7 +384,7 @@ for cds_id in cds_var.keys():
else
:
# taille diff !=3k
print
(
"
frame shift
"
)
print
(
"
décalage du cadre de lecture
"
)
frame_shift
=
(
frame_shift
+
abs
(
length_alt
-
length_ref
))
%
3
# cas en plus : modif de la première base du codon et de la troisième : comment prendre en compte ces deux modif pour le changement de l'aa?
...
...
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