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
41d71199
Commit
41d71199
authored
Aug 27, 2010
by
Andreas Kusalananda Kähäri
Browse files
Allow $translation->transcript(undef) to break connection to
translation's transcript.
parent
396d940c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
modules/Bio/EnsEMBL/Translation.pm
modules/Bio/EnsEMBL/Translation.pm
+9
-9
No files found.
modules/Bio/EnsEMBL/Translation.pm
View file @
41d71199
...
...
@@ -56,6 +56,7 @@ use Scalar::Util qw(weaken);
use
Bio::EnsEMBL::Utils::
Exception
qw( deprecate throw warning )
;
use
Bio::EnsEMBL::Utils::
Argument
qw( rearrange )
;
use
Bio::EnsEMBL::Utils::
Scalar
qw( assert_ref )
;
use
Bio::EnsEMBL::
Storable
;
...
...
@@ -153,16 +154,15 @@ sub transcript {
my
(
$self
,
$transcript
)
=
@_
;
if
(
defined
(
$transcript
)
)
{
if
(
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
assert_ref
(
$transcript
,
'
Bio::EnsEMBL::Transcript
'
);
$self
->
{'
transcript
'}
=
$transcript
;
weaken
(
$self
->
{'
transcript
'}
);
# Avoid circular references.
}
elsif
(
@
_
>
1
)
{
# Break connection to transcript.
delete
(
$self
->
{'
transcript
'}
);
}
elsif
(
!
defined
(
$self
->
{'
transcript
'}
)
)
{
my
$adaptor
=
$self
->
{'
adaptor
'};
if
(
!
defined
(
$adaptor
)
)
{
...
...
@@ -180,10 +180,10 @@ sub transcript {
$adaptor
->
db
()
->
get_TranscriptAdaptor
()
->
fetch_by_translation_id
(
$dbID
);
# Do not weaken the reference if we had to get the transcript from the
# database. The user is probably working on translations directly,
# not going through transcripts.
#weaken( $self->{'transcript'} ); # Avoid circular references.
# Do not weaken the reference if we had to get the transcript from the
# database. The user is probably working on translations directly,
# not going through transcripts.
#weaken( $self->{'transcript'} ); # Avoid circular references.
}
return
$self
->
{'
transcript
'};
...
...
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