Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
2a8e4146
Commit
2a8e4146
authored
Feb 25, 2010
by
Ian Longden
Browse files
create LRGSlice when needed
parent
57d73b5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
11 deletions
+30
-11
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+30
-11
No files found.
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
View file @
2a8e4146
...
...
@@ -98,7 +98,7 @@ use strict;
use
Bio::EnsEMBL::DBSQL::
BaseAdaptor
;
use
Bio::EnsEMBL::
Slice
;
use
Bio::EnsEMBL::
Mapper
;
use
Bio::EnsEMBL::
LRGSlice
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw deprecate warning stack_trace_dump)
;
...
...
@@ -119,6 +119,13 @@ sub new {
$self
->
{'
sr_name_cache
'}
=
$seq_region_cache
->
{'
name_cache
'};
$self
->
{'
sr_id_cache
'}
=
$seq_region_cache
->
{'
id_cache
'};
$self
->
{'
lrg_region_test
'}
=
undef
;
my
$meta_container
=
$self
->
db
->
get_MetaContainer
();
my
@values
=
$meta_container
->
list_value_by_key
("
LRG
");
if
(
defined
(
@values
)
and
scalar
(
@values
)
and
$values
[
0
]
->
[
0
]){
$self
->
{'
lrg_region_test
'}
=
$values
[
0
]
->
[
0
];
}
return
$self
;
}
...
...
@@ -388,15 +395,27 @@ sub fetch_by_region {
)
);
}
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
}
);
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
{
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
}
);
}
}
## end sub fetch_by_region
...
...
@@ -1054,7 +1073,7 @@ sub fetch_by_Feature{
}
my
$slice
=
$feature
->
slice
();
if
(
!
$slice
||
!
$slice
->
isa
('
Bio::EnsEMBL::Slice
'))
{
if
(
!
$slice
||
(
!
$slice
->
isa
('
Bio::EnsEMBL::Slice
')
&&
!
$slice
->
isa
('
Bio::EnsEMBL::LRGSlice
')
)
)
{
throw
('
Feature must be attached to a valid slice.
');
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment