Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
e14ef411
Commit
e14ef411
authored
Apr 20, 2010
by
Andreas Kusalananda Kähäri
Browse files
Only keep track of the translations that are actually alternative in
get_all_alternative_translations().
parent
3070b006
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
modules/Bio/EnsEMBL/Transcript.pm
modules/Bio/EnsEMBL/Transcript.pm
+21
-8
No files found.
modules/Bio/EnsEMBL/Transcript.pm
View file @
e14ef411
...
...
@@ -616,7 +616,7 @@ sub translation {
transcript. The canonical translation is not returned.
Returntype : Array reference to Bio::EnsEMBL::Translation
Exceptions :
None
Exceptions :
Throws if no adaptor is attached.
Caller : General
Status : Stable
...
...
@@ -625,16 +625,29 @@ sub translation {
sub
get_all_alternative_translations
{
my
(
$self
)
=
@_
;
if
(
!
defined
(
$self
->
{'
alternative_translations
'}
)
&&
defined
(
$self
->
adaptor
()
)
)
{
my
$pa
=
$self
->
adaptor
()
->
db
()
->
get_TranslationAdaptor
();
$self
->
{'
alternative_translations
'}
=
$pa
->
fetch_all_by_Transcript
(
$self
);
my
$canonical_translation
=
$self
->
translation
();
if
(
!
defined
(
$canonical_translation
)
)
{
return
[]
}
if
(
!
defined
(
$self
->
{'
alternative_translations
'}
)
)
{
if
(
!
defined
(
$self
->
adaptor
()
)
)
{
throw
("
No adaptor attached
");
}
my
$pa
=
$self
->
adaptor
()
->
db
()
->
get_TranslationAdaptor
();
my
@translations
=
@
{
$pa
->
fetch_all_by_Transcript
(
$self
)
};
foreach
my
$translation
(
@translations
)
{
if
(
$translation
->
dbID
()
==
$canonical_translation
->
dbID
()
)
{
next
;
}
push
(
@
{
$self
->
{'
alternative_translations
'}
},
$translation
);
}
}
return
$self
->
{'
alternative_translations
'};
}
}
## end sub get_all_alternative_translations
=head2 add_alternative_translation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment