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
b66ba6fb
Commit
b66ba6fb
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
reverting back to 1.54 since these are changes not ready for prime time
parent
f7805e02
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/SequenceAdaptor.pm
+31
-46
31 additions, 46 deletions
modules/Bio/EnsEMBL/DBSQL/SequenceAdaptor.pm
with
31 additions
and
46 deletions
modules/Bio/EnsEMBL/DBSQL/SequenceAdaptor.pm
+
31
−
46
View file @
b66ba6fb
...
...
@@ -39,7 +39,7 @@ An adaptor for the retrieval of DNA sequence from the EnsEMBL database
package
Bio::EnsEMBL::DBSQL::
SequenceAdaptor
;
#
use vars qw(@ISA @EXPORT);
use
vars
qw(@ISA @EXPORT)
;
use
strict
;
use
warnings
;
...
...
@@ -49,14 +49,13 @@ use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp);
use
Bio::EnsEMBL::Utils::
Cache
;
use
Bio::EnsEMBL::Utils::
Scalar
qw( assert_ref )
;
# @ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor Bio::EnsEMBL::DBSQL::BaseSequenceAdaptor);
use
base
qw(Bio::EnsEMBL::DBSQL::BaseAdaptor Bio::EnsEMBL::DBSQL::BaseSequenceAdaptor)
;
#
# our $SEQ_CHUNK_PWR = 18; # 2^18 = approx. 250KB
# our $SEQ_CACHE_SZ = 5;
# our $SEQ_CACHE_MAX = (2 ** $SEQ_CHUNK_PWR) * $SEQ_CACHE_SZ;
@ISA
=
qw(Bio::EnsEMBL::DBSQL::BaseAdaptor)
;
our
@EXPORT
=
(
@
{
$
DBI::
EXPORT_TAGS
{'
sql_types
'}});
our
$SEQ_CHUNK_PWR
=
18
;
# 2^18 = approx. 250KB
our
$SEQ_CACHE_SZ
=
5
;
our
$SEQ_CACHE_MAX
=
(
2
**
$SEQ_CHUNK_PWR
)
*
$SEQ_CACHE_SZ
;
@EXPORT
=
(
@
{
$
DBI::
EXPORT_TAGS
{'
sql_types
'}});
=head2 new
...
...
@@ -73,15 +72,16 @@ our @EXPORT = (@{$DBI::EXPORT_TAGS{'sql_types'}});
sub
new
{
my
$caller
=
shift
;
my
$class
=
ref
(
$caller
)
||
$caller
;
my
$self
=
$class
->
SUPER::
new
(
@
_
);
$self
->
_init_seq_instance
();
#
#
use an LRU cache to limit the size
#
my %seq_cache;
#
tie(%seq_cache, 'Bio::EnsEMBL::Utils::Cache', $SEQ_CACHE_SZ);
#
#
$self->{'seq_cache'} = \%seq_cache;
# use an LRU cache to limit the size
my
%seq_cache
;
tie
(
%seq_cache
,
'
Bio::EnsEMBL::Utils::Cache
',
$SEQ_CACHE_SZ
);
$self
->
{'
seq_cache
'}
=
\
%seq_cache
;
#
...
...
@@ -107,22 +107,22 @@ sub new {
return
$self
;
}
#
#
=head2 clear_cache
#
#
Example
: $sa->clear_cache();
#
Description
: Removes all entries from the associcated sequence cache
#
Returntype
: None
#
Exceptions
: None
#
#
=cut
#
#
sub clear_cache {
#
my ($self) = @_;
#
%{$self->{seq_cache}} = ();
#
return;
#
}
#
=head2 clear_cache
Example
: $sa->clear_cache();
Description
: Removes all entries from the associcated sequence cache
Returntype
: None
Exceptions
: None
=cut
sub
clear_cache
{
my
(
$self
)
=
@_
;
%
{
$self
->
{
seq_cache
}}
=
();
return
;
}
=head2 fetch_by_Slice_start_end_strand
...
...
@@ -442,7 +442,7 @@ sub _rna_edit {
return
;
}
=cut
sub
_fetch_seq
{
my
$self
=
shift
;
my
$seq_region_id
=
shift
;
...
...
@@ -519,21 +519,6 @@ sub _fetch_seq {
return
\
$tmp_seq
;
}
}
=cut
sub
_fetch_raw_seq
{
my
(
$self
,
$id
,
$start
,
$length
)
=
@_
;
my
$sql
=
<<'SQL';
SELECT UPPER(SUBSTRING(d.sequence, ?, ?))
FROM dna d
WHERE d.seq_region_id =?
SQL
my
$seq
=
$self
->
dbc
()
->
sql_helper
()
->
execute_single_result
(
-
SQL
=>
$sql
,
-
PARAMS
=>
[[
$start
,
SQL_INTEGER
],
[
$length
,
SQL_INTEGER
],
[
$id
,
SQL_INTEGER
]],
-
NO_ERROR
=>
1
);
return
\
$seq
;
}
=head2 store
...
...
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