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
824f9544
Commit
824f9544
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Make _objs_from_sth() aware of circular chromosomes. Patch from EG.
parent
ecba7548
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+66
-14
66 additions, 14 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
with
66 additions
and
14 deletions
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+
66
−
14
View file @
824f9544
...
...
@@ -312,8 +312,12 @@ sub fetch_all_by_Gene {
throw
("
Gene must have attached slice to retrieve transcripts.
");
}
if
(
$gene
->
start
()
<
1
||
$gene
->
end
()
>
$gslice
->
length
())
{
$slice
=
$self
->
db
->
get_SliceAdaptor
->
fetch_by_Feature
(
$gene
);
if
(
$gene
->
start
()
<
1
||
$gene
->
end
()
>
$gslice
->
length
()
)
{
if
(
$gslice
->
is_circular
()
)
{
$slice
=
$gslice
;
}
else
{
$slice
=
$self
->
db
->
get_SliceAdaptor
->
fetch_by_Feature
(
$gene
);
}
}
else
{
$slice
=
$gslice
;
}
...
...
@@ -1486,31 +1490,79 @@ sub _objs_from_sth {
}
#
# If a destination slice was provided convert the coords
# If the dest_slice starts at 1 and is foward strand, nothing needs doing
# If a destination slice was provided convert the coords.
#
if
(
$dest_slice
)
{
if
(
$dest_slice_start
!=
1
||
$dest_slice_strand
!=
1
)
{
if
(
$dest_slice_strand
==
1
)
{
$seq_region_start
=
$seq_region_start
-
$dest_slice_start
+
1
;
$seq_region_end
=
$seq_region_end
-
$dest_slice_start
+
1
;
if
(
defined
(
$dest_slice
))
{
if
(
$dest_slice_strand
==
1
)
{
$seq_region_start
=
$seq_region_start
-
$dest_slice_start
+
1
;
$seq_region_end
=
$seq_region_end
-
$dest_slice_start
+
1
;
if
(
$dest_slice
->
is_circular
)
{
if
(
$seq_region_start
>
$seq_region_end
)
{
# Looking at a feature overlapping the chromsome origin.
if
(
$seq_region_end
>
$dest_slice_start
)
{
# Looking at the region in the beginning of the chromosome
$seq_region_start
-=
$dest_slice
->
seq_region_length
();
}
if
(
$seq_region_end
<
0
)
{
$seq_region_end
+=
$dest_slice
->
seq_region_length
();
}
}
else
{
if
(
$dest_slice_start
>
$dest_slice_end
&&
$seq_region_end
<
0
)
{
# Looking at the region overlapping the chromosome
# origin and a feature which is at the beginning of the
# chromosome.
$seq_region_start
+=
$dest_slice
->
seq_region_length
();
$seq_region_end
+=
$dest_slice
->
seq_region_length
();
}
}
}
}
else
{
if
(
$dest_slice
->
is_circular
()
&&
$seq_region_start
>
$seq_region_end
)
{
if
(
$seq_region_end
>
$dest_slice_start
)
{
# Looking at the region in the beginning of the chromosome.
$seq_region_start
=
$dest_slice_end
-
$seq_region_end
+
1
;
$seq_region_end
=
$seq_region_end
-
$dest_slice
->
seq_region_length
()
-
$dest_slice_start
+
1
;
}
else
{
my
$tmp_seq_region_start
=
$seq_region_start
;
$seq_region_start
=
$dest_slice_end
-
$seq_region_end
-
$dest_slice
->
seq_region_length
()
+
1
;
$seq_region_end
=
$dest_slice_end
-
$tmp_seq_region_start
+
1
;
}
}
else
{
my
$tmp_seq_region_start
=
$seq_region_start
;
$seq_region_start
=
$dest_slice_end
-
$seq_region_end
+
1
;
$seq_region_end
=
$dest_slice_end
-
$tmp_seq_region_start
+
1
;
$seq_region_strand
*=
-
1
;
}
}
$seq_region_strand
=
-
$seq_region_strand
;
}
## end else [ if ( $dest_slice_strand...)]
# Throw away features off the end of the requested slice
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_id
ne
$seq_region_id
)
)
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_id
ne
$seq_region_id
)
)
{
next
FEATURE
;
}
$slice
=
$dest_slice
;
}
else
{
$slice
=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
);
}
my
$display_xref
;
...
...
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