From: martinahansen Date: Mon, 7 Sep 2009 18:33:19 +0000 (+0000) Subject: sanitized create_bowtie_seq X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2224c1fb8cbef6483285ba6989a9a09768c15151;p=biopieces.git sanitized create_bowtie_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@658 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/create_bowtie_index b/bp_bin/create_bowtie_index index b8949ea..fa6b99a 100755 --- a/bp_bin/create_bowtie_index +++ b/bp_bin/create_bowtie_index @@ -43,13 +43,14 @@ 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::Common::error( qw(Directory already exists: "$options->{ 'directory' }") ) if -d $options->{ 'directory' }; -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 +70,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 );