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
003be45e
Commit
003be45e
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
check exon sequences and warn if they are not retrieved
parent
8d55aaa6
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/Transcript.pm
+49
-27
49 additions, 27 deletions
modules/Bio/EnsEMBL/Transcript.pm
with
49 additions
and
27 deletions
modules/Bio/EnsEMBL/Transcript.pm
+
49
−
27
View file @
003be45e
...
...
@@ -372,10 +372,18 @@ sub translation {
sub
spliced_seq
{
my
(
$self
)
=
@_
;
my
$seq_string
=
"";
for
my
$ex
(
@
{
$self
->
get_all_Exons
()}
)
{
$seq_string
.=
$ex
->
seq
()
->
seq
();
my
$seq
=
$ex
->
seq
();
if
(
!
$seq
)
{
warning
("
Could not obtain seq for exon. Transcript sequence may not
"
.
"
be correct.
");
$seq_string
.=
'
N
'
x
$ex
->
length
();
}
else
{
$seq_string
.=
$seq
->
seq
();
}
}
return
$seq_string
;
...
...
@@ -412,7 +420,7 @@ sub translateable_seq {
if
(
defined
(
$exon
->
phase
))
{
$phase
=
$exon
->
phase
;
}
# startpadding is needed if MONKEY_EXONS are on
if
(
$first
&&
(
!
defined
$ENV
{'
MONKEY_EXONS
'})
)
{
$mrna
.=
'
N
'
x
$phase
;
...
...
@@ -429,7 +437,17 @@ sub translateable_seq {
#startpadding for this exon
$mrna
.=
'
N
'
x
$phase
;
}
$mrna
.=
$exon
->
seq
->
seq
();
my
$seq
=
$exon
->
seq
();
# if there is an error in the exon (e.g. strand not set or no slice)
# no seq object will be returned by exon->seq
if
(
!
$seq
)
{
warning
("
Could not get exon sequence. Resultant translation may be
"
.
"
incorrect.
");
$mrna
.=
'
N
'
x
$exon
->
length
();
}
else
{
$mrna
.=
$seq
->
seq
();
}
$lastphase
=
$exon
->
end_phase
();
}
return
$mrna
;
...
...
@@ -467,12 +485,12 @@ sub cdna_coding_start {
while
(
$exon
=
shift
@exons
)
{
if
(
$exon
==
$self
->
translation
->
start_Exon
)
{
#add the utr portion of the start exon
$start
+=
$self
->
translation
->
start
;
last
;
#add the utr portion of the start exon
$start
+=
$self
->
translation
->
start
;
last
;
}
else
{
#add the entire length of this non-coding exon
$start
+=
$exon
->
length
;
#add the entire length of this non-coding exon
$start
+=
$exon
->
length
;
}
}
$self
->
{'
cdna_coding_start
'}
=
$start
;
...
...
@@ -1185,7 +1203,7 @@ sub get_all_translateable_Exons {
}
else
{
push
(
@translateable
,
$ex
);
}
# Exit the loop when we've found the last exon
last
if
$ex
eq
$end_exon
;
}
...
...
@@ -1233,11 +1251,11 @@ sub translate {
# or call translatable seq directly and produce a translation from it
my
$peptide
=
Bio::
Seq
->
new
(
-
seq
=>
$mrna
,
-
moltype
=>
"
dna
",
-
alphabet
=>
'
dna
',
-
id
=>
$display_id
);
-
moltype
=>
"
dna
",
-
alphabet
=>
'
dna
',
-
id
=>
$display_id
);
return
$peptide
->
translate
;
return
$peptide
->
translate
()
;
}
=head2 seq
...
...
@@ -1250,21 +1268,25 @@ Exon phases like B<dna_seq> does.
=cut
sub
seq
{
my
(
$self
)
=
@_
;
my
$transcript_seq_string
=
'';
foreach
my
$ex
(
@
{
$self
->
get_all_Exons
})
{
# $transcript_seq_string .= $ex->seq;
$transcript_seq_string
.=
$ex
->
seq
->
seq
;
my
(
$self
)
=
@_
;
my
$transcript_seq_string
=
'';
foreach
my
$ex
(
@
{
$self
->
get_all_Exons
})
{
my
$seq
=
$ex
->
seq
;
if
(
!
$seq
)
{
warning
("
Could not get exon seq. Transcript seq may not be correct.
");
$transcript_seq_string
.=
'
N
'
x
$ex
->
length
();
}
else
{
$transcript_seq_string
.=
$seq
->
seq
;
}
my
$seq
=
Bio::
Seq
->
new
(
-
DISPLAY_ID
=>
$self
->
stable_id
,
-
MOLTYPE
=>
'
dna
'
,
-
SEQ
=>
$transcript_seq_string
,
);
}
my
$seq
=
Bio::
Seq
->
new
(
-
DISPLAY_ID
=>
$self
->
stable_id
,
-
MOLTYPE
=>
'
dna
'
,
-
SEQ
=>
$transcript_seq_string
);
return
$seq
;
return
$seq
;
}
...
...
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