]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/patscan_seq
fixed KISS
[biopieces.git] / bp_bin / patscan_seq
index 800eac7e2b25312468bced78c4e95184543c703f..28cb5859b4162953bed7b8eeb387f2efecf29e48 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
 
 # Copyright (C) 2007-2009 Martin A. Hansen.
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
+use warnings;
 use strict;
 use Maasha::Biopieces;
+use Maasha::Common;
 use Maasha::Fasta;
 use Maasha::Filesys;
 use Maasha::Patscan;
@@ -41,8 +43,8 @@ use constant {
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-my ( $run_time_beg, $run_time_end, $options, $in, $out, $record, @args, $arg, $type, $tmp_dir,
-     $seq_file, $pat_file, $out_file, $fh_in, $fh_out, $patterns, $pattern, $entry, $result, %head_hash, $i );
+my ( $options, $in, $out, $record, @args, $arg, $type, $tmp_dir, $seq_file, $pat_file, $out_file,
+     $fh_in, $fh_out, $patterns, $pattern, $entry, $result, %head_hash, $i );
 
 $options = Maasha::Biopieces::parse_options(
     [
@@ -80,7 +82,7 @@ else
 
     while ( $record = Maasha::Biopieces::get_record( $in ) ) 
     {
-        if ( $entry = Maasha::Biopieces::biopiece2fasta( $record ) )
+        if ( $entry = Maasha::Fasta::biopiece2fasta( $record ) )
         {
             $type = Maasha::Seq::seq_guess_type( $record->{ "SEQ" } ) if not $type;
         
@@ -104,7 +106,7 @@ foreach $pattern ( @{ $patterns } )
     pat_write( $pat_file, $pattern );
 
     `scan_for_matches $arg $pat_file < $seq_file > $out_file`;
-     # Maasha::Common::run( "scan_for_matches", "$arg $pat_file < $seq_file > $out_file" );
+#     Maasha::Common::run( "scan_for_matches", "$arg $pat_file < $seq_file > $out_file" );
 
     $fh_in = Maasha::Filesys::file_read_open( $out_file );
 
@@ -137,7 +139,8 @@ unlink $pat_file;
 unlink $out_file;
 unlink $seq_file if not $options->{ 'genome' };
 
-Maasha::Filesys::dir_remove( $tmp_dir );
+Maasha::Biopieces::close_stream( $in );
+Maasha::Biopieces::close_stream( $out );
 
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SUBROUTINES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -219,20 +222,13 @@ sub pat_write
 
 BEGIN
 {
-    $run_time_beg = Maasha::Biopieces::run_time();
-
-    Maasha::Biopieces::log_biopiece();
+    Maasha::Biopieces::status_set();
 }
 
 
 END
 {
-    Maasha::Biopieces::close_stream( $in );
-    Maasha::Biopieces::close_stream( $out );
-
-    $run_time_end = Maasha::Biopieces::run_time();
-
-    Maasha::Biopieces::run_time_print( $run_time_beg, $run_time_end, $options );
+    Maasha::Biopieces::status_log();
 }
 
 
@@ -240,4 +236,3 @@ END
 
 
 __END__
-