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
41d71199
Commit
41d71199
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Allow $translation->transcript(undef) to break connection to
translation's transcript.
parent
396d940c
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/Translation.pm
+9
-9
9 additions, 9 deletions
modules/Bio/EnsEMBL/Translation.pm
with
9 additions
and
9 deletions
modules/Bio/EnsEMBL/Translation.pm
+
9
−
9
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
'};
...
...
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