]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/create_bowtie_index
removed debug message
[biopieces.git] / bp_bin / create_bowtie_index
index b8949ea1f708d32ac91c8b5ed11cb0cd59798b60..49c1cfdc86fa205e2349f6863d3237f7b4b5c155 100755 (executable)
@@ -30,9 +30,9 @@ use warnings;
 use strict;
 use Maasha::Common;
 use Maasha::Biopieces;
-use Maasha::Bowtie;
 use Maasha::Filesys;
 use Maasha::Fasta;
+use Maasha::Bowtie;
 
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -43,13 +43,12 @@ my ( $default, $formats, $options, $in, $out, $record, $tmp_dir, $file_tmp, $fh_
 $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" } );
@@ -69,12 +68,10 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
 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 );