void DmetEngine::defineStates() {
    defineOption("", "num-rows", PgOpt::INT_OPT,
                         "The number of rows on the chip.",
                         "-1");
    defineOption("", "num-cols", PgOpt::INT_OPT,
                         "The number of cols on the chip.",
                         "-1");
    defineOption("", "probe-count", PgOpt::INT_OPT,
                         "The number of probes on the chip.",
                         "-1");
}
/**
 * @brief Define the options used by the log2 ratio engine.
 */
void CNReferenceEngine::defineOptions()
{
  defineOptionSection("Input Options");
  defineOption("","expr-summary-file", PgOpt::STRING_OPT,
                     "Expression Summary Table file.",
                     "");
  defineOption("","genotype-calls-file", PgOpt::STRING_OPT,
                     "Genotype Calls Table file.",
                     "");
  defineOption("","genotype-confidences-file", PgOpt::STRING_OPT,
                     "Genotype Confidences Table file.",
                     "");
  defineOption("","genotype-report-file", PgOpt::STRING_OPT,
                     "Genotype Report Table file.",
                     "");
//  defOptMult("", "genotype-chp-file", PgOpt::STRING_OPT, "Genotype CHP file.", "");
//  defineOption("","chrRefId", PgOpt::INT_OPT,
//                     "Reference Chromosome",
//                     "2");
  defineOption("","reference-file", PgOpt::STRING_OPT, "Copy Number Reference file.", "");

  defineOptionSection("Output Options");
  defineOption("","reference-text-output", PgOpt::BOOL_OPT,
                     "Output the reference-file in acii text format.",
                     "false");

  defineOptionSection("Analysis Options");
  defineOption("", "log2-input", PgOpt::BOOL_OPT, "Input Allele Summaries are in log2.", "false");
  defineOption("", "adapter-type-normalization", PgOpt::BOOL_OPT,
                    "Adapter Type Normalization option. true = perform adapter type normalization.",
                    "true");

  defineOptionSection("Advanced Options");
  defineOption("", "set-analysis-name", PgOpt::STRING_OPT, "Analysis name to use as prefix for output files.", "");

  defineOptionSection("Execution Control Options");
  defineOption("", "mem-usage", PgOpt::INT_OPT,
                     "How many MB of memory to use for this run.",
                     "0");

  defineSharedOptions();
}
Example #3
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    SQArgDescMap		optionDesc;
    QMap<QString, QVariant> option;

    if (argc < 2)
    {
        std::cerr << "Too few arguments, syntax is : -sub subfile videofile" << std::endl;
        return 1;
    }
    sq_add_gsttoyunda_plugin_path(qApp->applicationDirPath());
    try {
        QGst::init(&argc, &argv);
    } catch (QGlib::Error qgerr)
    {
        std::cerr << "Can't init gstreamer" << std::endl;
        return 1;
    }
    qInstallMessageHandler(myMessageOutput);
    defineOption(optionDesc);
    QStringList arg = a.arguments();
    arg.removeFirst();
    bool vopt = SQArg::fillWithDesc(option, arg, optionDesc);
    if (vopt == false)
        return 1;

    VideoPlayer w("");

    qDebug() << option["base_image_path"].toString();
    if (!option["base_image_path"].toString().isEmpty())
        w.setToyundaImagePath(option["base_image_path"].toString());
    std::cout << "Subtitle file : " << option["subtitle"].toString().constData() << std::endl;
    std::cout << "Video File    : " << arg[0].constData() << std::endl;
    w.setVideoFile(arg[0]);
    w.setSubFile(option["subtitle"].toString());
    w.show();
    w.play();
    w.show();
    return a.exec();
}
Example #4
0
int runMoc(int argc, char **argv)
{
    QCoreApplication app(argc, argv);
    QCoreApplication::setApplicationVersion(QString::fromLatin1(QT_VERSION_STR));

    bool autoInclude = true;
    bool defaultInclude = true;
    Preprocessor pp;
    Moc moc;
    pp.macros["Q_MOC_RUN"];
    pp.macros["__cplusplus"];

    // Don't stumble over GCC extensions
    Macro dummyVariadicFunctionMacro;
    dummyVariadicFunctionMacro.isFunction = true;
    dummyVariadicFunctionMacro.isVariadic = true;
    dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__");
    pp.macros["__attribute__"] = dummyVariadicFunctionMacro;
    pp.macros["__declspec"] = dummyVariadicFunctionMacro;

    QString filename;
    QString output;
    QFile in;
    FILE *out = 0;

    // Note that moc isn't translated.
    // If you use this code as an example for a translated app, make sure to translate the strings.
    QCommandLineParser parser;
    parser.setApplicationDescription(QStringLiteral("Qt Meta Object Compiler version %1 (Qt %2)")
                                     .arg(mocOutputRevision).arg(QString::fromLatin1(QT_VERSION_STR)));
    parser.addHelpOption();
    parser.addVersionOption();

    QCommandLineOption outputOption(QStringLiteral("o"));
    outputOption.setDescription(QStringLiteral("Write output to file rather than stdout."));
    outputOption.setValueName(QStringLiteral("file"));
    parser.addOption(outputOption);

    QCommandLineOption includePathOption(QStringLiteral("I"));
    includePathOption.setDescription(QStringLiteral("Add dir to the include path for header files."));
    includePathOption.setValueName(QStringLiteral("dir"));
    parser.addOption(includePathOption);

    QCommandLineOption macFrameworkOption(QStringLiteral("F"));
    macFrameworkOption.setDescription(QStringLiteral("Add Mac framework to the include path for header files."));
    macFrameworkOption.setValueName(QStringLiteral("framework"));
    parser.addOption(macFrameworkOption);

    QCommandLineOption preprocessOption(QStringLiteral("E"));
    preprocessOption.setDescription(QStringLiteral("Preprocess only; do not generate meta object code."));
    parser.addOption(preprocessOption);

    QCommandLineOption defineOption(QStringLiteral("D"));
    defineOption.setDescription(QStringLiteral("Define macro, with optional definition."));
    defineOption.setValueName(QStringLiteral("macro[=def]"));
    parser.addOption(defineOption);

    QCommandLineOption undefineOption(QStringLiteral("U"));
    undefineOption.setDescription(QStringLiteral("Undefine macro."));
    undefineOption.setValueName(QStringLiteral("macro"));
    parser.addOption(undefineOption);

    QCommandLineOption metadataOption(QStringLiteral("M"));
    metadataOption.setDescription(QStringLiteral("Add key/value pair to plugin meta data"));
    metadataOption.setValueName(QStringLiteral("key=value"));
    parser.addOption(metadataOption);

    QCommandLineOption noIncludeOption(QStringLiteral("i"));
    noIncludeOption.setDescription(QStringLiteral("Do not generate an #include statement."));
    parser.addOption(noIncludeOption);

    QCommandLineOption pathPrefixOption(QStringLiteral("p"));
    pathPrefixOption.setDescription(QStringLiteral("Path prefix for included file."));
    pathPrefixOption.setValueName(QStringLiteral("path"));
    parser.addOption(pathPrefixOption);

    QCommandLineOption forceIncludeOption(QStringLiteral("f"));
    forceIncludeOption.setDescription(QStringLiteral("Force #include <file> (overwrite default)."));
    forceIncludeOption.setValueName(QStringLiteral("file"));
    parser.addOption(forceIncludeOption);

    QCommandLineOption prependIncludeOption(QStringLiteral("b"));
    prependIncludeOption.setDescription(QStringLiteral("Prepend #include <file> (preserve default include)."));
    prependIncludeOption.setValueName(QStringLiteral("file"));
    parser.addOption(prependIncludeOption);

    QCommandLineOption noNotesWarningsCompatOption(QStringLiteral("n"));
    noNotesWarningsCompatOption.setDescription(QStringLiteral("Do not display notes (-nn) or warnings (-nw). Compatibility option."));
    noNotesWarningsCompatOption.setValueName(QStringLiteral("which"));
    parser.addOption(noNotesWarningsCompatOption);

    QCommandLineOption noNotesOption(QStringLiteral("no-notes"));
    noNotesOption.setDescription(QStringLiteral("Do not display notes."));
    parser.addOption(noNotesOption);

    QCommandLineOption noWarningsOption(QStringLiteral("no-warnings"));
    noWarningsOption.setDescription(QStringLiteral("Do not display warnings (implies --no-notes)."));
    parser.addOption(noWarningsOption);

    QCommandLineOption ignoreConflictsOption(QStringLiteral("ignore-option-clashes"));
    ignoreConflictsOption.setDescription(QStringLiteral("Ignore all options that conflict with compilers, like -pthread conflicting with moc's -p option."));
    parser.addOption(ignoreConflictsOption);

    parser.addPositionalArgument(QStringLiteral("[header-file]"),
            QStringLiteral("Header file to read from, otherwise stdin."));
    parser.addPositionalArgument(QStringLiteral("[@option-file]"),
            QStringLiteral("Read additional options from option-file."));

    const QStringList arguments = argumentsFromCommandLineAndFile(app.arguments());

    parser.process(arguments);

    const QStringList files = parser.positionalArguments();
    if (files.count() > 1) {
        error("Too many input files specified");
        parser.showHelp(1);
    } else if (!files.isEmpty()) {
        filename = files.first();
    }

    const bool ignoreConflictingOptions = parser.isSet(ignoreConflictsOption);
    output = parser.value(outputOption);
    pp.preprocessOnly = parser.isSet(preprocessOption);
    if (parser.isSet(noIncludeOption)) {
        moc.noInclude = true;
        autoInclude = false;
    }
    if (!ignoreConflictingOptions) {
        if (parser.isSet(forceIncludeOption)) {
            moc.noInclude = false;
            autoInclude = false;
            foreach (const QString &include, parser.values(forceIncludeOption)) {
                moc.includeFiles.append(QFile::encodeName(include));
                defaultInclude = false;
             }
        }
        foreach (const QString &include, parser.values(prependIncludeOption))
            moc.includeFiles.prepend(QFile::encodeName(include));
        if (parser.isSet(pathPrefixOption))
            moc.includePath = QFile::encodeName(parser.value(pathPrefixOption));
    }
Example #5
0
int	main(int ac, char *ag[])
{
  QToyunda              *toyunda;
  QApplication		*qapp;
  SQArgDescMap		optionDesc;
  QMap<QString, QVariant> option;
  QDebugErrorHandler    *errorHandler;

  errorHandler = new QDebugErrorHandler();
  defineOption(optionDesc);
  qapp = new QApplication(ac, ag);
  // Handle arguments
  QStringList arg = qapp->arguments();
  arg.removeFirst();
  bool vopt = SQArg::fillWithDesc(option, arg, optionDesc);
  // Help
  if (option["help"].toBool() || vopt == false) {
    QTextStream cout(stdout);
    cout << "QToyunda\nSynopsis : ";
    cout << "./qtoyunda --player playername --renderer renderername --video videofile --subtitle subtitlefile\n\n";
    cout.flush();
    if (option["help"].toBool()) {
      cout << "All option available :\n";
      cout.flush();
      SQArg::generateLongHelp(optionDesc);
      return 0;
    }
    return 1;
  }
  // Player and renderer option
  QStringList playerOption;
  if (!option["playeroption"].toString().isEmpty())
      playerOption = option["playeroption"].toString().split(",");
  QStringList rendererOption;
  if (!option["rendereroption"].toString().isEmpty())
      rendererOption = option["rendereroption"].toString().split(",");
  rendererOption << "logo=:/main/Toyunda logo.png";
  qDebug() << rendererOption;
  toyunda = new QToyunda(errorHandler);
  toyunda->setPlayerName(option["player"].toString());
  toyunda->setRendererName(option["renderer"].toString());
  toyunda->setPlayerOption(playerOption);
  toyunda->setRendererOption(rendererOption);

  QDir pluginPath = qApp->applicationDirPath();
  pluginPath.cd("plugins");
  toyunda->setPluginDirectory(pluginPath);
  toyunda->loadPlugins();

  // FIXME playeroptionhelp and roh must not depend and toyunda
  if (option["playeroptionhelp"].toBool()) {
    toyunda->showPlayerOption();
    return 0;
  }
  if (option["rendereroptionhelp"].toBool()) {
    toyunda->showRendererOption();
    return 0;
  }
  qDebug() << "Init toyunda";
  if (!toyunda->init())
  {
      qCritical() << "Can't init qtoyunda, abord";
      return 1;
  }
  qDebug() << "Load files";
  toyunda->load(option["video"].toString(), option["subtitle"].toString());
  qDebug() << "Play the video";
  toyunda->play();
  toyunda->showRenderer();
  int ret = qapp->exec();
  toyunda->dispose();
  return ret;
}
void DmetEngine::defineOptions() {

    defineOptionSection("Input Options");
        defineOption("", "cel-files", PgOpt::STRING_OPT,
                     "Text file specifying cel files to process, one per line with the first line being 'cel_files'.",
                     "");
        defineOption("c", "cdf-file", PgOpt::STRING_OPT,
                     "File defining probe sets. Use either --cdf-file or --spf-file. ",
                     "");
        defineOption("", "spf-file", PgOpt::STRING_OPT,
                     "File defining probe sets in spf (simple probe format) which is like a text cdf file.",
                     "");
        defineOption("", "special-snps",PgOpt::STRING_OPT,
                    "File containing all snps of unusual copy (chrX,mito,Y)",
                    "");
        defineOption("", "chrX-probes", PgOpt::STRING_OPT,
                     "File containing probe_id (1-based) of probes on chrX. "
                     "Used for copy number probe chrX/Y ratio gender calling. ",
                     "");
        defineOption("", "chrY-probes", PgOpt::STRING_OPT,
                     "File containing probe_id (1-based) of probes on chrY. "
                     "Used for copy number probe chrX/Y ratio gender calling. ",
                     "");
        defineOption("", "reference-input", PgOpt::STRING_OPT,
                     "Reference file with cluster prior information. ",
                     "");
        defineOption("s", "probeset-ids", PgOpt::STRING_OPT,
                     "Tab delimited file with column 'probeset_id' specifying probesets to analyze.",
                     "");
        defineOption("", "probeset-ids-reported", PgOpt::STRING_OPT,
                     "Tab delimited file with column 'probeset_id' specifying probesets to report. "
                     "This should be a subset of those specified with --probeset-ids if that option is used.",
                     "");
        defOptMult("", "chip-type", PgOpt::STRING_OPT,
                     "Chip types to check library and CEL files against. "
                     "Can be specified multiple times. "
                     "The first one is propigated as the chip type in the output files. "
                     "Warning, use of this option will override the usual check between chip types "
                     "found in the library files and cel files. You should use this option instead "
                     "of --force when possible. ",
                     "");
        defineOption("", "region-model", PgOpt::STRING_OPT,
                     "Regions model parameters. ",
                     "");
        defineOption("", "probeset-model", PgOpt::STRING_OPT,
                     "Probeset model parameters. ",
                     "");
	defineOption("", "cn-region-gt-probeset-file", 
			       PgOpt::STRING_OPT,
			       "Tab delimited file mapping probeset ids to copynumber regions. ",
			       "");

    defineOptionSection("Output Options");
        defineOption("", "cc-chp-output", PgOpt::BOOL_OPT,
                    "Output resulting calls in directory called 'chp' under out-dir. "
                    "This makes one AGCC Multi Data CHP file per cel file analyzed.",
                    "false");
        defineOption("", "reference-output", PgOpt::STRING_OPT,
                     "File to write reference values to. Specifying this option will turn on "
                     "dynamic clustering. WARNING: Currently the "
                     "resulting reference file is not really usable as a reference. "
                     "See the manual for more info. ",
                     "");
        defineOption("", "batch-name", PgOpt::STRING_OPT,
                     "The name of the batch for the dynamic cluster analysis. ",
                     "");

    defineOptionSection("Analysis Options");
        defineOption("", "set-analysis-name", PgOpt::STRING_OPT,
                  "Explicitly set the analysis name. This affects output file names (ie prefix) and various meta info.",
                    "dmet");
        defineOption("", "ps-analysis", PgOpt::STRING_OPT,
                  "Explicitly set the ProbesetSummarizeEngine analysis string.",
                  "");
        defineOption("", "gt-analysis", PgOpt::STRING_OPT,
                  "Explicitly set the ProbesetGenotypeEngine analysis string.",
                  "");
        defineOption("", "gt-qmethod-spec", PgOpt::STRING_OPT,
                  "Explicitly set the ProbesetGenotypeEngine quant spec.",
                  "");
        defineOption("", "sample-type", PgOpt::STRING_OPT,
                    "Set the type of samples being processed. eg genomic, plasmid.",
                    "unknown");
        defineOption("", "batch-info", PgOpt::BOOL_OPT,
                    "Indicates whether or not information about other cel files in the batch "
                    "should be reported in CHP headers.",
                    "false");
        defineOption("", "null-context", PgOpt::BOOL_OPT,
                    "Indicates whether or not context info should be populated in the CHP files.",
                    "true");
        defineOption("", "run-cn-engine", PgOpt::BOOL_OPT,
                  "Indicates if the CN engine should be run or not.",
                    "true");
        defineOption("", "pra-thresh", PgOpt::INT_OPT,
                  "The threshold for calling PRAs based on the cluster mean strength.",
                  "3");
        defineOption("", "geno-call-thresh", PgOpt::DOUBLE_OPT,
                  "The confidence threshold for reporting calls in the CHP file.",
                  "0.1");

    defineOptionSection("Gender Options");

        defineOption("", "female-thresh", PgOpt::DOUBLE_OPT,
                    "Threshold for calling females when using cn-probe-chrXY-ratio method.",
                    "0.17");
        defineOption("", "male-thresh", PgOpt::DOUBLE_OPT,
                    "Threshold for calling females when using cn-probe-chrXY-ratio method.",
                    "0.68");

    defineOptionSection("Advanced Options");
        defineOption("", "call-coder-max-alleles", PgOpt::INT_OPT,
                    "For encoding/decoding calls, the max number of alleles per marker to allow.",
                    "6");
        defineOption("", "call-coder-type", PgOpt::STRING_OPT,
                    "The data size used to encode the call.",
                    "UCHAR");
        defineOption("", "call-coder-version", PgOpt::STRING_OPT,
                    "The version of the encoder/decoder to use",
                    "1.0");

    defineOptionSection("Execution Control Options");
        defineOption("", "use-disk", PgOpt::BOOL_OPT,
                     "Store CEL intensities to be analyzed on disk.", "true");
        defineOption("", "disk-cache", PgOpt::INT_OPT,
                     "Size of intensity memory cache in millions of intensities (when --use-disk=true).",
                     "50");

    defineOptionSection("Engine Options (Not used on command line)");
        defOptMult("", "cels", PgOpt::STRING_OPT,
                     "Cel files to process.",
                     "");
        defOptMult("", "report", PgOpt::STRING_OPT,
                     "Probesets to report. eg consented.",
                     "");
}