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
Wiki
Requirements
Code
Merge requests
0
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
Tamara El Naboulsi
ensembl
Commits
e1546321
Commit
e1546321
authored
11 years ago
by
Alessandro Vullo
Browse files
Options
Downloads
Patches
Plain Diff
Added (private) method _make_stop_codon_features
parent
9d978970
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
+69
-12
69 additions, 12 deletions
modules/Bio/EnsEMBL/Utils/IO/GTFSerializer.pm
with
69 additions
and
12 deletions
modules/Bio/EnsEMBL/Utils/IO/GTFSerializer.pm
+
69
−
12
View file @
e1546321
...
...
@@ -76,11 +76,10 @@ sub print_feature {
sub
_make_start_codon_features
{
my
(
$self
,
$trans
)
=
@_
;
defined
$trans
or
throw
("
Transcript object not defined
");
if
(
!
$trans
->
translation
)
{
return
(());
}
return
(())
unless
$trans
->
translation
;
my
@translateable
=
@
{
$trans
->
get_all_translateable_Exons
};
...
...
@@ -106,14 +105,14 @@ sub _make_start_codon_features {
my
@startc_feat
;
my
$phase
=
0
;
foreach
my
$pepgencoord
(
@pepgencoords
)
{
push
@startc_feat
,
new
Bio::EnsEMBL::
SeqFeature
(
-
seqname
=>
$trans
->
stable_id
,
-
source_tag
=>
'
starttrans
',
-
primary_tag
=>
'
similarity
',
-
start
=>
$pepgencoord
->
start
,
-
end
=>
$pepgencoord
->
end
,
-
phase
=>
$phase
,
-
strand
=>
$translateable
[
0
]
->
strand
);
push
@startc_feat
,
new
Bio::EnsEMBL::
SeqFeature
(
-
seqname
=>
$trans
->
stable_id
,
-
source_tag
=>
'
starttrans
',
-
primary_tag
=>
'
similarity
',
-
start
=>
$pepgencoord
->
start
,
-
end
=>
$pepgencoord
->
end
,
-
phase
=>
$phase
,
-
strand
=>
$translateable
[
0
]
->
strand
);
$phase
=
3
-
(
$pepgencoord
->
end
-
$pepgencoord
->
start
+
1
);
}
if
(
$translateable
[
0
]
->
strand
==
1
)
{
...
...
@@ -121,8 +120,66 @@ sub _make_start_codon_features {
}
else
{
@startc_feat
=
sort
{
$b
->
start
<=>
$a
->
start
}
@startc_feat
;
}
return
@startc_feat
;
}
=head2 _make_stop_codon_features
Arg [1] : Bio::EnsEMBL::Transcript
Example :
Description:
Returntype : Array
=cut
sub
_make_stop_codon_features
{
my
(
$self
,
$trans
)
=
@_
;
defined
$trans
or
throw
("
Transcript object not defined
");
return
(())
unless
$trans
->
translation
;
my
@translateable
=
@
{
$trans
->
get_all_translateable_Exons
};
my
$cdna_endpos
=
$trans
->
cdna_coding_end
;
my
@pepgencoords
=
$trans
->
cdna2genomic
(
$cdna_endpos
-
2
,
$cdna_endpos
);
if
(
scalar
(
@pepgencoords
)
>
3
)
{
throw
(
sprintf
"
Pep end for transcript %s does not map cleanly
",
$trans
->
display_id
);
}
unless
(
$pepgencoords
[
0
]
->
isa
('
Bio::EnsEMBL::Mapper::Coordinate
'))
{
throw
(
sprintf
"
Pep end for transcript %s maps to gap
",
$trans
->
display_id
);
}
unless
(
$pepgencoords
[
$#pepgencoords
]
->
isa
('
Bio::EnsEMBL::Mapper::Coordinate
'))
{
throw
(
sprintf
"
Pep end (end of) for transcript %s maps to gap
",
$trans
->
display_id
);
}
my
@stopc_feat
;
my
$phase
=
0
;
foreach
my
$pepgencoord
(
@pepgencoords
)
{
push
@stopc_feat
,
new
Bio::EnsEMBL::
SeqFeature
(
-
seqname
=>
$trans
->
display_id
,
-
source_tag
=>
'
endtrans
',
-
primary_tag
=>
'
similarity
',
-
start
=>
$pepgencoord
->
start
,
-
end
=>
$pepgencoord
->
end
,
-
phase
=>
$phase
,
-
strand
=>
$translateable
[
0
]
->
strand
);
$phase
=
3
-
(
$pepgencoord
->
end
-
$pepgencoord
->
start
+
1
);
}
if
(
$translateable
[
0
]
->
strand
==
1
)
{
@stopc_feat
=
sort
{
$a
->
start
<=>
$b
->
start
}
@stopc_feat
;
}
else
{
@stopc_feat
=
sort
{
$b
->
start
<=>
$a
->
start
}
@stopc_feat
;
}
return
@stopc_feat
;
}
1
;
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