Last active
December 17, 2015 02:29
-
-
Save alexpreynolds/5535721 to your computer and use it in GitHub Desktop.
eulergrid.pl is a wrapper script to call plotEulergrid.R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use Getopt::Long; | |
# ------------------------------------------------------------------------------------------- | |
# options | |
my ($plotTitle, $offCellColor, $onCellColor, $setNames, $setCardinalities, $setTotal, $setTotalWithout, $outputFilename, $showWholeSets, $rGraphScript, $ctsCounts); | |
my $optResult = GetOptions ("plotTitle=s" => \$plotTitle, "offCellColor=s" => \$offCellColor, "onCellColor=s" => \$onCellColor, "setNames=s" => \$setNames, "setCardinalities=s" => \$setCardinalities, "setTotal=s" => \$setTotal, "setTotalWithout=s" => \$setTotalWithout, "outputFilename=s" => \$outputFilename, "showWholeSets=s" => \$showWholeSets, "rGraphScript=s" => \$rGraphScript, "ctsCounts=s" => \$ctsCounts); | |
if (!$plotTitle) { die "specify --plotTitle=str\n"; } | |
if (!$offCellColor) { $offCellColor = "red"; } | |
if (!$onCellColor) { $onCellColor = "green"; } | |
if (!$setNames) { die "specify --setNames=a1,a2,a3,...,aN\n"; } | |
if (!$setCardinalities) { die "specify --setCardinalities=c1,c2,c3,...,cN,c1^c2,c1^c3,...,c1^c2^c3^...^cN\n"; } | |
if (!$setTotal) { die "specify --setTotal=n\n"; } | |
if (!$setTotalWithout) { $setTotalWithout = -1; } | |
if (!$outputFilename) { die "specify --outputFilename=str.png|ps\n"; } | |
if (!$ctsCounts) { die "specify --ctsCounts=cts1,cts2,...,ctsN\n"; } | |
if (!$showWholeSets) { $showWholeSets = -1; } else { $showWholeSets = 1; } | |
if (!$rGraphScript) { $rGraphScript = "/home/areynolds/proj/eulergrid/src/plotEulergrid.R"; } | |
# ------------------------------------------------------------------------------------------- | |
# main | |
my $rScriptSys = "R CMD BATCH --no-save --no-restore \"--args plotTitle=\\\"$plotTitle\\\" offCellColor=\\\"$offCellColor\\\" onCellColor=\\\"$onCellColor\\\" setNames=\\\"$setNames\\\" setCardinalities=\\\"$setCardinalities\\\" setTotal=\\\"$setTotal\\\" setTotalWithout=\\\"$setTotalWithout\\\" outputFilename=\\\"$outputFilename\\\" showWholeSets=\\\"$showWholeSets\\\" ctsCounts=\\\"$ctsCounts\\\"\" $rGraphScript runtime.log 2>&1"; | |
system ($rScriptSys) == 0 or die "R script failed $?"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment