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
f900c6e4
Commit
f900c6e4
authored
1 year ago
by
nina.marthe_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
modified the output of the variations affecting the start codon
parent
35e00a52
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inference.py
+11
-8
11 additions, 8 deletions
inference.py
with
11 additions
and
8 deletions
inference.py
+
11
−
8
View file @
f900c6e4
...
@@ -154,7 +154,10 @@ def traduction(sequence_arn): # translate rna
...
@@ -154,7 +154,10 @@ def traduction(sequence_arn): # translate rna
list_codons
=
cut_codon
(
sequence_arn
)
list_codons
=
cut_codon
(
sequence_arn
)
prot
=
list
()
prot
=
list
()
for
codon
in
list_codons
:
for
codon
in
list_codons
:
prot
.
append
(
get_aa
(
codon
))
if
len
(
codon
)
==
3
:
prot
.
append
(
get_aa
(
codon
))
else
:
print
(
"
attempt to get the amino acid for an incomplete codon
"
)
return
prot
return
prot
def
get_sequence_on_genome
(
feature
,
segments_on_target_genome
):
# returns the sequence of the feature on the target genome
def
get_sequence_on_genome
(
feature
,
segments_on_target_genome
):
# returns the sequence of the feature on the target genome
...
@@ -242,7 +245,6 @@ def print_variation_change(deleted_sequence,inserted_sequence): # print the cons
...
@@ -242,7 +245,6 @@ def print_variation_change(deleted_sequence,inserted_sequence): # print the cons
return
stop
return
stop
[
paths
,
seg_seq
]
=
get_segments_sequence_and_paths
(
gfa
)
[
paths
,
seg_seq
]
=
get_segments_sequence_and_paths
(
gfa
)
segments_on_target_genome
=
get_segments_positions_on_genome
(
pos_seg
)
segments_on_target_genome
=
get_segments_positions_on_genome
(
pos_seg
)
cds_var
=
get_cds_variations
(
var_file
)
cds_var
=
get_cds_variations
(
var_file
)
...
@@ -253,7 +255,7 @@ for feature in Features.values(): # add the sequence of all features
...
@@ -253,7 +255,7 @@ for feature in Features.values(): # add the sequence of all features
# analysing the variations for all the cds :
# analysing the variations for all the cds :
for
cds_id
in
cds_var
.
keys
():
for
cds_id
in
cds_var
.
keys
():
cds
=
Features
[
cds_id
]
cds
=
Features
[
cds_id
]
print
(
"
analysis of the variations in the CDS
"
,
cds_id
,
"
\n
"
)
print
(
"
analysis of the variations in the CDS
"
,
cds_id
,
"
:
\n
"
)
frame_shift
=
0
frame_shift
=
0
for
index
,
var
in
enumerate
(
cds_var
[
cds_id
]):
# for each variation in the current cds :
for
index
,
var
in
enumerate
(
cds_var
[
cds_id
]):
# for each variation in the current cds :
type_var
=
var
[
8
]
type_var
=
var
[
8
]
...
@@ -271,6 +273,11 @@ for cds_id in cds_var.keys():
...
@@ -271,6 +273,11 @@ for cds_id in cds_var.keys():
length_alt
=
len
(
var
[
10
])
length_alt
=
len
(
var
[
10
])
print
(
"
variation
"
,
index
,
"
:
"
)
print
(
"
variation
"
,
index
,
"
:
"
)
if
posVar
[
0
]
<=
3
:
print
(
"
variation of the start codon, mRNA most likely wont be translated
"
)
#findOtherStart(cds,segments_on_target_genome) # for now we don't look for another start codon
break
if
abs
(
length_alt
-
length_ref
)
%
3
==
0
:
# size diff 3k -> no frame shift.
if
abs
(
length_alt
-
length_ref
)
%
3
==
0
:
# size diff 3k -> no frame shift.
...
@@ -311,7 +318,6 @@ for cds_id in cds_var.keys():
...
@@ -311,7 +318,6 @@ for cds_id in cds_var.keys():
# possible that it prints too many variations : for ex if we have a snp on the first and the last base of a codon,
# possible that it prints too many variations : for ex if we have a snp on the first and the last base of a codon,
# while printing the effect of the first snp we aso use the second one.
# while printing the effect of the first snp we aso use the second one.
else
:
# size diff !=3k
else
:
# size diff !=3k
print
(
"
frameshift variation
"
)
print
(
"
frameshift variation
"
)
old_frameshift
=
frame_shift
old_frameshift
=
frame_shift
...
@@ -373,9 +379,6 @@ for cds_id in cds_var.keys():
...
@@ -373,9 +379,6 @@ for cds_id in cds_var.keys():
if
stop
:
if
stop
:
break
break
if
posVar
[
0
]
<=
3
:
print
(
"
start codon affected, mRNA most likely wont be translated
"
)
#findOtherStart(cds,segments_on_target_genome) # for now we don't look for another start codon
break
print
(
"
\n
"
)
print
(
"
\n
"
)
\ No newline at end of file
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