]> git.donarmstrong.com Git - biopieces.git/commitdiff
added full switch to find_genes
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 6 May 2011 12:42:30 +0000 (12:42 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 6 May 2011 12:42:30 +0000 (12:42 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1377 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/find_genes

index 2880a3627ed18930122f7860ac5ec906f8d9152e..4ee726e974b0c994285a6570e975a20120d7330f 100755 (executable)
@@ -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" );