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
474a9cce
Commit
474a9cce
authored
14 years ago
by
Andreas Kusalananda Kähäri
Browse files
Options
Downloads
Patches
Plain Diff
Make fetch_by_region() aware of circular chromosomes. Patch from EG.
parent
65ce5d24
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/SliceAdaptor.pm
+36
-31
36 additions, 31 deletions
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
with
36 additions
and
31 deletions
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+
36
−
31
View file @
474a9cce
...
...
@@ -97,6 +97,7 @@ use strict;
use
Bio::EnsEMBL::DBSQL::
BaseAdaptor
;
use
Bio::EnsEMBL::
Slice
;
use
Bio::EnsEMBL::
CircularSlice
;
use
Bio::EnsEMBL::
Mapper
;
use
Bio::EnsEMBL::
LRGSlice
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw deprecate warning stack_trace_dump)
;
...
...
@@ -221,11 +222,9 @@ sub fetch_by_region {
}
if
(
!
defined
(
$cs
)
)
{
throw
(
sprintf
(
"
Unknown coordinate system:
\n
"
throw
(
sprintf
(
"
Unknown coordinate system:
\n
"
.
"
name='%s' version='%s'
\n
",
$coord_system_name
,
$version
)
);
$coord_system_name
,
$version
)
);
}
# fetching by toplevel is same as fetching w/o name or version
...
...
@@ -234,7 +233,7 @@ sub fetch_by_region {
$version
=
undef
;
}
}
## end if ( defined($coord_system_name...
}
## end if ( defined($coord_system_name...
))
my
$constraint
;
my
$sql
;
...
...
@@ -361,8 +360,7 @@ sub fetch_by_region {
.
"
returned more than one result.
\n
"
.
"
You might want to check whether the returned seq_region
\n
"
.
"
(%s:%s) is the one you intended to fetch.
\n
",
$high_cs
->
name
(),
$seq_region_name
)
);
$high_cs
->
name
(),
$seq_region_name
)
);
}
$cs
=
$high_cs
;
...
...
@@ -383,38 +381,45 @@ sub fetch_by_region {
$self
->
{'
sr_id_cache
'}
->
{"
$id
"}
=
$arr
;
$cs
=
$csa
->
fetch_by_dbID
(
$cs_id
);
}
}
## end else [ if ( defined($arr) )
}
## end else [ if ( defined($arr) )
]
if
(
!
defined
(
$end
)
)
{
$end
=
$length
}
if
(
$end
+
1
<
$start
)
{
throw
(
sprintf
(
"
start [%d] must be less than or equal to end+1 [%d]
",
$start
,
$end
+
1
)
);
my
$new_sl
=
Bio::EnsEMBL::
CircularSlice
->
new
(
-
COORD_SYSTEM
=>
$cs
,
-
SEQ_REGION_NAME
=>
$seq_region_name
,
-
SEQ_REGION_LENGTH
=>
$length
,
-
START
=>
$start
,
-
END
=>
$end
,
-
STRAND
=>
1
,
-
ADAPTOR
=>
$self
);
return
$new_sl
;
}
if
(
defined
(
$self
->
{'
lrg_region_test
'})
and
substr
(
$cs
->
name
,
0
,
3
)
eq
$self
->
{'
lrg_region_test
'}){
if
(
defined
(
$self
->
{'
lrg_region_test
'}
)
and
substr
(
$cs
->
name
,
0
,
3
)
eq
$self
->
{'
lrg_region_test
'}
)
{
return
Bio::EnsEMBL::
LRGSlice
->
new
(
-
COORD_SYSTEM
=>
$cs
,
-
SEQ_REGION_NAME
=>
$seq_region_name
,
-
SEQ_REGION_LENGTH
=>
$length
,
-
START
=>
$start
,
-
END
=>
$end
,
-
STRAND
=>
$strand
,
-
ADAPTOR
=>
$self
);
}
else
{
Bio::EnsEMBL::
LRGSlice
->
new
(
-
COORD_SYSTEM
=>
$cs
,
-
SEQ_REGION_NAME
=>
$seq_region_name
,
-
SEQ_REGION_LENGTH
=>
$length
,
-
START
=>
$start
,
-
END
=>
$end
,
-
STRAND
=>
$strand
,
-
ADAPTOR
=>
$self
);
}
else
{
return
Bio::EnsEMBL::
Slice
->
new_fast
(
{
'
coord_system
'
=>
$cs
,
'
seq_region_name
'
=>
$seq_region_name
,
'
seq_region_length
'
=>
$length
,
'
start
'
=>
$start
,
'
end
'
=>
$end
,
'
strand
'
=>
$strand
,
'
adaptor
'
=>
$self
}
);
Bio::EnsEMBL::
Slice
->
new_fast
(
{
'
coord_system
'
=>
$cs
,
'
seq_region_name
'
=>
$seq_region_name
,
'
seq_region_length
'
=>
$length
,
'
start
'
=>
$start
,
'
end
'
=>
$end
,
'
strand
'
=>
$strand
,
'
adaptor
'
=>
$self
}
);
}
}
## end sub fetch_by_region
...
...
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