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
d7a13e22
Commit
d7a13e22
authored
11 years ago
by
Alessandro Vullo
Browse files
Options
Downloads
Patches
Plain Diff
Check incomplete CDS annotation on both ends when dealing with start/stop codons
parent
1ba6cc1a
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/Utils/IO/GTFSerializer.pm
+36
-22
36 additions, 22 deletions
modules/Bio/EnsEMBL/Utils/IO/GTFSerializer.pm
with
36 additions
and
22 deletions
modules/Bio/EnsEMBL/Utils/IO/GTFSerializer.pm
+
36
−
22
View file @
d7a13e22
...
...
@@ -165,7 +165,7 @@ sub print_feature {
$exon
==
$transcript
->
translation
->
start_Exon
&&
$hasstart
)
{
my
$tmpcnt
=
$count
;
foreach
my
$startc
(
@startcs
)
{
# here we should check the start codon covers 3 bases
print
$fh
$idstr
.
"
\t
"
.
$transcript_biotype
.
"
\t
"
.
'
start_codon
'
.
"
\t
"
.
...
...
@@ -185,7 +185,7 @@ sub print_feature {
my
$tmpcnt
=
$count
-
$#endcs
;
foreach
my
$endc
(
@endcs
)
{
# here we should check the stop codon covers 3 bases
print
$fh
$idstr
.
"
\t
"
.
$transcript_biotype
.
"
\t
"
.
'
stop_codon
'
.
"
\t
"
.
...
...
@@ -385,31 +385,45 @@ sub _check_start_and_stop {
my
(
$self
,
,
$trans
)
=
@_
;
return
(
0
,
0
)
unless
defined
$trans
->
translation
;
my
(
$has_start
,
$has_end
);
# transcript could be annotated has having incomplete
# CDS at either 5', 3' end or both
my
@attrib
=
@
{
$trans
->
get_all_Attributes
('
cds_start_NF
')};
$has_start
=
scalar
@attrib
==
1
and
$attrib
[
0
]
->
value
()
==
1
?
0
:
1
;
@attrib
=
@
{
$trans
->
get_all_Attributes
('
cds_end_NF
')};
$has_end
=
scalar
@attrib
==
1
and
$attrib
[
0
]
->
value
()
==
1
?
0
:
1
;
return
(
0
,
0
)
unless
$has_start
and
$has_end
;
#
# even if the transcript is not annotated with incomplete start/end
# CDS, we need to test whether the extracted start/stop codons are valid
#
# use translateable_seq (CDS) instead of spliced_seq (CDNA) which is
# not padded for non-triplet issues
#
my
$cds_seq
=
uc
(
$trans
->
translateable_seq
);
my
$startseq
=
substr
(
$cds_seq
,
0
,
3
);
my
$endseq
=
substr
(
$cds_seq
,
-
3
);
my
$has_start
=
1
;
my
$has_end
=
1
;
# reimplemented since there are alternatively valid codon tables
$has_start
=
0
if
(
$startseq
ne
"
ATG
");
$has_end
=
0
if
(
$endseq
ne
"
TAG
"
&&
$endseq
ne
"
TGA
"
&&
$endseq
ne
"
TAA
");
# my ($attrib) = @{ $trans->slice()->get_all_Attributes('codon_table') };
# my $codon_table_id;
# $codon_table_id = $attrib->value()
# if defined $attrib;
# $codon_table_id ||= 1; # default vertebrate codon table
# my $codon_table = Bio::Tools::CodonTable->new( -id => $codon_table_id );
# $has_start = 0 unless $codon_table->is_start_codon($startseq);
# $has_end = 0 unless $codon_table->is_ter_codon($endseq);
# $has_start = $has_end = 1;
# $has_start = 0 if ($startseq ne "ATG");
# $has_end = 0 if ($endseq ne "TAG" && $endseq ne "TGA" && $endseq ne "TAA");
my
(
$attrib
)
=
@
{
$trans
->
slice
()
->
get_all_Attributes
('
codon_table
')
};
my
$codon_table_id
;
$codon_table_id
=
$attrib
->
value
()
if
defined
$attrib
;
$codon_table_id
||=
1
;
# default codon table (vertebrate)
my
$codon_table
=
Bio::Tools::
CodonTable
->
new
(
-
id
=>
$codon_table_id
);
$has_start
=
0
unless
$codon_table
->
is_start_codon
(
$startseq
);
$has_end
=
0
unless
$codon_table
->
is_ter_codon
(
$endseq
);
return
(
$has_start
,
$has_end
);
}
...
...
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