X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fcreate_bowtie_index;h=49c1cfdc86fa205e2349f6863d3237f7b4b5c155;hb=48bea5c28b89dc5586d0bddb338ccd6ba23aa1f9;hp=b8949ea1f708d32ac91c8b5ed11cb0cd59798b60;hpb=15fc1cc28abfb41e8630c731fd6459dcdcd08e10;p=biopieces.git diff --git a/bp_bin/create_bowtie_index b/bp_bin/create_bowtie_index index b8949ea..49c1cfd 100755 --- a/bp_bin/create_bowtie_index +++ b/bp_bin/create_bowtie_index @@ -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 );