当前位置: 首页>>代码示例>>C++>>正文


C++ OptionParser::fail方法代码示例

本文整理汇总了C++中OptionParser::fail方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionParser::fail方法的具体用法?C++ OptionParser::fail怎么用?C++ OptionParser::fail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OptionParser的用法示例。


在下文中一共展示了OptionParser::fail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){

	// Create the options
	Options opt;
	
	// Parse the options
	OptionParser OP;
	OP.readArgv(theArgc, theArgv);
	OP.setRequired(opt.required);	
	OP.setDefaultArguments(opt.defaultArgs); // the default argument is the --configfile option

	if (OP.countOptions() == 0){
		cout << "Usage: getSphericalCoordinates conf" << endl;
		cout << endl;
		cout << "\n";
		cout << "pdb PDB\n";
		cout << endl;
		exit(0);
	}

	opt.configFile = OP.getString("configfile");
	
	if (opt.configFile != "") {
		OP.readFile(opt.configFile);
		if (OP.fail()) {
			string errorMessages = "Cannot read configuration file " + opt.configFile + "\n";
			cerr << "ERROR 1111 "<<errorMessages<<endl;
		}
	}

	opt.pdb = OP.getString("pdb");
	if (OP.fail()){
		cerr << "ERROR 1111 no pdb specified."<<endl;
		exit(1111);
	}

	opt.resnum = OP.getInt("resnum");
	if (OP.fail()){
		cerr << "ERRROR 1111 no resnum\n";
		exit(1111);
	}

	opt.chain = OP.getString("chain");
	if (OP.fail()){
		cerr << "ERRROR 1111 no chain\n";
		exit(1111);
	}

	opt.negativeRes = OP.getBool("neg");
        if (OP.fail()){
                opt.negativeRes = false;
        }

        if (opt.negativeRes) {
                opt.resnum = -1*opt.resnum;
        }

	opt.printFrames = OP.getBool("printFrames");
	return opt;
}
开发者ID:jwillis0720,项目名称:msl_mirror,代码行数:60,代码来源:getSphericalCoordinates.cpp

示例2: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
    // Create the options
    Options opt;

    // Parse the options
    OptionParser OP;
    OP.setRequired(opt.required);	
    OP.setDefaultArguments(opt.defaultArgs); // the default argument is the --configfile option
    OP.readArgv(theArgc, theArgv);

    if (OP.countOptions() == 0){
	cout << "Usage: getTripletCaMeasurements " << endl;
	cout << endl;
	cout << "\n";
	cout << "pdblist PDB\n";
	cout << endl;
	exit(0);
    }

    opt.pdblist = OP.getString("pdblist");
    if (OP.fail()){
	cerr << "ERROR 1111 no pdblist specified."<<endl;
	exit(1111);
    }

    opt.numSamples = OP.getInt("numSamples");
    if (OP.fail()){
      opt.numSamples = 10000;
      cerr << "WARNING numSamples set to "<<opt.numSamples<<endl;
    }
    return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:32,代码来源:writeShiftedRamaStats.cpp

示例3: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;


	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);
	OP.readArgv(theArgc, theArgv);

	if (OP.countOptions() == 0){
		cout << "Usage:" << endl;
		cout << endl;
		cout << "calcSasaAll --list LIST\n";
		exit(0);
	}
	opt.list= OP.getString("list");
	if (OP.fail()){
		cerr << "ERROR 1111 list not specified.\n";
		exit(1111);
	}
	opt.fasta = OP.getString("fasta");
	if (OP.fail()){
	  cerr << "ERROR 1111 fasta not specified.\n";
	  exit(1111);
	}
	opt.refSeqName = OP.getString("refSeqName");
	if (OP.fail()){
	  cerr << "ERROR 1111 refSeqName not specified.\n";
	  exit(1111);
	}
	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:33,代码来源:calcSasaAll.cpp

示例4: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
    // Create the options
    Options opt;

    // Parse the options
    OptionParser OP;
    OP.setRequired(opt.required);	
    OP.setDefaultArguments(opt.defaultArgs); // the default argument is the --configfile option
    OP.readArgv(theArgc, theArgv);

    if (OP.countOptions() == 0){
	cout << "Usage: getConsecutivePhiPsi " << endl;
	cout << endl;
	cout << "\n";
	cout << "pdblist PDB\n";
	cout << "SSE L # L = Loop, S = Strand, H = Helix\n"
	cout << endl;
	exit(0);
    }

    opt.pdblist = OP.getString("pdblist");
    if (OP.fail()){
	cerr << "ERROR 1111 no pdblist specified."<<endl;
	exit(1111);
    }

    opt.SSE = OP.getString("sse");
    if (OP.fail()){
	opt.SSE = "";
    }


    return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:34,代码来源:getConsecutivePhiPsi.cpp

示例5: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;


	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);
	OP.readArgv(theArgc, theArgv);

	if (OP.countOptions() == 0){
		cout << "Usage:" << endl;
		cout << endl;
		cout << "createVectorHash --list pdb.list --outfile foo.vh\n";
		exit(0);
	}
	opt.list = OP.getString("list");
	if (OP.fail()){
		cerr << "ERROR 1111 pdb not specified.\n";
		exit(1111);
	}

	opt.outfile = OP.getString("outfile");
	if (OP.fail()){
	  cerr << "WARNING outfile not specified. Using: '"<<opt.list<<".vh'"<<endl;
	  opt.outfile = opt.list+".vh";

	}

	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:31,代码来源:createVectorHash.cpp

示例6: main

int main(int argc, char *argv[]){
	vector<string> required;
	required.push_back("flatfile");
	
	vector<string> optional;
	optional.push_back("reread");
	optional.push_back("outfile");
	OptionParser OP;
	OP.readArgv(argc,argv);
	OP.setRequired(required);
	OP.setAllowed(optional);

	string flatfile = OP.getString("flatfile");
	if (OP.fail()){
		cout << "Usage: ./testMolecularInterfaceDatabase --flatfile FLAT.mid [ --outfile mid.ckpt --reread --archive text ]\n";
		exit(0);
	}

	string outfile = OP.getString("outfile");
	if (OP.fail()){
		outfile = "mid.ckpt";
	}

	string archive = OP.getString("archive");
	if (OP.fail()){
		archive = "text";
	}
	
	// Create from flat file
	MIDReader mread;
	mread.open(flatfile);
	mread.read(archive);
	
	MoleculeInterfaceDatabase &mid = mread.getMoleculeInterfaceDatabase();
	cout << "MID size: "<<mid.size()<<endl;
	
	// Write out to binary 
	mid.setArchiveType(archive);
	mid.save_checkpoint(outfile);

	// Re-read if option set..
	bool reread = OP.getBool("reread");
	if (!OP.fail() && reread){
		cout << "Re-reading binary MolecularInterfaceDatabase.\n";
		Timer t;
		double start = t.getWallTime();
		MoleculeInterfaceDatabase mid2;
		mid2.setArchiveType(archive);
		mid2.load_checkpoint(outfile);
		cout << "MID2 size: "<<mid2.size()<<" read in "<<(t.getWallTime() - start)<<" seconds."<<endl;
	}
}
开发者ID:Suncuss,项目名称:mslib,代码行数:52,代码来源:testMolecularInterfaceDatabase.cpp

示例7: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
    // Create the options
    Options opt;

    // Parse the options
    OptionParser OP;
    OP.setRequired(opt.required);	
    OP.setDefaultArguments(opt.defaultArgs); // the default argument is the --configfile option
    OP.readArgv(theArgc, theArgv);

    if (OP.countOptions() == 0){
	cout << "Usage: splitIntoChains " << endl;
	cout << endl;
	cout << "\n";
	cout << "pdblist PDB\n";
	cout << endl;
	exit(0);
    }

    opt.pdblist = OP.getString("pdblist");
    if (OP.fail()){
	cerr << "ERROR 1111 no pdblist specified."<<endl;
	exit(1111);
    }
    return opt;
}
开发者ID:jwillis0720,项目名称:msl_mirror,代码行数:26,代码来源:splitIntoChains.cpp

示例8: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;

	OP.readArgv(theArgc, theArgv);
	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);

	if (OP.countOptions() == 0){
		cout << "Usage:" << endl;
		cout << endl;
		cout << "testQuench --pdb PDB\n";
		exit(0);
	}

	opt.pdb  = OP.getString("pdb");
	if (OP.fail()){
		cerr << "ERROR 1111 pdb not specified.\n";
		exit(1111);
	}

	opt.topfile = OP.getString("topfile");
	if (OP.fail()){
		cerr << "WARNING no topfile specified, using default "<<SYSENV.getEnv("MSL_CHARMM_TOP")<<endl;
		opt.topfile = SYSENV.getEnv("MSL_CHARMM_TOP");
	}

	opt.parfile = OP.getString("parfile");
	if (OP.fail()){
		cerr << "WARNING no parfile specified, using default "<<SYSENV.getEnv("MSL_CHARMM_PAR")<<endl;
		opt.parfile = SYSENV.getEnv("MSL_CHARMM_PAR");
	}

	opt.rotlib = OP.getString("rotlib");
	if (OP.fail()){
		cerr << "WARNING no rotlib specified, using default "<<SYSENV.getEnv("MSL_ROTLIB")<<endl;
		opt.rotlib = SYSENV.getEnv("MSL_ROTLIB");
	}

	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:42,代码来源:testQuench.cpp

示例9: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;


	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);
	OP.readArgv(theArgc, theArgv);

	if (OP.countOptions() == 0){
		cout << "Usage:" << endl;
		cout << endl;
		cout << "patchAnalysis --pdb foo.pdb --patch1 \"chain A and resi 5-150\" --patch2 \"chain B and resi 5-150\" \n";
		exit(0);
	}

	opt.list= OP.getString("list");
	if (OP.fail()){
	  opt.list = "";
	}
	opt.pdb= OP.getString("pdb");
	if (OP.fail() && opt.list == ""){
		cerr << "ERROR 1111 pdb or list not specified.\n";
		exit(1111);
	}
	opt.patch1 = OP.getString("patch1");
	if (OP.fail()){
		cerr << "ERROR 1111 patch1 not specified.\n";
		exit(1111);
	}
	opt.patch2 = OP.getString("patch2");
	if (OP.fail()){
		cerr << "ERROR 1111 patch2 not specified.\n";
		exit(1111);
	}
	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:38,代码来源:patchAnalysis.cpp

示例10: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;

	OP.readArgv(theArgc, theArgv);
	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);

	if (OP.countOptions() == 0) {
		cout << "Usage:" << endl;
		cout << endl;
		cout << "moveProteinCenter --pdb PDB [--x X --y Y --z Z --sele SELE --outfile OUTFILE]\n";
		exit(0);
	}

	opt.pdb = OP.getString("pdb");
	if (OP.fail()){
		cerr << "Pdb not specified, failing.\n";
		exit(1111);
	}

	opt.x = OP.getDouble("x");
	if (OP.fail()){
		cerr << "Warning, x coordinate set to 0.0\n";
		opt.x = 0.0;
	}

	opt.y = OP.getDouble("y");
	if (OP.fail()){
		cerr << "Warning, y coordinate set to 0.0\n";
		opt.y = 0.0;
	}

	opt.z = OP.getDouble("z");
	if (OP.fail()){
		cerr << "Warning, z coordinate set to 0.0\n";
		opt.z = 0.0;
	}

	opt.sele = OP.getString("sele");
	if (OP.fail()){
		opt.sele = "";
	}

	opt.outfile = OP.getString("outfile");
	if (OP.fail()){
		cerr << "Warning, outfile set to test.pdb" << endl;
		opt.outfile = "test.pdb";
	}

	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:53,代码来源:moveProteinCenter.cpp

示例11: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){

    // Create the options
    Options opt;
    

    // Parse the options
    OptionParser OP;
    OP.readArgv(theArgc, theArgv);
    OP.setRequired(opt.required);    
    OP.setAllowed(opt.optional);
    //    OP.setShortOptionEquivalent(opt.equivalent);
    OP.setDefaultArguments(opt.defaultArgs); // the default argument is the --configfile option
    OP.autoExtendOptions(); // if you give option "solvat" it will be autocompleted to "solvationfile"


    if (OP.countOptions() == 0){
        cout << "Usage:" << endl;
        cout << endl;
        cout << "pdb PDB"<<endl;
        exit(0);
    }

    opt.pdb = OP.getString("pdb");
    if (OP.fail()){
	    cerr << "ERROR 1111 no pdb file"<<endl;
    }
    
    opt.tol = OP.getDouble("tol");
    if (OP.fail()){
      opt.tol = 1.88;
      cerr << "WARNING tol set to default: "<<opt.tol<<endl;
    }

    opt.interfaceOnly = OP.getBool("interfaceOnly");
    if (OP.fail()){
      opt.interfaceOnly = false;
    }

    opt.atomPair = OP.getString("atomPair");
    if (OP.fail()){
      opt.atomPair = "";
    }
    opt.elementPair = OP.getString("elementPair");
    if (OP.fail()){
      opt.elementPair = "";
    }
    opt.printAll = OP.getBool("printAll");
    if (OP.fail()){
      opt.printAll = false;
    }
    return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:53,代码来源:findClashes.cpp

示例12: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){

    // Create the options
    Options opt;
    

    // Parse the options
    OptionParser OP;
    OP.readArgv(theArgc, theArgv);
    OP.setRequired(opt.required);    
    OP.setAllowed(opt.optional);
    //    OP.setShortOptionEquivalent(opt.equivalent);
    OP.setDefaultArguments(opt.defaultArgs); // the default argument is the --configfile option
    OP.autoExtendOptions(); // if you give option "solvat" it will be autocompleted to "solvationfile"


    if (OP.countOptions() == 0){
        cout << "Usage:" << endl;
        cout << endl;
        cout << "fillInSideChains CONF\n";
        exit(0);
    }

    opt.configfile = OP.getString("configfile");
    
    if (opt.configfile != "") {
        OP.readFile(opt.configfile);
        if (OP.fail()) {
            string errorMessages = "Cannot read configuration file " + opt.configfile + "\n";
            cerr << "ERROR 1111 "<<errorMessages<<endl;
        }
    }

    if (OP.getBool("help")){

	    cout << "# PDB "<<endl;	
	    cout << "pdb foo.pdb"<<endl<<endl;
	    cout << "# Output pdb" <<endl;
	    cout << "outpdb /tmp/out.pdb"<<endl<<endl;
	    cout << "# Rotamer library"<<endl;
	    cout << "rotlib /library/rotlib/balanced/rotlib-balanced-200.txt"<<endl<<endl;
	    cout << "# CHARMM Topology"<<endl;
	    cout << "topfile /library/charmmTopPar/top_all27_prot_lipid.inp"<<endl<<endl;
	    cout << "# CHARMM Parameter"<<endl;
	    cout << "parfile /library/charmmTopPar/par_all27_prot_lipid.inp"<<endl<<endl;
	    exit(1);
    }


    opt.pdb = OP.getString("pdb");
    if (OP.fail()){
	    cerr << "ERROR 1111 no pdb file"<<endl;
    }

    opt.rotlib = OP.getString("rotlib");
    if (OP.fail()){
	    cerr << "ERROR 1111 no rotlib file"<<endl;
	    
    }

    opt.topfile = OP.getString("topfile");
    if (OP.fail()){
	    cerr << "ERROR 1111 no topfile file"<<endl;
    }
    opt.parfile = OP.getString("parfile");
    if (OP.fail()){
	    cerr << "ERROR 1111 no parfile file"<<endl;
    }

    opt.outpdb = OP.getString("outpdb");
    if (OP.fail()){
	    opt.outpdb = "/tmp/out.pdb";
	    cerr << "WARNING no outpdb file specifed will write to: "<<opt.outpdb<<endl;
    }

    opt.debug = OP.getBool("debug");
    if (OP.fail()){
	    opt.debug = false;
    }


    
    return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:84,代码来源:fillInSideChains.cpp

示例13: parseOptions

Options parseOptions(int _argc, char * _argv[], Options defaults) {

	/******************************************
	 *  Pass the array of argument and the name of
	 *  a configuration file to the ArgumentParser
	 *  object.  Then ask for the value of the argument
	 *  and collect error and warnings.
	 *
	 *  This function returns a Options structure
	 *  defined at the head of this file 
	 ******************************************/
	
	Options opt;

	/******************************************
	 *  Set the allowed and required options:
	 *
	 *  Example of configuartion file:
	 *  
	 ******************************************/
	vector<string> required;
	vector<string> allowed;

	opt.required.push_back("sequence");
	opt.required.push_back("startPos");
	opt.required.push_back("startRegPos");

	opt.required.push_back("r0_start");
	opt.required.push_back("r0_end");
	opt.required.push_back("r0_step");
	opt.required.push_back("r1_start");
	opt.required.push_back("r1_end");
	opt.required.push_back("r1_step");
	opt.required.push_back("w1_start");
	opt.required.push_back("w1_end");
	opt.required.push_back("w1_step");
	opt.required.push_back("phi1_start");
	opt.required.push_back("phi1_end");
	opt.required.push_back("phi1_step");
	opt.required.push_back("rpr_start");
	opt.required.push_back("rpr_end");
	opt.required.push_back("rpr_step");
	opt.required.push_back("pitch_start");
	opt.required.push_back("pitch_end");
	opt.required.push_back("pitch_step");

	opt.required.push_back("nRes");
	opt.required.push_back("symmetry");
	opt.required.push_back("N");

	//opt.required.push_back("testNo");
	opt.allowed.push_back("setState");
	opt.allowed.push_back("rotamerStates");

	opt.allowed.push_back("rotamerSamplingSize");
	opt.allowed.push_back("seed");
	opt.required.push_back("rotamerLibrary"); //filename of rotamer library file
	opt.allowed.push_back("outputdir");
	opt.allowed.push_back("outputfile"); //filename of output file
	opt.allowed.push_back("version"); // --version
	opt.allowed.push_back("v"); // -v is equivalent to --version
	opt.allowed.push_back("help"); // --help
	opt.allowed.push_back("h"); // -h is equivalent to --help
	opt.allowed.push_back("configfile");

	opt.allowed.push_back("runDEE");
	opt.allowed.push_back("runEnum");
	opt.allowed.push_back("runSCMF");
	opt.allowed.push_back("runMCO");

	opt.equivalent.push_back(vector<string>());
	opt.equivalent.back().push_back("v");
	opt.equivalent.back().push_back("version");
	opt.equivalent.push_back(vector<string>());
	opt.equivalent.back().push_back("h");
	opt.equivalent.back().push_back("help");

	opt.defaultArgs.push_back("configfile");


	//OptionParser OP(_argc, _argv);
	OptionParser OP;
	OP.setShortOptionEquivalent(opt.equivalent);
	OP.readArgv(_argc, _argv);
	OP.setDefaultArguments(opt.defaultArgs); // a pdb file value can be given as a default argument without the --pdbfile option
	OP.setRequired(opt.required);
	OP.setAllowed(opt.allowed);
	OP.autoExtendOptions(); // if you give option "solvat" it will be autocompleted to "solvationfile"
	if (OP.countOptions() == 0) {
		usage();
		exit(0);
	}
	opt.configfile = OP.getString("configfile");
	if (opt.configfile != "") {
		OP.readFile(opt.configfile);
		if (OP.fail()) {
			opt.errorFlag = true;
			opt.errorMessages += "Cannot read configuration file " + opt.configfile + "\n";
			exit(1);
		}
//.........这里部分代码省略.........
开发者ID:Suncuss,项目名称:mslib,代码行数:101,代码来源:coiledCoilBuilder.cpp

示例14: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
	Options opt;

	OptionParser OP;

	OP.readArgv(theArgc, theArgv);
	OP.setRequired(opt.required);
	OP.setAllowed(opt.optional);

	if (OP.countOptions() == 0){
		cout << "Usage:" << endl;
		cout << endl;
		cout << "generateCoiledBundles --symmetry SYM --superHelicalRadius LOW HIGH STEP --alphaHelicalPhaseAngle LOW HIGH STEP --superHelicalPitchAngle LOW HIGH STEP --numberOfResidues NUM [ --d2zTranslation LOW HIGH STEP --superHelicalPhaseAngle LOW HIGH STEP --name OUTFILE]\n";
		cout << "Recommended parameters:" << endl;
		cout << "--symmetry: C2, C3, D2, D3, etc." << endl;
		cout << "--superHelicalRadius: radius from center in Angstroms" << endl;
		cout << "--alphaHelicalPhaseAngle: phase angle of the helices (0-360 degrees)" << endl;
		cout << "--superHelicalPitchAngle: often 5-20 degrees, but depends on the coil (average around 12)" << endl;
		cout << "--d2zTranslation: z offset between D_N symmetric coils, usually small" << endl;
		cout << "--superHelicalPhaseAngle: angle in degrees.  Value of 90/N for D_N typically works well, but larger and smaller values are possible" << endl;
		exit(0);
	}

	opt.symmetry = OP.getString("symmetry");
	if (OP.fail()){
		cerr << "ERROR 1111 symmetry not specified.\n";
		exit(1111);
	}
	opt.superHelicalRadius = OP.getDoubleVector("superHelicalRadius");
	if (OP.fail()){		   
		cerr << "ERROR 1111 superHelicalRadius not specified.\n";
		exit(1111);
	}

	opt.alphaHelicalPhaseAngle = OP.getDoubleVector("alphaHelicalPhaseAngle");
	if (OP.fail()){		   
		cerr << "ERROR 1111 alphaHelicalPhaseAngle not specified.\n";
		exit(1111);
	}

	opt.superHelicalPitchAngle = OP.getDoubleVector("superHelicalPitchAngle");
	if (OP.fail()){		   
		cerr << "ERROR 1111 superHelicalPitchAngle not specified.\n";
		exit(1111);
	}

	opt.numberOfResidues = OP.getInt("numberOfResidues");
	if (OP.fail()){		   
		cerr << "ERROR 1111 numberOfResidues not specified.\n";
		exit(1111);
	}

	opt.d2zTranslation         = OP.getDoubleVector("d2zTranslation");
	opt.superHelicalPhaseAngle = OP.getDoubleVector("superHelicalPhaseAngle");
	if (opt.d2zTranslation.size() == 0) { vector<double> tmp; tmp.push_back(0.0); tmp.push_back(1.0); tmp.push_back(100.0); opt.d2zTranslation = tmp; cerr << "Warning,  d2zTranslation not defined (required for D2, D3)" << endl; }
	if (opt.superHelicalPhaseAngle.size() == 0) {
		int _N = atoi(opt.symmetry.substr(1,(opt.symmetry.length()-1)).c_str());
		double recommendedValue = 90./double(_N);
		vector<double> tmp; tmp.push_back(recommendedValue); tmp.push_back((recommendedValue + 1.)); tmp.push_back(100.0); opt.superHelicalPhaseAngle = tmp; cerr << "Warning,  superHelicalPhaseAngle not defined (required for D2, D3)" << endl;
	}

	opt.name = OP.getString("name");
	if (OP.fail()){
		opt.name = "CoiledBundle";
	}

	return opt;
}
开发者ID:Suncuss,项目名称:mslib,代码行数:68,代码来源:generateCoiledCoils.cpp

示例15: setupOptions

Options setupOptions(int theArgc, char * theArgv[]){
  Options opt;

  OptionParser OP;


  OP.setRequired(opt.required);
  OP.setAllowed(opt.optional);
  OP.setDefaultArguments(opt.defaultArgs); // a pdb file value can be given as a default argument without the --pdbfile option
  OP.autoExtendOptions(); // if you give option "solvat" it will be autocompleted to "solvationfile"
  OP.readArgv(theArgc, theArgv);

  if (OP.countOptions() == 0){
    cout << "Usage:" << endl;
    cout << endl;
    cout << "querySeqCons--fasta FASTA_FILE --seq 'NAME,STARTPOS,ENDPOS' \n";
    exit(0);
  }


  opt.configfile = OP.getString("configfile");
  if (opt.configfile != "") {
    OP.readFile(opt.configfile);
    if (OP.fail()) {
      cerr << "ERROR couldn't read : "<<opt.configfile<<endl;
      exit(1);
    }
  }

  opt.fasta = OP.getString("fasta");
  if (OP.fail()){
    cerr << "ERROR 1111 fasta not specified.\n";
    exit(1111);
  }



  opt.refAACounts = OP.getString("refAACounts");
  if (OP.fail()){
    opt.refAACounts = "";
  }
  opt.logodds = OP.getBool("logodds");
  if (OP.fail()){
    opt.logodds = false;
  }

  opt.seq = OP.getString("seq");
  if (OP.fail()){
    opt.seq = "";
  }

  if (opt.seq == ""){

    opt.refSeqName = OP.getString("refSeqName");
    if (OP.fail()){
      cerr << "WARNING 1111 refSeqName not specified.\n";
      opt.refSeqName = "";
    } 

    opt.pdb = OP.getString("pdb");
    if (OP.fail()){
      cerr << "ERROR 1111 pdb not specified.\n";
      exit(1111);
    }

    opt.sel = OP.getString("sel");
    if (OP.fail()){
      cerr << "ERROR 1111 sel not specified.\n";
      exit(1111);
    }

    opt.refSeqOffset = OP.getInt("refSeqOffset");
    if (OP.fail()){
      cerr << "WARNING 1111 refSeqOffset not specified.\n";
      opt.refSeqOffset = 0;
    }

    opt.applyToAllChains = OP.getBool("applyToAllChains");
    if (OP.fail()){
      opt.applyToAllChains = false;
    }

    opt.regexForFasta = OP.getString("regexForFasta");
    if (OP.fail()){
      opt.regexForFasta = "";
    }

    opt.outPdb = OP.getString("outPdb");
    if (OP.fail()){
      opt.outPdb = MslTools::stringf("%s_seqcons.pdb",MslTools::getFileName(opt.pdb).c_str());
      cerr << "WARNING --outPdb is set to : "<<opt.outPdb<<endl;
    }

    string type = OP.getString("type");
    if (OP.fail()){
      cerr << "WARNING type set to default: freq"<<endl;
      opt.valueType = Options::freq;
    } else {

      map<string,int>::iterator it = opt.valueMap.find(type);
//.........这里部分代码省略.........
开发者ID:Suncuss,项目名称:mslib,代码行数:101,代码来源:querySeqCons.cpp


注:本文中的OptionParser::fail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。