]> git.donarmstrong.com Git - biopieces.git/commitdiff
added some args to bowtie_seq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 22 Jul 2009 08:41:19 +0000 (08:41 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 22 Jul 2009 08:41:19 +0000 (08:41 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@577 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/bowtie_seq

index 3dd3ddc9ceef293da023bd018088c8df07fae630..c69d29c9f8d71560c94c911351320aeb90cc97ec 100755 (executable)
@@ -38,11 +38,13 @@ use Maasha::Calc;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-my ( $options, $in, $out, $index, $tmp_dir, $tmp_in, $tmp_out, $fh_in, $fh_out, $record, $entry, $line, @fields, $type, $args );
+my ( $options, $in, $out, $index, $tmp_dir, $tmp_in, $tmp_out, $fh_in, $fh_out, $record, $entry, $line, @fields, $type, @args, $arg );
 
 $options = Maasha::Biopieces::parse_options(
     [
-        { long => 'genome', short => 'g', type => 'genome', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
+        { long => 'genome',     short => 'g', type => 'genome', mandatory => 'yes', default => undef, allowed => undef,     disallowed => undef },
+        { long => 'mismatches', short => 'm', type => 'uint',   mandatory => 'no',  default => 2,     allowed => "0,1,2,3", disallowed => undef },
+        { long => 'max_hits',   short => 'h', type => 'uint',   mandatory => 'no',  default => undef, allowed => undef,     disallowed => 0     },
     ]   
 );
 
@@ -79,13 +81,21 @@ while ( $record = Maasha::Biopieces::get_record( $in ) )
 
 close $fh_out;
 
-$args = "";
-$args = "-f" if $type eq "FASTA";
+push @args, "-n $options->{ 'mismatches' }";
+push @args, "-f" if $type eq "FASTA";
+
+if ( defined $options->{ 'max_hits' } ) {
+    push @args, "-k $options->{ 'max_hits' }";
+} else {
+    push @args, "-a";
+}
+
+$arg = join " ", @args;
 
 if ( $options->{ 'verbose' } ) {
-    Maasha::Common::run( "bowtie", "$args $index $tmp_in $tmp_out" );
+    Maasha::Common::run( "bowtie", "$arg $index $tmp_in $tmp_out" );
 } else {
-    Maasha::Common::run( "bowtie", "$args $index $tmp_in $tmp_out > /dev/null 2>&1" );
+    Maasha::Common::run( "bowtie", "$arg $index $tmp_in $tmp_out > /dev/null 2>&1" );
 }
 
 unlink $tmp_in;