From: martinahansen Date: Fri, 6 May 2011 12:42:30 +0000 (+0000) Subject: added full switch to find_genes X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6313779656850c7e75095e5a800b7ff61096f7c4;p=biopieces.git added full switch to find_genes git-svn-id: http://biopieces.googlecode.com/svn/trunk@1377 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/find_genes b/bp_bin/find_genes index 2880a36..4ee726e 100755 --- a/bp_bin/find_genes +++ b/bp_bin/find_genes @@ -37,9 +37,14 @@ use Maasha::Filesys; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $options, $in, $out, $record, $tmp_dir, $tmp_file, $fh_out, $fh_in, $entry, $chunk, @lines, $line, $s_id, $type, $s_beg, $s_end, $strand, @fields, $def ); +my ( $options, $in, $out, $record, $tmp_dir, $tmp_file, $fh_out, $fh_in, $entry, $chunk, @lines, $line, $s_id, $type, $s_beg, $s_end, $strand, @fields, $def, + @commands, $command ); -$options = Maasha::Biopieces::parse_options(); +$options = Maasha::Biopieces::parse_options( + [ + { long => 'full', short => 'f', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, + ] +); $in = Maasha::Biopieces::read_stream( $options->{ "stream_in" } ); $out = Maasha::Biopieces::write_stream( $options->{ "stream_out" } ); @@ -57,11 +62,15 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) Maasha::Biopieces::put_record( $record, $out ); } -if ( $options->{ 'verbise' } ) { - Maasha::Common::run( "prodigal", "< $tmp_file > $tmp_file.out" ); -} else { - Maasha::Common::run( "prodigal", "< $tmp_file > $tmp_file.out 2> /dev/null" ); -} +close $fh_out; + +push @commands, "-c" if $options->{ 'full' }; +push @commands, "< $tmp_file > $tmp_file.out"; +push @commands, "2> /dev/null" unless $options->{ 'verbose' }; + +$command = join " ", @commands; + +Maasha::Common::run( "prodigal", $command ); $fh_in = Maasha::Filesys::file_read_open( "$tmp_file.out" );