Package com.martiansoftware.jsap

Examples of com.martiansoftware.jsap.Switch


                .setShortFlag('n')
                .setLongFlag(JSAP.NO_LONGFLAG);

    jsap.registerParameter(opt1);

    Switch sw1 = new Switch("verbose")
            .setShortFlag('v')
            .setLongFlag("verbose");

    jsap.registerParameter(sw1);
View Full Code Here


                .setShortFlag('n')
                .setLongFlag(JSAP.NO_LONGFLAG);
   
    jsap.registerParameter(opt1);
   
    Switch sw1 = new Switch("verbose")
            .setShortFlag('v')
            .setLongFlag("verbose");
   
    jsap.registerParameter(sw1);
   
View Full Code Here

    jsap.registerParameter(opt1);
   
    // create a switch we'll access using the id "verbose".
    // it has the short flag "-v" and the long flag "--verbose"
    // this will govern whether we say "Hi" or "Hello".
    Switch sw1 = new Switch("verbose")
            .setShortFlag('v')
            .setLongFlag("verbose");
   
    jsap.registerParameter(sw1);
   
View Full Code Here

                .setLongFlag(JSAP.NO_LONGFLAG);

    opt1.setHelp("The number of times to say hello.");
    jsap.registerParameter(opt1);
   
    Switch sw1 = new Switch("verbose")
            .setShortFlag('v')
            .setLongFlag("verbose");
   
    sw1.setHelp("Requests verbose output.");
    jsap.registerParameter(sw1);
   
    UnflaggedOption opt2 = new UnflaggedOption("name")
                .setStringParser(JSAP.STRING_PARSER)
                .setDefault("World")
View Full Code Here

* @author <a href="http://www.martiansoftware.com/contact.html">Marty Lamb</a>
*/
class SwitchConfig extends FlaggedConfig {

  public Parameter getConfiguredParameter() {
    Switch result = new Switch(getId());
    super.configure(result);
    result.setShortFlag(getShortFlag());
    result.setLongFlag(getLongFlag());
    return (result);
  }
View Full Code Here

                "Location of influenza.dat"),
            new FlaggedOption("pfile", JSAP.STRING_PARSER, null, JSAP.NOT_REQUIRED, 'p', JSAP.NO_LONGFLAG,
                "location of influenza_aa.dat."),
            new FlaggedOption("count", JSAP.INTEGER_PARSER, "-1", JSAP.NOT_REQUIRED, 'l', JSAP.NO_LONGFLAG,
                "Number of records to load from file"),
            new Switch("query", 'q', "true", "Enable query cli"),
            new Switch("randomquery", 'r', "randomquery",
                "Randomly query the influenza to test that the cache is fully populated"),
            new FlaggedOption("nfile", JSAP.STRING_PARSER, null, JSAP.NOT_REQUIRED, 'n', JSAP.NO_LONGFLAG,
                "Location of influenza_na.dat") });
    if (jsap.messagePrinted())
      System.exit(1);
View Full Code Here

    jsap.registerParameter(new FlaggedOption(BSC.HEADLESS, JSAP.BOOLEAN_PARSER, "false", JSAP.NOT_REQUIRED, 'H',
        BSC.HEADLESS,
        "Headless flag. Default is 'false'. Set to 'true' if you do not want Mockey to spawn a browser thread upon startup."));

    jsap.registerParameter(new Switch(BSC.VERSION, 'v', BSC.VERSION,
        "Prints out Mockey's version (semantic versioning http://semver.org/)"));

    // parse the command line options
    JSAPResult config = jsap.parse(args);
View Full Code Here

    SimpleJSAP jsap = new SimpleJSAP(
              "spectralHMM",
              "Analyze temporal data using a spectral HMM method.",
              new Parameter[] {
          new FlaggedOption( "inputFile", myFileParser, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'f', "inputFile", "Specify an input file. See documentation for formatting." ),
          new Switch ("mutSelBalance", 'j', "mutSelBalance", "Set the initial condition to be selection-drift balance."),
          new Switch ("mutDriftBalance", 'd', "mutDriftBalance", "Set the initial condition to be mutation-drift balance."),
          new FlaggedOption( "initFrequency", JSAP.BIGDECIMAL_PARSER, "-0.5", JSAP.NOT_REQUIRED, 'i', "initFrequency", "Set the initial frequency." ),
          new FlaggedOption( "initTime", JSAP.BIGDECIMAL_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 't', "initTime", "The initial time. If not given, the initial time is expected to be in the file with each dataset. Also, this only works with multiplexing." ),
          new FlaggedOption( "mutToBenef", JSAP.BIGDECIMAL_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'a', "mutToBenef", "The mutation rate from the wild type allele to the selected allele." ),
          new FlaggedOption( "mutFromBenef", JSAP.BIGDECIMAL_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'b', "mutFromBenef", "The mutation rate from the selected allele to the wild-type allele." ),
          new FlaggedOption( "selection", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 's', "selection", "Selection coefficient s (can be a range: [start:step:stop])." ),
          new FlaggedOption( "dominance", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'h', "dominance", "Dominance parameter h (can be a range: [start:step:stop])." ),
          new FlaggedOption( "hetF", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'w', "hetF", "Fitness of the heterozygote (can be a range: [start:step:stop])." ),
          new FlaggedOption( "homF", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'v', "homF", "Fitness of the homozygote (can be a range: [start:step:stop])." ),
          new FlaggedOption( "effPopSize", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'e', "effPopSize", "The effective population size (diploid)." ),
          new FlaggedOption( "yearsPerGen", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'y', "yearsPerGen", "Specify how many years a generation takes." ),
          new FlaggedOption( "matrixCutoff", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'c', "matrixCutoff", "The cutoff for the matrix whose eigenvectors yield the coefficients for the eigenfunctions." ),
          new FlaggedOption( "maxM", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'm', "maxM", "Specify how many summands to use in the infinite sum for each eigenfunction." ),
          new FlaggedOption( "maxN", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'n', "maxN", "Specify how many eigenfunctions/-values to use in the computations." ),
          new FlaggedOption( "precision", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'p', "precision", "Specify a precision to be used for the computations. This gives the number of significant digits used." ),
          new Switch ("ignoreBinomials", 'z', "ignoreBinomials", "If set, the likelihood is calculated without the binomial coefficients required to make it a probability."),
          new Switch ("multiplex", JSAP.NO_SHORTFLAG, "multiplex", "Analyze each of the multiple datasests given in the input file using all the selection parameters specified."),
          new Switch ("condOnLastSegregating", JSAP.NO_SHORTFLAG, "condOnLastSegregating", "When set, condition on the last sample being segregating."),
              }
          );

    JSAPResult config = jsap.parse(args);
    if (jsap.messagePrinted()) { System.exit(1); }
View Full Code Here

                  .setLongFlag(JSAP.NO_LONGFLAG);

  opt7.setHelp("The method used to calculate the metrics. Use 'A' for average, use 'B' for best.");
  jsap.registerParameter(opt7);

  Switch opt8 = new Switch(Config.VERBOSE.toString()).setDefault("false")
                .setShortFlag('v')
                .setLongFlag(JSAP.NO_LONGFLAG);

  opt8.setHelp("Show verbose data during run.");
  jsap.registerParameter(opt8);

  QualifiedSwitch opt9 = (QualifiedSwitch) new QualifiedSwitch(Config.CONFIDENCE.toString()).setShortFlag('c')
                          .setLongFlag("confidence")
                          .setList(JSAP.NOT_LIST)
View Full Code Here

    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Switches">
    public void registerSwitch(String parameterName, char shortFlag) throws JSAPException {
        Switch sw1 = new Switch(parameterName)
                        .setShortFlag(shortFlag)
                        .setLongFlag(parameterName);

        registerParameter(sw1);
    }
View Full Code Here

TOP

Related Classes of com.martiansoftware.jsap.Switch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.