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
a032c47c
Commit
a032c47c
authored
Aug 13, 2004
by
Graham McVicker
Browse files
max feature length can be overridden, allows optimization for misc feature retrieval
parent
71ca02a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
+17
-2
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
+10
-1
No files found.
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
View file @
a032c47c
...
...
@@ -492,7 +492,7 @@ sub _slice_fetch {
if
(
$feat_cs
->
equals
(
$slice_cs
))
{
# no mapping is required if this is the same coord system
my
$max_len
=
my
$max_len
=
$self
->
_max_feature_length
()
||
$mcc
->
fetch_max_length_by_CoordSystem_feature_type
(
$feat_cs
,
$tab_name
);
my
$constraint
=
$orig_constraint
;
...
...
@@ -552,7 +552,7 @@ sub _slice_fetch {
}
else
{
# do multiple split queries using start / end constraints
my
$max_len
=
my
$max_len
=
$self
->
_max_feature_length
()
||
$mcc
->
fetch_max_length_by_CoordSystem_feature_type
(
$feat_cs
,
$tab_name
);
my
$len
=
@coords
;
...
...
@@ -1044,6 +1044,21 @@ sub _objs_from_sth {
}
#
# Internal function. Allows the max feature length which is normally
# retrieved from the meta_coord table to be overridden. This allows
# for some significant optimizations to be put in when it is known
# that requested features will not be over a certain size.
#
sub
_max_feature_length
{
my
$self
=
shift
;
return
$self
->
{'
_max_feature_length
'}
=
shift
if
(
@
_
);
return
$self
->
{'
_max_feature_length
'};
}
=head1 DEPRECATED METHODS
=cut
...
...
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
View file @
a032c47c
...
...
@@ -87,8 +87,10 @@ sub fetch_all_by_Slice_and_set_code {
my
$msa
=
$self
->
db
->
get_MiscSetAdaptor
();
my
@sets
=
();
my
$max_len
=
0
;
foreach
my
$set_code
(
@
_
)
{
my
$set
=
$msa
->
fetch_by_code
(
$set_code
);
$max_len
=
$set
->
longest_feature
()
if
(
$set
->
longest_feature
>
$max_len
);
if
(
!
$set
)
{
warning
("
No misc_set with code [
$set_code
] exists
")
}
else
{
push
@sets
,
$set
->
dbID
;
}
}
...
...
@@ -100,7 +102,14 @@ sub fetch_all_by_Slice_and_set_code {
}
else
{
return
[]
;
}
return
$self
->
fetch_all_by_Slice_constraint
(
$slice
,
$constraint
);
$self
->
_max_feature_length
(
$max_len
);
my
$results
=
$self
->
fetch_all_by_Slice_constraint
(
$slice
,
$constraint
);
$self
->
_max_feature_length
(
undef
);
return
$results
;
}
...
...
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