Permalink
Browse files

Restoring intended behaviour... I think

  • Loading branch information...
1 parent 482831a commit 8b558e3044ad4cff06b4bfd5d6871df25571ee91 @fangly fangly committed Feb 21, 2013
Showing with 7 additions and 10 deletions.
  1. +1 −1 Bio/DB/IndexedBase.pm
  2. +6 −9 Bio/DB/SeqFeature/Store/berkeleydb.pm
View
@@ -527,7 +527,7 @@ sub index_name {
Title : path
Usage : my $path = $db->path($path);
- Function: When a simple file or a directory of files is indexed, this returns
+ Function: When a single file or a directory of files is indexed, this returns
the file directory. When indexing an arbitrary list of files, the
return value is the path of the current working directory.
Returns : String
@@ -1528,18 +1528,15 @@ package Bio::DB::Fasta::Subdir;
use base 'Bio::DB::Fasta';
-# alter calling arguments so that the fasta file is placed in a subdirectory
+# alter calling arguments so that the index file is placed in a subdirectory
# named "indexes"
-sub index_name {
- my ($self, $path, $isdir) = @_;
- my $index_name;
- if ($isdir) {
- $index_name = File::Spec->catfile($path,'indexes','fasta.index');
- } else {
- $index_name = $self->SUPER::index_name($path,$isdir);
+sub new {
+ my ($class, $path, %opts) = @_;
+ if (-d $path) {
+ $opts{-index_name} = File::Spec->catfile($path,'indexes','fasta.index');
}
- return $index_name;
+ return Bio::DB::Fasta->new($path, %opts);
}

0 comments on commit 8b558e3

Please sign in to comment.