コード例 #1
0
ファイル: cav_main.cpp プロジェクト: svn2github/ncbi_tk
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);
}
コード例 #2
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;
}
コード例 #3
0
ファイル: test_cache_mt.cpp プロジェクト: svn2github/ncbi_tk
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;
}
コード例 #4
0
ファイル: nowin_main.cpp プロジェクト: DmitrySigaev/ncbi
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);
}