X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_perl%2FMaasha%2FPlot.pm;h=34bd123024e89960ca90c0b422a85c4b79dcd10c;hb=d72b568061e47185b9d68eabe2b09a0d55fbed20;hp=4981b627d774a58e7ef209c05e2aea4c0583a58f;hpb=43a3f6b695375536014eb9626dc1b18abbbe83bb;p=biopieces.git diff --git a/code_perl/Maasha/Plot.pm b/code_perl/Maasha/Plot.pm index 4981b62..34bd123 100644 --- a/code_perl/Maasha/Plot.pm +++ b/code_perl/Maasha/Plot.pm @@ -80,7 +80,7 @@ sub lineplot_simple $options->{ "terminal" } ||= "dumb"; - $cmd = "gnuplot"; + $cmd = "gnuplot -persist"; $pid = open2( $fh_out, $fh_in, $cmd ); @@ -93,11 +93,11 @@ 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++ ) { - $title = $options->{ 'keys' }->[ $i - 1 ] || $options->{ 'list' }; + $title = $options->{ 'keys' }->[ $i - 1 ] || $options->{ 'list' } || ""; push @plot_cmd, qq("$tmp_file" using $i with lines title "$title"); } @@ -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"; @@ -502,10 +502,10 @@ sub chromosome_layout map { $_->[ 0 ] *= $factor; $_->[ 1 ] *= $factor } @{ $feat_list->{ $feat } }; } -# @list = sort { $A = $a; $B = $b; $A =~ s/chr//; $B =~ s/chr//; $A <=> $B } keys %{ $karyo_list }; + @list = sort { $A = $a; $B = $b; $A =~ s/chr//; $B =~ s/chr//; $A <=> $B } keys %{ $karyo_list }; -# splice @list, 0, 2; -# push @list, "chrX", "chrY"; + splice @list, 0, 2; + push @list, "chrX", "chrY"; $i = 0; @@ -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;