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
810d0059
Commit
810d0059
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Sort out formatting of add_Exon() and use assert_ref() too, before
fixing problem reported by Mark McDowall.
parent
1fa04c59
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
+31
-27
31 additions, 27 deletions
modules/Bio/EnsEMBL/Transcript.pm
with
31 additions
and
27 deletions
modules/Bio/EnsEMBL/Transcript.pm
+
31
−
27
View file @
810d0059
...
...
@@ -1212,33 +1212,31 @@ sub add_Attributes {
=cut
sub
add_Exon
{
my
(
$self
,
$exon
,
$rank
)
=
@_
;
sub
add_Exon
{
my
(
$self
,
$exon
,
$rank
)
=
@_
;
#yup - we are going to be picky here...
unless
(
defined
$exon
&&
ref
$exon
&&
$exon
->
isa
("
Bio::EnsEMBL::Exon
")
)
{
throw
("
[
$exon
] is not a Bio::EnsEMBL::Exon!
");
}
assert_ref
(
$exon
,
'
Bio::EnsEMBL::Exon
'
);
$self
->
{'
_trans_exon_array
'}
||=
[]
;
if
(
defined
(
$rank
))
{
$self
->
{'
_trans_exon_array
'}
->
[
$rank
-
1
]
=
$exon
;
if
(
defined
(
$rank
)
)
{
$self
->
{'
_trans_exon_array
'}
->
[
$rank
-
1
]
=
$exon
;
return
;
}
my
$was_added
=
0
;
my
$ea
=
$self
->
{'
_trans_exon_array
'};
if
(
@$ea
)
{
if
(
$exon
->
strand
()
==
1
)
{
if
(
$exon
->
start
()
>
$ea
->
[
$#$ea
]
->
end
()
)
{
push
(
@
{
$self
->
{'
_trans_exon_array
'}},
$exon
);
if
(
@
{
$ea
}
)
{
if
(
$exon
->
strand
()
==
1
)
{
if
(
$exon
->
start
()
>
$ea
->
[
$#$ea
]
->
end
()
)
{
push
(
@
{
$self
->
{'
_trans_exon_array
'}
},
$exon
);
$was_added
=
1
;
}
else
{
# insert it at correct place
for
(
my
$i
=
0
;
$i
<=
$#$ea
;
$i
++
)
{
if
(
$exon
->
end
()
<
$ea
->
[
$i
]
->
start
()
)
{
for
(
my
$i
=
0
;
$i
<=
$#$ea
;
$i
++
)
{
if
(
$exon
->
end
()
<
$ea
->
[
$i
]
->
start
()
)
{
splice
(
@$ea
,
$i
,
0
,
$exon
);
$was_added
=
1
;
last
;
...
...
@@ -1246,13 +1244,13 @@ sub add_Exon{
}
}
}
else
{
if
(
$exon
->
end
()
<
$ea
->
[
$#$ea
]
->
start
()
)
{
push
(
@
{
$self
->
{'
_trans_exon_array
'}},
$exon
);
if
(
$exon
->
end
()
<
$ea
->
[
$#$ea
]
->
start
()
)
{
push
(
@
{
$self
->
{'
_trans_exon_array
'}
},
$exon
);
$was_added
=
1
;
}
else
{
# insert it at correct place
for
(
my
$i
=
0
;
$i
<=
$#$ea
;
$i
++
)
{
if
(
$exon
->
start
()
>
$ea
->
[
$i
]
->
end
()
)
{
for
(
my
$i
=
0
;
$i
<=
$#$ea
;
$i
++
)
{
if
(
$exon
->
start
()
>
$ea
->
[
$i
]
->
end
()
)
{
splice
(
@$ea
,
$i
,
0
,
$exon
);
$was_added
=
1
;
last
;
...
...
@@ -1266,24 +1264,30 @@ sub add_Exon{
}
# sanity check:
if
(
!
$was_added
)
{
if
(
!
$was_added
)
{
# exon was not added because it has same end coord as start
# of another exon
my
$all_str
=
'';
foreach
my
$e
(
@$ea
)
{
$all_str
.=
'
'
.
$e
->
start
.
'
-
'
.
$e
->
end
.
'
(
'
.
$e
->
strand
.
'
)
'
.
(
$e
->
stable_id
||
'')
.
"
\n
";
$all_str
.=
'
'
.
$e
->
start
()
.
'
-
'
.
$e
->
end
()
.
'
(
'
.
$e
->
strand
()
.
'
)
'
.
(
$e
->
stable_id
()
||
''
)
.
"
\n
";
}
my
$cur_str
=
'
'
.
$exon
->
start
.
'
-
'
.
$exon
->
end
.
'
(
'
.
$exon
->
strand
.
'
)
'
.
(
$exon
->
stable_id
||
'')
.
"
\n
";
throw
("
Exon overlaps with other exon in same transcript.
\n
"
.
"
Transcript Exons:
\n
$all_str
\n
"
.
"
This Exon:
\n
$cur_str
");
my
$cur_str
=
'
'
.
$exon
->
start
()
.
'
-
'
.
$exon
->
end
()
.
'
(
'
.
$exon
->
strand
()
.
'
)
'
.
(
$exon
->
stable_id
()
||
''
)
.
"
\n
";
throw
(
"
Exon overlaps with other exon in same transcript.
\n
"
.
"
Transcript Exons:
\n
$all_str
\n
"
.
"
This Exon:
\n
$cur_str
"
);
}
# recalculate start, end, slice, strand
$self
->
recalculate_coordinates
();
}
}
## end sub add_Exon
=head2 get_all_Exons
...
...
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