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


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

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


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

示例1: 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

示例2: 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

示例3: parseOptions


//.........这里部分代码省略.........
	if (OP.fail()) {
		opt.errorMessages = "phi1 not specified";
		opt.errorFlag = true;
	}
	opt.rpr_start = OP.getDouble("rpr_start");
	if (OP.fail()) {
		opt.errorMessages = "rpr not specified";
		opt.errorFlag = true;
	}
	opt.rpr_end = OP.getDouble("rpr_end");
	if (OP.fail()) {
		opt.errorMessages = "rpr not specified";
		opt.errorFlag = true;
	}
	opt.rpr_step = OP.getDouble("rpr_step");
	if (OP.fail()) {
		opt.errorMessages = "rpr not specified";
		opt.errorFlag = true;
	}
	opt.pitch_start = OP.getDouble("pitch_start");
	if (OP.fail()) {
		opt.errorMessages = "pitch not specified";
		opt.errorFlag = true;
	}
	opt.pitch_end = OP.getDouble("pitch_end");
	if (OP.fail()) {
		opt.errorMessages = "pitch not specified";
		opt.errorFlag = true;
	}
	opt.pitch_step = OP.getDouble("pitch_step");
	if (OP.fail()) {
		opt.errorMessages = "pitch not specified";
		opt.errorFlag = true;
	}
	opt.nRes = OP.getInt("nRes");
	if (OP.fail()) {
		opt.errorMessages = "number of residues not specified";
		opt.errorFlag = true;
	}
	opt.symmetry = OP.getString("symmetry");
	if (OP.fail()) {
		opt.errorMessages = "symmetry not specified";
		opt.errorFlag = true;
	}
	opt.N = OP.getInt("N");
	if (OP.fail()) {
		opt.errorMessages = "N not specified";
		opt.errorFlag = true;
	}
	opt.rotamerLibrary = OP.getString("rotamerLibrary");
	if (OP.fail()) {
		opt.errorMessages = "rotamerLibrary not specified";
		opt.errorFlag = true;
	}
	opt.outputfile = OP.getString("outputfile");
	if (OP.fail()) {
		opt.errorMessages = "outputfile not specified";
		opt.errorFlag = true;
	}

	/*
	opt.testNo = OP.getInt("testNo");
	if (OP.fail()) {
		opt.errorMessages = "testNo not specified";
		opt.errorFlag = true;
	}
	*/

	opt.rotamerSamplingSize = OP.getString("rotamerSamplingSize");
	opt.seed = OP.getInt("seed");
	opt.runDEE = OP.getBool("runDEE");
	opt.runEnum = OP.getBool("runEnum");
	opt.runSCMF = OP.getBool("runSCMF");
	opt.runMCO = OP.getBool("runMCO");
	opt.setState = OP.getBool("setState");
	opt.rotamerStates = OP.getUnsignedIntVector("rotamerStates");

	opt.rerunConf = "########################################################\n";
	opt.rerunConf += "#  This configuration file was automatically generated,\n";
	opt.rerunConf += "#  it will rerun this job with the same options. Run as:\n";
	opt.rerunConf += "#\n";
	opt.rerunConf += "#  Run as:\n";
	opt.rerunConf += "#\n";
	opt.rerunConf += "#    % " + programName + " --configfile " + opt.rerunConfFile + "\n";
	opt.rerunConf += "#\n";
	opt.rerunConf += "#  Job started on " + (string)ctime(&start_time);
	opt.rerunConf += "#  on host " + opt.host + ", path " + opt.pwd + "\n";
	if (opt.seed == 0) {
		opt.rerunConf += "#  seed " + MslTools::intToString(opt.seed) + " (time based)\n";
	} else {
		opt.rerunConf += "#  seed " + MslTools::intToString(opt.seed) + "\n";
	} 
	opt.rerunConf += "########################################################\n";
	opt.rerunConf += "\n";
	opt.rerunConf += OP.getConfFile();

	// return the Options structure
	return opt;

}
开发者ID:Suncuss,项目名称:mslib,代码行数:101,代码来源:coiledCoilBuilder.cpp

示例4: 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

示例5: 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

示例6: 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 << "mutate 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"<<endl<<endl;
	    cout << "# Rotamer library"<<endl;
	    cout << "rotlib /library/rotlib/balanced/rotlib-balanced-200.txt"<<endl<<endl;
	    cout << "# Position"<<endl;
	    cout << "position B,2"<<endl;
	    cout << "# New residue"<<endl;
	    cout << "newRes PHE"<<endl<<endl;
	    cout << "# Number of rotamers"<<endl;
	    cout << "numRot 10"<<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;
	    exit(1111);
    }

    opt.position = OP.getString("position");
    if (OP.fail()){
	    cerr << "ERROR 1111 no position"<<endl;
	    exit(1111);
    }
    opt.newRes = OP.getString("newRes");
    if (OP.fail()){
	    cerr << "ERROR 1111 no new residue (newRes)"<<endl;
	    exit(1111);
    }

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

    opt.numRot = OP.getInt("numRot");
    if (OP.fail()){
	    cerr << "numRot defaults to 10"<<endl;
	    opt.numRot = 10;
    }
    opt.debug = OP.getBool("debug");
    if (OP.fail()){
	    opt.debug = false;
    }


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

示例7: 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 << "addSequenceConservation --pdb PDB --fasta FASTA_FILE --refCounts REF_COUNTS_FILE\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.refSeqName = OP.getString("refSeqName");
  if (OP.fail()){
    cerr << "WARNING 1111 refSeqName not specified.\n";
    opt.refSeqName = "";
  } 

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

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


    opt.refAACounts = OP.getString("refAACounts");
    if (OP.fail()){
      cerr << "ERROR 1111 refAACounts 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.freq = OP.getBool("freq");
    if (OP.fail()){
      opt.freq = false;
    }

    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;
    }

  }



  return opt;
//.........这里部分代码省略.........
开发者ID:Suncuss,项目名称:mslib,代码行数:101,代码来源:addSequenceConservation.cpp

示例8: parseOptions


//.........这里部分代码省略.........
	 *  CHECK THE GIVEN OPTIONS
	 *****************************************/
	if (!OP.checkOptions()) {
		opt.errorFlag = true;
		opt.OPerrors = OP.getErrors();
		return opt;
	}
	opt.errorFlag = false;
	opt.warningFlag = false;


	/*****************************************
	 *  CHECK THE GIVEN OPTIONS
	 *****************************************/
	//opt.commandName = OP.getCommandName();
	//if (!OP.checkOptions()) {
	//	opt.errorFlag = true;
	//	opt.disallowed = OP.getDisallowedOptions();
	//	opt.missing = OP.getMissingOptions();
	//	opt.ambiguous = OP.getAmbiguousOptions();
	//	return opt;
	//}
	opt.errorFlag = false;
	opt.warningFlag = false;


	opt.pdb1 = OP.getString("pdb1");
	if (OP.fail()) {
		opt.errorMessages = "Option name of first pdb file \"pdb1\" not specified";
		opt.errorFlag = true;
	}

	opt.pdb2 = OP.getString("pdb2");
	if (OP.fail()) {
		opt.errorMessages = "Option name of second pdb file \"pdb2\" not specified";
		opt.errorFlag = true;
	}

	opt.outputPdb2 = OP.getString("outputPdb2");
	if (OP.fail()) {
		opt.warningMessages = "Option name of output aligned second pdb file \"outputPdb2\" not specified";
		opt.warningFlag = true;
		string base = MslTools::pathTail(opt.pdb2);
		base = MslTools::pathRoot(base);
		opt.outputPdb2 = base + (string)"-aligned.pdb";
	}

	opt.writeAllModels = OP.getBool("writeAllModels");
	if (OP.fail()) {
		opt.writeAllModels = defaults.writeAllModels;
	}

	int index = 0;
	while (true) {
		string sele = OP.getString("sele1", index);
		if (OP.fail()) {
			break;
		}
		opt.sele1.push_back(sele);
		index++;
	}
	//if (opt.sele1.size() == 0) {
	//	opt.sele1.push_back("all");
	//}

	index = 0;
	while (true) {
		string sele = OP.getString("sele2", index);
		if (OP.fail()) {
			break;
		}
		opt.sele2.push_back(sele);
		index++;
	}
	//if (opt.sele2.size() == 0) {
	//	opt.sele2.push_back("all");
	//}

	opt.model1 = OP.getInt("model1");
	if (!OP.fail()) {
		opt.setModel1 = true;
	}

	opt.model2 = OP.getInt("model2");
	if (!OP.fail()) {
		opt.setModel2 = true;
	}

	opt.noAlign = OP.getBool("noAlign");
	if (OP.fail()) {
		opt.noAlign = defaults.noAlign;
	}
	opt.noOutputPdb = OP.getBool("noOutputPdb");
	if (OP.fail()) {
		opt.noOutputPdb = defaults.noOutputPdb;
	}
	// return the Options structure
	return opt;

}
开发者ID:Suncuss,项目名称:mslib,代码行数:101,代码来源:alignMolecules.cpp

示例9: 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 << "multiSearchDM --inputPDB PDB --pdbList LIST --searchCriteria SEARCH_STRING --windowSize NUM [ --numberOfIterations NUM --allowIntraChainCompare  --likenessTolernace TOL --alignPdbs --debug ]\n";
		cout << endl<<"\tsearchCriteria can be:\n";
		cout << "\tstandard       - sum of the diff. for every item between two MatrixWindows.\n";
		cout << "\tdiagnol        - sum of the diff. for the diagnol (top left-bottom right) between two MatrixWindows.\n";
		cout << "\tdoubleDiagnol  - sum of the diff. for both diagnols between two MatrixWindows.\n";
		cout << "\tminDistance    - sum of the diff. between the minimal distance for each row,col of the given MatrixWindows.\n";
		cout << "\tminDistanceRow - sum of the diff. between the minimal distance for each row of the given MatrixWindows.\n";
		exit(0);
	}

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

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

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

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

	opt.numberOfIterations = OP.getInt("numberOfIterations");
	if (OP.fail()){
		opt.numberOfIterations = 1;
	}

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


	opt.likenessTolerance = OP.getDouble("likenessTolerance");
	if (OP.fail()){
		opt.likenessTolerance = MslTools::doubleMax;
	}

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

	opt.rmsdTol   = OP.getDouble("rmsdTol");
	if (OP.fail()) {
		opt.rmsdTol = 2.0;
	}


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


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

示例10: 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 << "resurfaceSaltBridges --pdb PDB\n";

    cout << "\nprogram options: "<<endl;
    for (uint i = 0; i < opt.required.size();i++){
      cout <<"R  --"<<opt.required[i]<<"  "<<endl;
    }
    cout <<endl;
    for (uint i = 0; i < opt.optional.size();i++){
      cout <<"O  --"<<opt.optional[i]<<"  "<<endl;
    }
    cout << endl;
    exit(0);
  }



  opt.pdb = OP.getString("pdb");
  if (OP.fail()){
    cerr << "ERROR 1111 pdb not specified.\n";
    exit(1111);
  }
  opt.sb_prop_table = OP.getString("sb_prop_table");
  if (OP.fail()){
    opt.sb_prop_table = SYSENV.getEnv("MSL_SB_PROP_TABLE"); 
    cout << "SB_PROP_TABLE: "<<opt.sb_prop_table<<endl;
    if (opt.sb_prop_table == "UNDEF"){
      std::cerr << "ERROR 1111 no sb_prop_table specified."<<std::endl;	
      exit(1111);
    } else {
      if (MslTools::fileExists(opt.sb_prop_table)){
	cerr << "WARNING sb_prop_table defaulted to: "<<opt.sb_prop_table<<endl;
      } else {
	std::cerr << "ERROR 1111 no sb_prop_table specified and couldn't find default one: "<<opt.sb_prop_table<<std::endl;	
	exit(1111);	
      }
      
    }

  }

  opt.topfile = OP.getString("topfile");
  if (OP.fail()){
    opt.topfile = SYSENV.getEnv("MSL_CHARMM_TOP");
    cerr << "WARNING: charmmtopfile not specified, using " << opt.topfile << "\n";
  }
  if (!MslTools::fileExists(opt.topfile)){
    cerr << "ERROR 1111 CHARMM TOPFILE DOESN'T EXIST: "<<opt.topfile<<endl;
    exit(1111);
  }

  opt.parfile = OP.getString("parfile");
  if (OP.fail()){
    opt.parfile = SYSENV.getEnv("MSL_CHARMM_PAR");
    cerr <<"WARNING charmmparfile not specified, using " << opt.parfile << "\n";

  }
  if (!MslTools::fileExists(opt.parfile)){
    cerr << "ERROR 1111 CHARMM parFILE DOESN'T EXIST: "<<opt.parfile<<endl;
    exit(1111);
  }
  opt.rotlib = OP.getString("rotlib");
  if (OP.fail()){
    opt.rotlib = SYSENV.getEnv("MSL_ROTLIB");
    cerr << "WARNING rotlib not specified, using " << opt.rotlib << "\n";
  }

  if (!MslTools::fileExists(opt.rotlib)){
    cerr << "ERROR 1111 rotamer library DOESN'T EXIST: "<<opt.rotlib<<endl;
    exit(1111);
  }

  opt.numStructuralModels = OP.getInt("numStructuralModels");
  if (OP.fail()){
    opt.numStructuralModels = 10;
  }
  opt.numSequenceModels   = OP.getInt("numSequenceModels");
  if (OP.fail()){
    opt.numSequenceModels = 30;
  }
  opt.numMCcycles  = OP.getInt("numMCcycles");
  if (OP.fail()){
    opt.numMCcycles = 100;
  }
  opt.startMCtemp  = OP.getDouble("startMCtemp");
  if (OP.fail()){
//.........这里部分代码省略.........
开发者ID:Suncuss,项目名称:mslib,代码行数:101,代码来源:resurfaceSaltBridges.cpp


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