-#!/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;
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-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 );
+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(
[
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;
close $fh_out;
- $arg .= " -p" if $type eq "protein";
+ $arg .= " -p" if $type eq "PROTEIN";
}
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 );
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 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
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();
}
__END__
-