예제 #1
0
bool CTestDiagApp::TestApp_Args(CArgDescriptions& args)
{
    args.AddPositional("case_number",
                       "case number",
                       CArgDescriptions::eInteger);

    args.SetConstraint("case_number",
                       new CArgAllow_Integers(1, 47));

    return true;
}
예제 #2
0
bool CTestCacheApp::TestApp_Args(CArgDescriptions& args)
{
    args.AddDefaultKey("element_size", "ElementSize",
        "Size of a cache element",
        CArgDescriptions::eInt8, "100000");
    args.AddDefaultKey("cache_size", "CacheSize",
        "Initial size of the cache",
        CArgDescriptions::eInt8, "200");
    args.AddDefaultKey("size_type", "SizeType",
        "Cache size type",
        CArgDescriptions::eString, "ubyte");
    args.SetConstraint("size_type",
        &(*new CArgAllow_Strings, "ubyte", "uint", "uint8", "byte"));
    return true;
}
예제 #3
0
BEGIN_NCBI_SCOPE

void CAVApp::Init(void)
{
    // create command-line argument descriptions
    CArgDescriptions *argDescr = new CArgDescriptions();

    // usage
    argDescr->SetUsageContext(GetArguments().GetProgramName(), "CDD Alignment Viewer");

    // output type (required)
    argDescr->AddKey("type", "type", "one of: 'text' (unformatted), 'HTML', or 'FASTA'", argDescr->eString);
    argDescr->SetConstraint("type", (new CArgAllow_Strings())->Allow("text")->Allow("HTML")->Allow("FASTA"));

    // lowercase flag for FASTA
    argDescr->AddFlag("fasta_lc", "whether to show unaligned residues in lowercase in FASTA output");

    // paragraph width (optional, default 60)
    argDescr->AddDefaultKey("width", "integer", "paragraph width", argDescr->eInteger, "60");
    argDescr->SetConstraint("width", new CArgAllow_Integers(1, kMax_Int));

    // conservation threshhold (optional, default 2.0)
    argDescr->AddDefaultKey("cons", "bits", "conservation threshhold (bit score)", argDescr->eDouble, "2.0");
    argDescr->AddFlag("identity", "show identity, ignoring bit score");

    // whether to output left/right tails
    argDescr->AddFlag("lefttails", "whether to show left tails");
    argDescr->AddFlag("righttails", "whether to show right tails");

    // whether to do condensed display
    argDescr->AddFlag("condensed", "condensed incompletely aligned columns (text/HTML only)");

    // don't use colored backgrounds
    argDescr->AddFlag("no_color_bg", "don't use colored backgrounds for alignment paragraphs (HTML only)");

    // ignore bad pairwise alignments
    argDescr->AddFlag("ignore_bad_aln", "ignore invalid pairwise alignments in input data");

    // input file name (required)
    argDescr->AddPositional("in", "name of input file", argDescr->eString);

    SetupArgDescriptions(argDescr);
}
예제 #4
0
/////////////////////////////////////////////////////////////////////////////
//  Init test
bool CCSRATestApp::TestApp_Args(CArgDescriptions& args)
{
    // Specify USAGE context
    args.SetUsageContext(GetArguments().GetProgramBasename(),
                         "test_csra_loader_mt");

    args.AddDefaultKey("accs", "Accessions",
                       "comma separated SRA accession list",
                       CArgDescriptions::eString,
                       "SRR000010");
                     //"SRR000010,SRR389414,SRR494733,SRR505887,SRR035417");
    args.AddOptionalKey("accs-file", "Accessions",
                        "file with SRA accession list",
                        CArgDescriptions::eInputFile);
    args.AddDefaultKey("iter-count", "IterationCount",
                       "Number of read iterations",
                       CArgDescriptions::eInteger,
                       "10");
    args.AddDefaultKey("iter-size", "IterationSize",
                       "Number of sequential sequences in one iteration",
                       CArgDescriptions::eInteger,
                       "10");
    args.AddFlag("verbose", "Print info about progress");
    args.AddFlag("preload", "Try to preload libraries in main thread");
    args.AddFlag("full-seq", "Load full sequence");
    args.AddFlag("shared-scope", "Use shared scope in all threads");
    args.AddFlag("reset-history", "Reset scope's history after each iteration");
    args.AddFlag("reference-sequences", "Test reference sequences retrieval");

    return true;
}
예제 #5
0
void Cn3DNoWin::Init(void)
{
    // turn off some Mesa-related env vars, irrelevant to off-screen rendering and not platform-indepdendent
    setenv("MESA_NO_3DNOW", "true", 1);
    setenv("MESA_NO_SSE", "true", 1);
    
    // setup the diagnostic stream
    SetDiagHandler(DisplayDiagnostic, NULL, NULL);
    SetDiagPostLevel(eDiag_Info);   // report all messages
    SetDiagTrace(eDT_Default);      // trace messages only when DIAG_TRACE env. var. is set
    UnsetDiagTraceFlag(eDPF_Location);
#ifdef _DEBUG
    SetDiagPostFlag(eDPF_File);
    SetDiagPostFlag(eDPF_Line);
#else
    UnsetDiagTraceFlag(eDPF_File);
    UnsetDiagTraceFlag(eDPF_Line);
#endif

    // C++ object verification
    CSerialObject::SetVerifyDataGlobal(eSerialVerifyData_Always);
    CObjectIStream::SetVerifyDataGlobal(eSerialVerifyData_Always);
    CObjectOStream::SetVerifyDataGlobal(eSerialVerifyData_Always);

    // set up argument processing
    CArgDescriptions *argDescr = new CArgDescriptions(false);
    argDescr->SetUsageContext(GetArguments().GetProgramName(), "No-Window Cn3D");
    
    // get data from file or network
    argDescr->AddOptionalKey("f", "file", "Ncbi-mime-asn1, Biostruc, or Cdd ASN.1 data file", argDescr->eString);
    argDescr->AddOptionalKey("d", "id", "MMDB or PDB ID", argDescr->eString);
    
    // model, for network or Biostruc load
    argDescr->AddOptionalKey("o", "model", "Model type to use for coordinates", argDescr->eString);
    argDescr->SetConstraint("o", (new CArgAllow_Strings)->Allow("alpha")->Allow("single")->Allow("PDB"));
    
    // controls for output
    argDescr->AddKey("p", "pngfile", "Output PNG file name", argDescr->eString);
    argDescr->AddKey("w", "width", "Output width in pixels", argDescr->eInteger);
    argDescr->AddKey("h", "height", "Output height in pixels", argDescr->eInteger);
    argDescr->AddFlag("i", "Create interlaced PNG");
    
    // use favorite style
    argDescr->AddOptionalKey("s", "style", "Favorite style", argDescr->eString);
    
    SetupArgDescriptions(argDescr);
}