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
3998c84f
Commit
3998c84f
authored
1 year ago
by
nina.marthe_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
supprimé du vieux code inutilisé
parent
1f3fd17b
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
+1
-95
1 addition, 95 deletions
inference.py
with
1 addition
and
95 deletions
inference.py
+
1
−
95
View file @
3998c84f
...
@@ -274,6 +274,7 @@ def findOtherStart(cds,segments_on_target_genome):
...
@@ -274,6 +274,7 @@ def findOtherStart(cds,segments_on_target_genome):
start_pos_list
=
[
m
.
start
()
for
m
in
re
.
finditer
(
'
(?=ATG)
'
,
seq_cds
)]
start_pos_list
=
[
m
.
start
()
for
m
in
re
.
finditer
(
'
(?=ATG)
'
,
seq_cds
)]
print
(
"
codon start candidat trouvé plus loin dans le cds, à la base
"
,
start_pos_list
[
0
])
# print seulement le premier
print
(
"
codon start candidat trouvé plus loin dans le cds, à la base
"
,
start_pos_list
[
0
])
# print seulement le premier
print
(
"
\n
"
)
print
(
"
\n
"
)
return
frame_shift
version
=
"
new
"
version
=
"
new
"
...
@@ -375,98 +376,3 @@ for cds_id in cds_var.keys():
...
@@ -375,98 +376,3 @@ for cds_id in cds_var.keys():
print
(
"
\n
"
)
print
(
"
\n
"
)
if
version
==
"
old
"
:
for
cds_id
in
cds_var
.
keys
():
# for a gene that has cds, concatenate all cds to make a prot. then detail var by cds.
cds
=
Features
[
cds_id
]
print
(
"
analysing variations in cds
"
,
cds_id
)
add_feature_sequence
(
cds
,
seg_seq
)
cds_prot
=
traduction
(
get_rna
(
cds
.
sequence
))
list_seg
=
Features
[
cds_id
].
segments_list
first_seg
=
get_first_seg
(
list_seg
)
last_seg
=
get_first_seg
(
reversed
(
list_seg
))
path_on_target
=
get_feature_path
(
paths
,
first_seg
,
last_seg
)
new_sequence
=
""
for
segment
in
path_on_target
:
if
segment
==
cds
.
segments_list
[
0
]:
new_sequence
+=
get_segment_sequence
(
seg_seq
,
segment
)[
cds
.
pos_start
-
1
:]
elif
segment
==
cds
.
segments_list
[
-
1
]:
new_sequence
+=
get_segment_sequence
(
seg_seq
,
segment
)[
0
:
cds
.
pos_stop
]
else
:
new_sequence
+=
get_segment_sequence
(
seg_seq
,
segment
)
new_prot
=
traduction
(
get_rna
(
new_sequence
))
print
(
"
original prot =
"
,
cds_prot
)
print
(
"
new prot =
"
,
new_prot
)
# print new version with new start and stop codons of deleted. (before and after the gene sequence)
if
new_prot
[
0
]
!=
"
Met
"
:
print
(
"
no Met at the start of the new version of the protein -> start codon loss
"
)
if
"
Met
"
in
new_prot
:
print
(
"
Met found at position
"
,
(
new_prot
.
index
(
"
Met
"
)
+
1
),
"
-> possible later start codon
"
)
# print cette version de la prot
print
(
"
look for start codon before. if none, print
'
no start codon, likely gene not active
'"
)
# récupérer n pb avant, les traduire, chercher la dernière Met (list[::-1].index("Met")), donner cette version de la prot
sequence_before
=
get_sequence_before
(
path_on_target
[
0
],
seg_seq
,
100
,
paths
,
cds
)
print
(
sequence_before
)
first_stop_index
=
new_prot
.
index
(
"
*
"
)
if
"
*
"
in
new_prot
else
"
None
"
if
"
*
"
not
in
new_prot
:
print
(
"
no stop codon
"
)
# récupérer n pb après, les traduire, chercher le premier *, donner cette version de la prot.
elif
first_stop_index
+
1
!=
len
(
new_prot
):
print
(
"
early stop codon at position
"
,(
first_stop_index
+
1
),
"
instead of
"
,
len
(
new_prot
))
else
:
print
(
"
stop codon found at expected position
"
)
sequence_after
=
get_sequence_after
(
path_on_target
[
-
1
],
seg_seq
,
100
,
paths
,
cds
)
print
(
sequence_after
)
for
var
in
cds_var
[
cds_id
]:
#print("\n",var)
size_var
=
int
(
var
[
11
])
type_var
=
var
[
8
]
pos_var
=
int
(
var
[
12
])
-
1
if
type_var
==
"
insertions
"
:
sequence_var
=
var
[
10
]
if
size_var
%
3
==
0
:
print
(
"
pas de décalage du cadre de lecture
"
)
trad_seq_ins
=
traduction
(
get_rna
(
sequence_var
))
if
pos_var
%
3
==
0
:
print
(
"
insertion entre deux codons
"
)
if
"
*
"
in
trad_seq_ins
:
print
(
"
apparition d
'
un codon stop
"
)
print
(
f
'
ancienne sequence :
{
"
,
"
.
join
(
cds_prot
)
}
'
)
print
(
f
'
nouvelle sequence :
{
"
,
"
.
join
(
cds_prot
[
0
:
(
pos_var
//
3
)
-
1
])
}
, *
'
)
else
:
print
(
f
'
ancienne sequence :
{
"
,
"
.
join
(
cds_prot
)
}
'
)
print
(
f
'
{
type_var
}
de
{
size_var
//
3
}
acides amines
{
"
,
"
.
join
(
trad_seq_ins
)
}
à la position
{
pos_var
//
3
}
'
)
else
:
print
(
"
insertion au milieu d
'
un codon, changement de certains acides amines
"
)
elif
type_var
==
"
deletions
"
:
sequence_var
=
line
[
9
]
if
size_var
%
3
==
0
:
print
(
"
pas de décalage du cadre de lecture
"
)
trad_seq_ins
=
traduction
(
get_rna
(
sequence_var
))
if
pos_var
%
3
==
0
:
print
(
"
deletion de codons entiers
"
)
if
"
*
"
in
trad_seq_ins
:
print
(
"
disparition d
'
un codon stop
"
)
else
:
print
(
f
'
ancienne sequence :
{
"
,
"
.
join
(
cds_prot
)
}
'
)
print
(
f
'
{
type_var
}
de
{
size_var
//
3
}
acides amines
{
"
,
"
.
join
(
trad_seq_ins
)
}
à la position
{
pos_var
//
3
}
'
)
else
:
print
(
"
deletion au milieu d
'
un codon, changement de certains acides amines
"
)
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