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
044f5660
Commit
044f5660
authored
10 years ago
by
Kieron Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Code tidy in AssemblyExceptionFeatureAdaptor
parent
5d49c39f
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/DBSQL/AssemblyExceptionFeatureAdaptor.pm
+54
-80
54 additions, 80 deletions
modules/Bio/EnsEMBL/DBSQL/AssemblyExceptionFeatureAdaptor.pm
with
54 additions
and
80 deletions
modules/Bio/EnsEMBL/DBSQL/AssemblyExceptionFeatureAdaptor.pm
+
54
−
80
View file @
044f5660
...
...
@@ -286,7 +286,6 @@ sub _remap {
$features
->
[
0
]
->
slice
==
$slice
))
{
return
$features
;
}
# remapping has not been done, we have to do our own conversion from
# to slice coords
...
...
@@ -333,14 +332,6 @@ sub _remap {
# create new copies of successfully mapped feaatures with shifted start,
# end and strand
my
(
$new_start
,
$new_end
);
# if($slice_strand == -1) {
# $new_start = $slice_end - $end + 1;
# $new_end = $slice_end - $start + 1;
# } else {
# $new_start = $start - $slice_start + 1;
# $new_end = $end - $slice_start + 1;
# }
my
$seq_region_len
=
$slice
->
seq_region_length
();
if
(
$slice_strand
==
1
)
{
# Positive strand
...
...
@@ -349,92 +340,75 @@ sub _remap {
$new_end
=
$end
-
$slice_start
+
1
;
if
(
$slice
->
is_circular
())
{
# Handle circular chromosomes.
if
(
$new_start
>
$new_end
)
{
# Looking at a feature overlapping the chromsome origin.
if
(
$new_end
>
$slice_start
)
{
# Looking at the region in the beginning of the
# chromosome.
$new_start
-=
$seq_region_len
;
}
if
(
$new_end
<
0
)
{
$new_end
+=
$seq_region_len
;
}
}
else
{
if
(
$slice_start
>
$slice_end
&&
$new_end
<
0
)
{
# Looking at the region overlapping the chromosome
# origin and a feature which is at the beginning of the
# chromosome.
$new_start
+=
$seq_region_len
;
$new_end
+=
$seq_region_len
;
}
}
}
## end if ($dest_slice->is_circular...)
}
else
{
# Negative strand
# Handle circular chromosomes.
if
(
$new_start
>
$new_end
)
{
# Looking at a feature overlapping the chromsome origin.
if
(
$new_end
>
$slice_start
)
{
# Looking at the region in the beginning of the chromosome.
$new_start
-=
$seq_region_len
;
}
if
(
$new_end
<
0
)
{
$new_end
+=
$seq_region_len
;
}
}
else
{
if
(
$slice_start
>
$slice_end
&&
$new_end
<
0
)
{
# Looking at the region overlapping the chromosome
# origin and a feature which is at the beginning of the
# chromosome.
$new_start
+=
$seq_region_len
;
$new_end
+=
$seq_region_len
;
}
}
}
## end if ($dest_slice->is_circular...)
}
else
{
# Negative strand
my
$new_start
=
$slice_end
-
$end
+
1
;
my
$new_end
=
$slice_end
-
$start
+
1
;
if
(
$slice
->
is_circular
())
{
if
(
$slice_start
>
$slice_end
)
{
# slice spans origin or replication
if
(
$start
>=
$slice_start
)
{
$new_end
+=
$seq_region_len
;
$new_start
+=
$seq_region_len
if
$end
>
$slice_start
;
if
(
$slice_start
>
$slice_end
)
{
# slice spans origin or replication
}
elsif
(
$start
<=
$slice_end
)
{
# do nothing
}
elsif
(
$end
>=
$slice_start
)
{
$new_start
+=
$seq_region_len
;
$new_end
+=
$seq_region_len
;
if
(
$start
>=
$slice_start
)
{
$new_end
+=
$seq_region_len
;
$new_start
+=
$seq_region_len
if
$end
>
$slice_start
;
}
elsif
(
$end
<=
$slice_end
)
{
}
elsif
(
$start
<=
$slice_end
)
{
# do nothing
}
elsif
(
$end
>=
$slice_start
)
{
$new_start
+=
$seq_region_len
;
$new_end
+=
$seq_region_len
;
$new_end
+=
$seq_region_len
if
$new_end
<
0
;
}
elsif
(
$end
<=
$slice_end
)
{
$new_end
+=
$seq_region_len
if
$new_end
<
0
;
}
elsif
(
$start
>
$end
)
{
$new_end
+=
$seq_region_len
;
}
else
{
}
elsif
(
$start
>
$end
)
{
$new_end
+=
$seq_region_len
;
}
}
else
{
}
else
{
}
}
else
{
if
(
$start
<=
$slice_end
and
$end
>=
$slice_start
)
{
# do nothing
}
elsif
(
$start
>
$end
)
{
if
(
$start
<=
$slice_end
)
{
$new_start
-=
$seq_region_len
;
if
(
$start
<=
$slice_end
and
$end
>=
$slice_start
)
{
# do nothing
}
elsif
(
$start
>
$end
)
{
if
(
$start
<=
$slice_end
)
{
$new_start
-=
$seq_region_len
;
}
elsif
(
$end
>=
$slice_start
)
{
$new_end
+=
$seq_region_len
;
}
else
{
}
elsif
(
$end
>=
$slice_start
)
{
$new_end
+=
$seq_region_len
;
}
else
{
}
}
}
}
}
}
}
}
## end else [ if ($dest_slice_strand...)]
}
## end else [ if ($dest_slice_strand...)]
push
@out
,
Bio::EnsEMBL::
AssemblyExceptionFeature
->
new
(
'
-dbID
'
=>
$f
->
dbID
,
'
-start
'
=>
$new_start
,
...
...
@@ -445,7 +419,7 @@ sub _remap {
'
-alternate_slice
'
=>
$f
->
alternate_slice
,
'
-type
'
=>
$f
->
type
,
);
}
}
# end foreach assembly exception
return
\
@out
;
}
...
...
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