use strict;
use Maasha::Common;
use Maasha::Biopieces;
-use Maasha::Bowtie;
use Maasha::Filesys;
use Maasha::Fasta;
+use Maasha::Bowtie;
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$options = Maasha::Biopieces::parse_options(
[
{ long => 'no_stream', short => 'x', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef },
+ { long => 'directory', short => 'd', type => 'dir', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
{ long => 'index_name', short => 'i', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
]
);
-Maasha::Common::error( qw(directory already exists: "$options->{ 'index_name' }") ) if -d $options->{ 'index_name' };
-
-Maasha::Filesys::dir_create_if_not_exists( $options->{ 'index_name' } );
+Maasha::Filesys::dir_create_if_not_exists( $options->{ 'directory' } );
$in = Maasha::Biopieces::read_stream( $options->{ "stream_in" } );
$out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } );
close $fh_tmp;
-Maasha::Bowtie::bowtie_index( $file_tmp, $options->{ 'index_name' }, $options->{ 'index_name' }, $options->{ 'verbose' } );
+Maasha::Bowtie::bowtie_index( $file_tmp, $options->{ 'directory' }, $options->{ 'index_name' }, $options->{ 'verbose' } );
unlink $file_tmp;
-Maasha::Filesys::dir_remove( $tmp_dir );
-
Maasha::Biopieces::close_stream( $in );
Maasha::Biopieces::close_stream( $out );