Skip to content
Snippets Groups Projects
Commit 82cc2d40 authored by Patrick Meidl's avatar Patrick Meidl
Browse files

fixed bug in load_and_merge() when using --cache_method=build_cache_all

parent 6acfdf46
No related branches found
No related tags found
No related merge requests found
......@@ -155,6 +155,9 @@ sub build_cache_by_slice {
# write cache to file, then flush cache to reclaim memory
my $size = $self->write_all_to_file($type);
# set cache method (required for loading cache later)
$self->cache_method('BY_SEQ_REGION');
return $num_genes, $size;
}
......@@ -199,6 +202,9 @@ sub build_cache_all {
# write cache to file, then flush cache to reclaim memory
my $size = $self->write_all_to_file($type);
# set cache method (required for loading cache later)
$self->cache_method('ALL');
return $num_genes, $size;
}
......@@ -1052,8 +1058,16 @@ sub read_and_merge {
throw("Db type must be 'source' or 'target'.");
}
foreach my $slice_name (@{ $self->slice_names($dbtype) }) {
$self->read_from_file("$dbtype.$slice_name");
# read cache from single or multiple files, depending on caching strategy
my $cache_method = $self->cache_method;
if ($cache_method eq 'ALL') {
$self->read_from_file("$dbtype.ALL");
} elsif ($cache_method eq 'BY_SEQ_REGION') {
foreach my $slice_name (@{ $self->slice_names($dbtype) }) {
$self->read_from_file("$dbtype.$slice_name");
}
} else {
throw("Unknown cache method: $cache_method.");
}
$self->merge($dbtype);
......@@ -1196,6 +1210,13 @@ sub conf {
}
sub cache_method {
my $self = shift;
$self->{'instance'}->{'cache_method'} = shift if (@_);
return $self->{'instance'}->{'cache_method'};
}
sub highest_common_cs {
my $self = shift;
$self->{'instance'}->{'hccs'} = shift if (@_);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment