]> git.donarmstrong.com Git - biopieces.git/commitdiff
added format to compute
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 21 Sep 2009 07:56:31 +0000 (07:56 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 21 Sep 2009 07:56:31 +0000 (07:56 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@681 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/compute

index 0b2e280c30203114b4ec8bc32eaa71181301cfe8..93206f06d5f5380bdbd30f1b8805fce989040c9c 100755 (executable)
@@ -39,7 +39,8 @@ my ( $options, $in, $out, $record, $eval_key, @keys, $eval_val );
 
 $options = Maasha::Biopieces::parse_options(
     [
-        { long => 'eval', short => 'e', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
+        { long => 'eval',   short => 'e', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
+        { long => 'format', short => 'f', type => 'string', mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
     ]   
 );
 
@@ -64,6 +65,7 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
         $record->{ $eval_key } = eval "$eval_val";
         Maasha::Common::error( qq(eval "$eval_key = $eval_val" failed -> $@) ) if $@;
+        $record->{ $eval_key } = sprintf( $options->{ 'format' }, $record->{ $eval_key } ) if $options->{ 'format' };
     }
     else
     {