From: martinahansen Date: Thu, 20 Aug 2009 12:57:01 +0000 (+0000) Subject: finished rescan_seq X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=12462f9b3f5475dae288a9936b5a3bae7f969d68;p=biopieces.git finished rescan_seq git-svn-id: http://biopieces.googlecode.com/svn/trunk@642 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/rescan_seq b/bp_bin/rescan_seq index 0e431ee..826a1f2 100755 --- a/bp_bin/rescan_seq +++ b/bp_bin/rescan_seq @@ -41,9 +41,10 @@ my ( $options, $in, $out, $record, $re_data, $re, $matches, $match, %re_hash, $r $options = Maasha::Biopieces::parse_options( [ - { long => 'res_enz', short => 'r', type => 'list', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, - { long => 'res_enz_in', short => 'R', type => 'file!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, - { long => 'no_matches', short => 'M', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, + { long => 'res_enz', short => 'r', type => 'list', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, + { long => 'res_enz_in', short => 'R', type => 'file!', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, + { long => 'res_enz_only', short => 'o', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, + { long => 'no_matches', short => 'M', type => 'flag', mandatory => 'no', default => undef, allowed => undef, disallowed => undef }, ] ); @@ -70,6 +71,7 @@ while ( $record = Maasha::Biopieces::get_record( $in ) ) $matches = Maasha::RestrictEnz::re_scan( $record->{ 'SEQ' }, $re ); + %{ $new_record } = %{ $record } if not $options->{ 'res_enz_only' }; $new_record->{ 'RE' } = $re->{ 'name' }; $new_record->{ 'RE_COUNT' } = scalar @{ $matches }; $new_record->{ 'RE_MATCHES' } = join( ";", @{ $matches } ) if not $options->{ 'no_matches' }; diff --git a/code_perl/Maasha/RestrictEnz.pm b/code_perl/Maasha/RestrictEnz.pm index 1974439..836835b 100644 --- a/code_perl/Maasha/RestrictEnz.pm +++ b/code_perl/Maasha/RestrictEnz.pm @@ -129,7 +129,7 @@ void scan( char *seq, char *pat, int seq_len, int pat_len ) Inline_Stack_Vars; Inline_Stack_Reset; - for ( i = 0; i < seq_len - pat_len; i++ ) + for ( i = 0; i < seq_len - pat_len + 1; i++ ) { if ( match( &seq[ i ], pat, pat_len ) ) { Inline_Stack_Push( sv_2mortal( newSViv( i ) ) );