X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fplot_matches;h=b5d5ed11c70405f8bbd622655e228e9212775e99;hb=62ccc0892d1ec2497796aa340bf97c663511996f;hp=a2d97cf76b02aead93c80caa1041a3e493a80676;hpb=c11bd52c815bb8ad844ef837d41c9b5aa0bc2bdb;p=biopieces.git diff --git a/bp_bin/plot_matches b/bp_bin/plot_matches index a2d97cf..b5d5ed1 100755 --- a/bp_bin/plot_matches +++ b/bp_bin/plot_matches @@ -1,4 +1,4 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # Copyright (C) 2007-2009 Martin A. Hansen. @@ -26,6 +26,7 @@ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +use warnings; use strict; use Maasha::Biopieces; use Maasha::Plot; @@ -36,7 +37,7 @@ use IPC::Open2; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $run_time_beg, $run_time_end, $options, $in, $out, $default, $terminals, $record, @data, $fh, $result, %data_hash, $tmp_dir ); +my ( $options, $in, $out, $default, $terminals, $record, @data, $fh, $result, %data_hash, $tmp_dir ); $default = "plot_matches"; $terminals = "dumb,x11,aqua,post,svg"; @@ -78,7 +79,8 @@ print $fh "$_\n" foreach @{ $result }; close $fh; -Maasha::Filesys::dir_remove( $tmp_dir ); +Maasha::Biopieces::close_stream( $in ); +Maasha::Biopieces::close_stream( $out ); # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SUBROUTINES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @@ -111,7 +113,7 @@ sub dotplot_matches foreach $match ( @{ $matches } ) { - if ( $match->{ "DIR" } =~ /^f/ ) + if ( ($match->{ "DIR" } and $match->{ "DIR" } =~ /^f/) or ($match->{ "STRAND" } and $match->{ "STRAND" } eq '+') ) { print $fh_forward join( "\t", $match->{ "Q_BEG" } + 1, $match->{ "S_BEG" } + 1 ), "\n"; print $fh_forward join( "\t", $match->{ "Q_END" } + 1, $match->{ "S_END" } + 1 ), "\n"; @@ -134,7 +136,7 @@ sub dotplot_matches close $fh_forward; close $fh_backward; - $cmd = "gnuplot"; + $cmd = "gnuplot -persist"; $pid = open2( $fh_out, $fh_in, $cmd ); @@ -189,20 +191,13 @@ sub dotplot_matches 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(); } @@ -210,4 +205,3 @@ END __END__ -