本文整理汇总了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();
}
示例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;
}
示例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;
}
}