# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-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 },
]
);
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;