From 7473792b77113ead9bf77a7b4d184464f3b7f41c Mon Sep 17 00:00:00 2001 From: martinahansen Date: Wed, 22 Jul 2009 08:41:19 +0000 Subject: [PATCH] added some args to bowtie_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@577 74ccb610-7750-0410-82ae-013aeee3265d --- bp_bin/bowtie_seq | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bp_bin/bowtie_seq b/bp_bin/bowtie_seq index 3dd3ddc..c69d29c 100755 --- a/bp_bin/bowtie_seq +++ b/bp_bin/bowtie_seq @@ -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; -- 2.39.2