Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
51ef7f8b
Commit
51ef7f8b
authored
14 years ago
by
Graham Ritchie
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug with missing stop codons
parent
0b4816bd
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
modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm
+42
-23
42 additions, 23 deletions
modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm
with
42 additions
and
23 deletions
modules/Bio/EnsEMBL/Utils/TranscriptAlleles.pm
+
42
−
23
View file @
51ef7f8b
...
...
@@ -261,7 +261,7 @@ sub type_variation {
#empty type first in the case of recursive call
$var
->
empty_type
if
defined
$var
->
type
;
if
(
!
$var
->
isa
('
Bio::EnsEMBL::Variation::ConsequenceType
')){
if
(
!
$var
->
isa
('
Bio::EnsEMBL::Variation::ConsequenceType
'))
{
throw
("
Not possible to calculate the consequence type for
",
ref
(
$var
),"
: Bio::EnsEMBL::Variation::ConsequenceType object expected
");
}
...
...
@@ -274,19 +274,34 @@ sub type_variation {
# check the cache
my
$tran_features
=
$tr
->
{
_variation_effect_feature_cache
};
# populate it if not found
# populate it if not found
unless
(
$tran_features
)
{
if
(
$tran_features
->
{
translation
}
=
$tr
->
translate
)
{
$tran_features
=
{
mapper
=>
$tr
->
get_TranscriptMapper
,
};
my
(
$attrib
)
=
@
{
$tr
->
slice
()
->
get_all_Attributes
('
codon_table
')};
#for mithocondrial dna it is necessary to change the table
my
$codon_table
;
$codon_table
=
$attrib
->
value
()
if
(
$attrib
);
$codon_table
||=
1
;
# default vertebrate codon table
if
(
$tran_features
->
{
translation
}
=
$tr
->
translate
(
undef
,
undef
,
undef
,
$codon_table
))
{
$tran_features
->
{
translateable_seq
}
=
$tr
->
translateable_seq
;
$tran_features
->
{
peptide
}
=
$tran_features
->
{
translation
}
->
seq
;
# to include the stop codon we need to translate the Bio::Seq sequence, not just
# $tr->translation, this is the source of the missing STOP_LOSTs
my
$mrna_seqobj
=
Bio::
Seq
->
new
(
-
seq
=>
$tran_features
->
{
translateable_seq
},
-
moltype
=>
'
dna
',
-
alphabet
=>
'
dna
'
);
$tran_features
->
{
peptide
}
=
$mrna_seqobj
->
translate
(
undef
,
undef
,
undef
,
$codon_table
)
->
seq
;
}
$tran_features
->
{
mapper
}
=
$tr
->
get_TranscriptMapper
;
$tran_features
->
{
introns
}
=
$tr
->
get_all_Introns
,
$tr
->
{
_variation_effect_feature_cache
}
=
$tran_features
;
}
if
(
!
defined
(
$tran_features
->
{
translation
}
)
)
{
# for other biotype rather than coding/IG genes
...
...
@@ -565,6 +580,12 @@ sub apply_aa_change {
my
$tr
=
shift
;
my
$var
=
shift
;
my
(
$attrib
)
=
@
{
$tr
->
slice
()
->
get_all_Attributes
('
codon_table
')};
#for mithocondrial dna it is necessary to change the table
my
$codon_table
;
$codon_table
=
$attrib
->
value
()
if
(
$attrib
);
$codon_table
||=
1
;
# default vertebrate codon table
# check the cache
my
$tran_features
=
$tr
->
{
_variation_effect_feature_cache
};
...
...
@@ -573,30 +594,28 @@ sub apply_aa_change {
$tran_features
=
{
mapper
=>
$tr
->
get_TranscriptMapper
,
};
if
(
$tran_features
->
{
translation
}
=
$tr
->
translate
)
{
if
(
$tran_features
->
{
translation
}
=
$tr
->
translate
(
undef
,
undef
,
undef
,
$codon_table
)
)
{
$tran_features
->
{
translateable_seq
}
=
$tr
->
translateable_seq
;
$tran_features
->
{
peptide
}
=
$tran_features
->
{
translation
}
->
seq
;
# to include the stop codon we need to translate the Bio::Seq sequence, not just
# $tr->translation, this is the source of the missing STOP_LOSTs
my
$mrna_seqobj
=
Bio::
Seq
->
new
(
-
seq
=>
$tran_features
->
{
translateable_seq
},
-
moltype
=>
'
dna
',
-
alphabet
=>
'
dna
'
);
$tran_features
->
{
peptide
}
=
$mrna_seqobj
->
translate
(
undef
,
undef
,
undef
,
$codon_table
)
->
seq
;
}
$tr
->
{
_variation_effect_feature_cache
}
=
$tran_features
;
}
#my $peptide = $tr->translate->seq();
#to consider stop codon as well
my
$mrna
=
$tran_features
->
{
translateable_seq
};
# get from cache
my
$mrna_seqobj
=
Bio::
Seq
->
new
(
-
seq
=>
$mrna
,
-
moltype
=>
"
dna
",
-
alphabet
=>
"
dna
");
my
(
$attrib
)
=
@
{
$tr
->
slice
()
->
get_all_Attributes
('
codon_table
')};
#for mithocondrial dna it is necessary to change the table
my
$codon_table
;
$codon_table
=
$attrib
->
value
()
if
(
$attrib
);
$codon_table
||=
1
;
# default vertebrate codon table
my
$peptide
=
$tran_features
->
{
peptide
};
# get from cache
my
$len
=
$var
->
aa_end
-
$var
->
aa_start
+
1
;
my
$old_aa
=
substr
(
$peptide
,
$var
->
aa_start
-
1
,
$len
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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