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
ef3f3c24
Commit
ef3f3c24
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Be more careful in transcript().
Simplify cdna_start() and cdna_end() by use of transcript().
parent
7c459cc0
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
+44
-53
44 additions, 53 deletions
modules/Bio/EnsEMBL/Translation.pm
with
44 additions
and
53 deletions
modules/Bio/EnsEMBL/Translation.pm
+
44
−
53
View file @
ef3f3c24
...
...
@@ -143,10 +143,15 @@ sub transcript {
my
(
$self
,
$transcript
)
=
@_
;
if
(
defined
(
$transcript
)
)
{
if
(
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
{
throw
("
Argument is not a transcript
");
}
$self
->
{'
transcript
'}
=
$transcript
;
weaken
(
$self
->
{'
transcript
'});
weaken
(
$self
->
{'
transcript
'}
);
}
elsif
(
!
defined
(
$self
->
{'
transcript
'}
)
)
{
my
$adaptor
=
$self
->
{'
adaptor
'};
...
...
@@ -165,11 +170,11 @@ sub transcript {
$adaptor
->
db
()
->
get_TranscriptAdaptor
()
->
fetch_by_translation_id
(
$dbID
);
weaken
(
$self
->
{'
transcript
'});
weaken
(
$self
->
{'
transcript
'}
);
}
return
$self
->
{'
transcript
'};
}
}
## end sub transcript
=head2 start
...
...
@@ -302,35 +307,28 @@ sub end_Exon {
=cut
sub
cdna_start
{
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
defined
$transcript
&&
(
!
ref
$transcript
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
)
{
throw
("
Argument is not a transcript
");
}
if
(
!
exists
$self
->
{'
cdna_start
'}
)
{
if
(
!
defined
$transcript
)
{
# We were not given a transcript, get the transcript out of
# the database.
my
$transcript_adaptor
=
$self
->
adaptor
()
->
db
()
->
get_TranscriptAdaptor
();
my
(
$self
,
$transcript
)
=
@_
;
$transcript
=
$transcript_adaptor
->
fetch_by_translation_id
(
$self
->
dbID
()
);
}
if
(
defined
(
$transcript
)
&&
(
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
)
{
throw
("
Argument is not a transcript
");
}
$self
->
{'
cdna_start
'}
=
$self
->
start_Exon
()
->
cdna_coding_start
(
$transcript
);
if
(
!
exists
(
$self
->
{'
cdna_start
'}
)
)
{
if
(
!
defined
(
$transcript
)
)
{
# We were not given a transcript, get the transcript out of
# the database.
$transcript
=
$self
->
transcript
();
}
return
$self
->
{'
cdna_start
'};
}
## end sub cdna_start
$self
->
{'
cdna_start
'}
=
$self
->
start_Exon
()
->
cdna_coding_start
(
$transcript
);
}
return
$self
->
{'
cdna_start
'};
}
=head2 cdna_end
...
...
@@ -351,35 +349,28 @@ sub cdna_start {
=cut
sub
cdna_end
{
my
$self
=
shift
;
my
(
$transcript
)
=
@_
;
if
(
defined
$transcript
&&
(
!
ref
$transcript
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
)
{
throw
("
Argument is not a transcript
");
}
if
(
!
exists
$self
->
{'
cdna_end
'}
)
{
if
(
!
defined
$transcript
)
{
# We were not given a transcript, get the transcript out of
# the database.
my
$transcript_adaptor
=
$self
->
adaptor
()
->
db
()
->
get_TranscriptAdaptor
();
my
(
$self
,
$transcript
)
=
@_
;
$transcript
=
$transcript_adaptor
->
fetch_by_translation_id
(
$self
->
dbID
()
);
}
if
(
defined
(
$transcript
)
&&
(
!
ref
(
$transcript
)
||
!
$transcript
->
isa
('
Bio::EnsEMBL::Transcript
')
)
)
{
throw
("
Argument is not a transcript
");
}
$self
->
{'
cdna_end
'}
=
$self
->
end_Exon
()
->
cdna_coding_end
(
$transcript
);
if
(
!
exists
(
$self
->
{'
cdna_end
'}
)
)
{
if
(
!
defined
(
$transcript
)
)
{
# We were not given a transcript, get the transcript out of
# the database.
$transcript
=
$self
->
transcript
();
}
return
$self
->
{'
cdna_end
'};
}
## end sub cdna_end
$self
->
{'
cdna_end
'}
=
$self
->
end_Exon
()
->
cdna_coding_end
(
$transcript
);
}
return
$self
->
{'
cdna_end
'};
}
=head2 genomic_start
...
...
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