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
e1e3fc04
Commit
e1e3fc04
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Use assert_ref() in canonical_transcript() to clean it up a bit.
In load(): also load the canonical transcript.
parent
2073a424
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/Gene.pm
+8
-14
8 additions, 14 deletions
modules/Bio/EnsEMBL/Gene.pm
with
8 additions
and
14 deletions
modules/Bio/EnsEMBL/Gene.pm
+
8
−
14
View file @
e1e3fc04
...
@@ -57,6 +57,7 @@ use POSIX;
...
@@ -57,6 +57,7 @@ use POSIX;
use
Bio::EnsEMBL::
Feature
;
use
Bio::EnsEMBL::
Feature
;
use
Bio::EnsEMBL::Utils::
Argument
qw(rearrange)
;
use
Bio::EnsEMBL::Utils::
Argument
qw(rearrange)
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw warning deprecate)
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw warning deprecate)
;
use
Bio::EnsEMBL::Utils::
Scalar
qw(assert_ref)
;
use
vars
qw(@ISA)
;
use
vars
qw(@ISA)
;
@ISA
=
qw(Bio::EnsEMBL::Feature)
;
@ISA
=
qw(Bio::EnsEMBL::Feature)
;
...
@@ -369,19 +370,13 @@ sub canonical_transcript {
...
@@ -369,19 +370,13 @@ sub canonical_transcript {
if
(
defined
(
$transcript
)
)
{
if
(
defined
(
$transcript
)
)
{
# We're attaching a new canonical transcript.
# We're attaching a new canonical transcript.
if
(
assert_ref
(
$transcript
,
'
Bio::EnsEMBL::Transcript
'
);
!
(
ref
(
$transcript
)
&&
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
)
{
throw
('
Argument must be a Bio::EnsEMBL::Transcript
');
}
$self
->
{'
canonical_transcript
'}
=
$transcript
;
$self
->
{'
canonical_transcript
'}
=
$transcript
;
$self
->
{'
canonical_transcript_id
'}
=
$transcript
->
dbID
();
$self
->
{'
canonical_transcript_id
'}
=
$transcript
->
dbID
();
}
elsif
(
!
defined
(
$self
->
{'
canonical_transcript
'}
)
}
elsif
(
!
defined
(
$self
->
{'
canonical_transcript
'}
)
&&
defined
(
$self
->
{'
canonical_transcript_id
'}
)
)
&&
defined
(
$self
->
{'
canonical_transcript_id
'}
)
)
{
{
# We have not attached a canoncical transcript, but we have the dbID
# We have not attached a canoncical transcript, but we have the dbID
# of one.
# of one.
...
@@ -392,10 +387,10 @@ sub canonical_transcript {
...
@@ -392,10 +387,10 @@ sub canonical_transcript {
$self
->
{'
canonical_transcript
'}
=
$self
->
{'
canonical_transcript
'}
=
$transcript_adaptor
->
fetch_by_dbID
(
$transcript_adaptor
->
fetch_by_dbID
(
$self
->
{'
canonical_transcript_id
'}
);
$self
->
{'
canonical_transcript_id
'}
);
}
else
{
}
else
{
warning
(
"
Gene has no adaptor
"
warning
(
"
Gene has no adaptor
"
.
"
when trying to fetch canonical transcript.
"
);
.
"
when trying to fetch canonical transcript.
"
);
}
}
}
}
...
@@ -422,8 +417,6 @@ sub canonical_annotation {
...
@@ -422,8 +417,6 @@ sub canonical_annotation {
return
$self
->
{'
canonical_annotation
'};
return
$self
->
{'
canonical_annotation
'};
}
}
=head2 get_all_Attributes
=head2 get_all_Attributes
Arg [1] : (optional) String $attrib_code
Arg [1] : (optional) String $attrib_code
...
@@ -1259,6 +1252,7 @@ sub load {
...
@@ -1259,6 +1252,7 @@ sub load {
$self
->
analysis
();
$self
->
analysis
();
$self
->
get_all_Attributes
();
$self
->
get_all_Attributes
();
$self
->
stable_id
();
$self
->
stable_id
();
$self
->
canonical_transcript
();
if
(
$load_xrefs
)
{
if
(
$load_xrefs
)
{
$self
->
get_all_DBEntries
();
$self
->
get_all_DBEntries
();
...
...
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