]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Plot.pm
changed to new find_adaptor
[biopieces.git] / code_perl / Maasha / Plot.pm
index 906b7ac8daf6660eb21d5652b92f9a18e68247aa..34bd123024e89960ca90c0b422a85c4b79dcd10c 100644 (file)
@@ -80,7 +80,7 @@ sub lineplot_simple
 
     $options->{ "terminal" } ||= "dumb";
 
-    $cmd  = "gnuplot";
+    $cmd  = "gnuplot -persist";
 
     $pid = open2( $fh_out, $fh_in, $cmd );
 
@@ -93,7 +93,7 @@ sub lineplot_simple
     print $fh_in "set logscale y\n"                        if $options->{ "logscale_y" };
     print $fh_in "set grid\n"                              if not $options->{ "terminal" } eq "dumb";
     print $fh_in "set autoscale\n";
-    print $fh_in "set xtics border in scale 0 nomirror rotate by 90 offset character 0, 0, 0\n";
+    print $fh_in "set xtics rotate by -90\n";
 
     for ( $i = 1; $i < scalar @{ $data->[ 0 ] } + 1; $i++ )
     {
@@ -141,7 +141,7 @@ sub histogram_simple
 
     $options->{ "terminal" } ||= "dumb";
 
-    $cmd  = "gnuplot";
+    $cmd  = "gnuplot -persist";
 
     $pid = open2( $fh_out, $fh_in, $cmd );
 
@@ -158,7 +158,7 @@ sub histogram_simple
     print $fh_in "set style fill solid\n";
     print $fh_in "set style histogram title offset character 0, 0, 0\n";
     print $fh_in "set style data histograms\n";
-    print $fh_in "set xtics border in scale 0 nomirror rotate by 90 offset character 0, 0, 0\n";
+    print $fh_in "set xtics border in scale 0 nomirror rotate by -90 offset character 0, 0, 0\n";
     print $fh_in "plot '-' using 2:xticlabels(1)\n";
 
     for ( $i = 0; $i < @{ $data }; $i++ )
@@ -223,7 +223,7 @@ sub histogram_lendist
         $xtic_space = 50000;
     }
 
-    $cmd  = "gnuplot";
+    $cmd  = "gnuplot -persist";
 
     $pid = open2( $fh_out, $fh_in, $cmd );
 
@@ -281,7 +281,7 @@ sub histogram_chrdist
 
     $options->{ "terminal" } ||= "dumb";
 
-    $cmd  = "gnuplot";
+    $cmd  = "gnuplot -persist";
 
     $pid = open2( $fh_out, $fh_in, $cmd );
 
@@ -295,7 +295,7 @@ sub histogram_chrdist
     print $fh_in "set style fill solid\n";
     print $fh_in "set style histogram title offset character 0, 0, 0\n";
     print $fh_in "set style data histograms\n";
-    print $fh_in "set xtics border in scale 0 nomirror rotate by 90 offset character 0, 0, 0\n";
+    print $fh_in "set xtics border in scale 0 nomirror rotate by -90 offset character 0, 0, 0\n";
 
     print $fh_in "plot '-' using 2:xticlabels(1)\n";
 
@@ -542,6 +542,8 @@ sub find_cent
     push @nums, $acen->[ 1 ]->[ 1 ];
     push @nums, $acen->[ 1 ]->[ 2 ];
 
+
+    @nums = grep { defined $_ } @nums;   # FIXME
     @nums = sort { $a <=> $b } @nums;
 
     $cent = ( $nums[ 1 ] + $nums[ 2 ] ) / 2;
@@ -769,7 +771,7 @@ sub seq_logo
 
     $type = Maasha::Seq::seq_guess_type( $entries->[ 0 ]->[ 1 ] );
 
-    if ( $type =~ /^p/i ) {
+    if ( $type eq "PROTEIN" ) {
         $bit_max = 4;
     } else {
         $bit_max = 2;