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


C++ Species::ReadFromMol方法代码示例

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


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

示例1: ProcessMolfiles

void ProcessMolfiles() {
	string fullfile = FOutputFilepath()+"MolfileInput.txt";
	ifstream Input;
	if (!OpenInput(Input,fullfile)) {
		return;	
	}
	ofstream Output;
	string outfile = FOutputFilepath()+"MolfileOutput.txt";
	if (OpenOutput(Output,outfile)) {
		Data* NewData = new Data(0);
		Output << "id\tmolfile\tgroups\tcharge\tformula\tstringcode\tmass\tdeltaG\tdeltaGerr" << endl;
		GetStringsFileline(Input,"\t",false);
		while(!Input.eof()) {
			vector<string>* strings = GetStringsFileline(Input,"\t",false);
			if (strings->size() >= 2) {
				Species* NewSpecies = new Species("", NewData, false);
				NewSpecies->ReadFromMol(FOutputFilepath()+"molfiles/"+(*strings)[1]);
				NewSpecies->PerformAllCalculations(true,true,true,true,true);
				string cues = NewSpecies->CreateStructuralCueList();
				findandreplace(cues,"\t","|");
				Output << (*strings)[0] << "\t" << (*strings)[1] << "\t" << cues << "\t" << NewSpecies->FCharge() << "\t" << NewSpecies->FFormula() << "\t";
				Output << NewSpecies->FCode() << "\t" << NewSpecies->FMW() << "\t" << NewSpecies->FEstDeltaG() << "\t" << NewSpecies->FEstDeltaGUncertainty() << endl;
				delete NewSpecies;
			}
			delete strings;
		}
		Output.close();
	}
	Input.close();
}
开发者ID:janakagithub,项目名称:Model-SEED-core,代码行数:30,代码来源:InterfaceFunctions.cpp

示例2: CreateStringCode

void CreateStringCode(string InputFilename, string OutputFilename) {
	Data* NewData = new Data(0);
	string TempFilename;
	Species* NewSpecies = new Species(TempFilename,NewData);
	
	if (InputFilename.length() > 3 && InputFilename.substr(InputFilename.length()-3,3).compare("mol") == 0) {
		NewSpecies->ReadFromMol(InputFilename);
	} else if (InputFilename.length() > 3 && InputFilename.substr(InputFilename.length()-3,3).compare("dat") == 0) {
		NewSpecies->ReadFromDat(InputFilename);
	} else {
		NewSpecies->ReadFromSmiles(InputFilename);
	}

	NewSpecies->MakeNeutral();
	NewSpecies->PerformAllCalculations(false,true,true,false,false);

	ofstream Output;
	if (!OpenOutput(Output,OutputFilename)) {
		return;
	}

	Output << NewSpecies->FCode();

	Output.close();
	delete NewData;
}
开发者ID:janakagithub,项目名称:Model-SEED-core,代码行数:26,代码来源:InterfaceFunctions.cpp

示例3: ProcessMolfileDirectory

void ProcessMolfileDirectory(string Directory,string OutputDirectory) {
	vector<string> DirectoryList = GetDirectoryFileList(Directory);

	Data* NewData = new Data(0);
	for (int i=0; i < int(DirectoryList.size()); i++) {
		cout << DirectoryList[i] << endl;
		Species* NewSpecies = new Species("", NewData, false);
		if (DirectoryList[i].length() > 0) {
			NewSpecies->ReadFromMol(Directory+DirectoryList[i]);
			NewSpecies->LabelAtoms();
			string FileRoot = RemovePath(RemoveExtension(DirectoryList[i]));
			ofstream Output;
			if (OpenOutput(Output,OutputDirectory+FileRoot+".txt")) {
				Output << "Atom index;Group;GroupIndex" << endl;
				for (int j=0; j < NewSpecies->FNumAtoms(); j++) {
					Output << j << ";" << NewSpecies->GetAtom(j)->FGroupString() << ";" << NewSpecies->GetAtom(j)->FGroupIndex() << endl;
				}
				Output.close();
			}
		}
		delete NewSpecies;
	}
}
开发者ID:janakagithub,项目名称:Model-SEED-core,代码行数:23,代码来源:InterfaceFunctions.cpp


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