Bio-Grid-Run-SGE
view release on metacpan or search on metacpan
bin/distribution view on Meta::CPAN
my $pseudoCnt = 0;
my $size = '';
my $width = 80;
my $height = 15;
my $widthArg = 0;
my $heightArg = 0;
my $logarithmic = 0;
my $numOnly = '';
# character for ease of eye to scan left/right/up/down
my $histogramChar = "+";
my $unicode = 0;
my $tokenize = 0;
# by default, everything matches (nothing is stripped out)
my $matchRegexp = ".";
# status and summary statistics
my $verbose = 0;
# how often to give status if verbose
my $statInterval = 0.5;
# whether or not to parse input into bins (if data is pre-summarised and we're
# just presenting results)
my $graphValues = "";
bin/distribution view on Meta::CPAN
($regularColour, $keyColour, $ctColour, $pctColour, $graphColour) = @cp;
}
# for advanced graphing
my $verticalBlocks = ["â", "â", "â", "â", "â
", "â", "â", "â"]; # for future?
my $partialBlocks = ["â", "â", "â", "â", "â", "â", "â", "â"]; # char=pb
my $partialCircles = ["â", "â"]; # char=pc
my $partialLines = ["â¸", "â¾", "â"]; # char=hl
# some useful substitutions for prettiness
if ($histogramChar eq "ba") { $unicode = 1; $histogramChar = "â¬"; }
elsif ($histogramChar eq "bl") { $unicode = 1; $histogramChar = "Î"; }
elsif ($histogramChar eq "em") { $unicode = 1; $histogramChar = "â"; }
elsif ($histogramChar eq "me") { $unicode = 1; $histogramChar = "â¯"; }
elsif ($histogramChar eq "di") { $unicode = 1; $histogramChar = "â¦"; }
elsif ($histogramChar eq "dt") { $unicode = 1; $histogramChar = "â¢"; }
elsif ($histogramChar eq "sq") { $unicode = 1; $histogramChar = "â¡"; }
# high-bit set means we're not in ASCIIland anymore
if (ord (substr ($histogramChar, 0, 1)) >= 128) { $unicode = 1; }
# sub-full character width graphing systems
my $charWidth = 1;
my $graphChars = undef;
if ($histogramChar eq "pb") {
$charWidth = 0.125;
$graphChars = $partialBlocks;
} elsif ($histogramChar eq "pc") {
$charWidth = 0.5;
$graphChars = $partialCircles;
bin/distribution view on Meta::CPAN
# spaces 'til time to print the bar
for ($j = length ($ctText->[$i]) + length ($pctText->[$i]); $j <= $maxPreBarLen; $j++) { print " "; }
print $graphColour;
for ($j = 0; $j < int ($barWidth->[$i] * $maxBarWidth); $j++) {
if ($charWidth < 1) {
# print out maximum-width character (always last in array)
print $graphChars->[scalar @$graphChars - 1];
} else {
# we're printing regular non-unicode characters
if (length ($histogramChar) > 1 && !$unicode) {
# but still we have >1 byte! so print initial byte
# for all but the last character (printed outside loop)
print substr ($histogramChar, 0, 1);
} else {
print $histogramChar;
}
}
}
my $count = $valuesDict->{$sortedKeys[$i]};
bin/distribution view on Meta::CPAN
if ($barWidth->[$i] * $maxBarWidth > $charWidth) {
# we have more than charWidth remainder, so print out a
# remainder portion
print $graphChars->[$whichChar];
} else {
# we had minimum remainder, so print minimum-width
# character just print the minimum-width portion
print $graphChars->[0];
}
} else {
# we're printing regular non-unicode characters
if (length ($histogramChar) > 1 && !$unicode) {
# but still we have >1 byte! so print final byte of input string
print substr ($histogramChar, -1, 1);
} else {
print $histogramChar;
}
}
}
# FIXME: even with all these colour-printing antics, still one key will
# be printed with the wrong colour on sorted output most of the time,
bin/distribution view on Meta::CPAN
print " [--char=<barChars>|<substitutionString>]\n";
print " [--help] [--verbose]\n";
print " --char=C character(s) to use for histogram character, some substitutions follow:\n";
print " ba (â¬) Bar\n";
print " bl (Î) Building\n";
print " em (â) Emdash\n";
print " me (â¯) Mid-Elipses\n";
print " di (â¦) Diamond\n";
print " dt (â¢) Dot\n";
print " sq (â¡) Square\n";
print " hl Use 1/3-width unicode partial lines to simulate 3x actual terminal width\n";
print " pb Use 1/8-width unicode partial blocks to simulate 8x actual terminal width\n";
print " pc Use 1/2-width unicode partial circles to simulate 2x actual terminal width\n";
print " --color colourise the output\n";
print " --graph[=G] input is already key/value pairs. vk is default:\n";
print " kv input is ordered key then value\n";
print " vk input is ordered value then key\n";
print " --height=N height of histogram, headers non-inclusive, overrides --size\n";
print " --help get help\n";
print " --logarithmic logarithmic graph\n";
print " --match=RE only match lines (or tokens) that match this regexp, some substitutions follow:\n";
print " word ^[A-Z,a-z]+\$ - tokens/lines must be entirely alphabetic\n";
print " num ^\\d+\$ - tokens/lines must be entirely numeric\n";
( run in 0.364 second using v1.01-cache-2.11-cpan-88abd93f124 )