Changes in / [f03705:001f8a]
- Files:
-
- 15 added
- 8 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Makefile.am
rf03705 r001f8a 96 96 MoleculeAction/FillVoidWithMoleculeAction.cpp \ 97 97 MoleculeAction/LinearInterpolationofTrajectoriesAction.cpp \ 98 MoleculeAction/LoadAction.cpp \ 98 99 MoleculeAction/RotateAroundSelfByAngleAction.cpp \ 99 100 MoleculeAction/RotateToPrincipalAxisSystemAction.cpp \ 101 MoleculeAction/SaveAction.cpp \ 100 102 MoleculeAction/SaveAdjacencyAction.cpp \ 101 103 MoleculeAction/SaveBondsAction.cpp \ … … 110 112 MoleculeAction/FillVoidWithMoleculeAction.hpp \ 111 113 MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp \ 114 MoleculeAction/LoadAction.cpp \ 112 115 MoleculeAction/RotateAroundSelfByAngleAction.hpp \ 113 116 MoleculeAction/RotateToPrincipalAxisSystemAction.hpp \ 117 MoleculeAction/SaveAction.hpp \ 114 118 MoleculeAction/SaveAdjacencyAction.hpp \ 115 119 MoleculeAction/SaveBondsAction.hpp \ … … 118 122 MoleculeAction/VerletIntegrationAction.hpp 119 123 120 PARSERACTIONSOURCE = \121 ParserAction/LoadXyzAction.cpp \122 ParserAction/SaveXyzAction.cpp123 PARSERACTIONHEADER = \124 ParserAction/LoadXyzAction.hpp \125 ParserAction/SaveXyzAction.hpp126 127 124 SELECTIONACTIONSOURCE = \ 128 125 SelectionAction/AllAtomsAction.cpp \ -
src/Actions/WorldAction/InputAction.cpp
rf03705 r001f8a 23 23 #include "molecule.hpp" 24 24 #include "Parser/FormatParserStorage.hpp" 25 #include "Parser/PcpParser.hpp"26 25 #include "Helpers/Verbose.hpp" 27 26 #include "World.hpp" -
src/Actions/WorldAction/ScaleBoxAction.def
rf03705 r001f8a 32 32 // finally the information stored in the ActionTrait specialization 33 33 #define DESCRIPTION "scale box and atomic positions inside" 34 # define SHORTFORM "s"34 #undef SHORTFORM -
src/Parser/FormatParserStorage.cpp
rf03705 r001f8a 243 243 } 244 244 245 246 /** Stores world in an ostream depending on its suffix 247 * \param &output output stream 248 * \param suffix 249 * \return true - storing ok, false - suffix unknown 250 */ 251 bool FormatParserStorage::put(std::ostream &output, std::string suffix) 252 { 253 if (suffix == ParserSuffixes[mpqc]) { 254 getMpqc().save(&output); 255 } else if (suffix == ParserSuffixes[pcp]) { 256 getPcp().save(&output); 257 } else if (suffix == ParserSuffixes[pdb]) { 258 getPdb().save(&output); 259 } else if (suffix == ParserSuffixes[tremolo]) { 260 getTremolo().save(&output); 261 } else if (suffix == ParserSuffixes[xyz]) { 262 getXyz().save(&output); 263 } else { 264 DoeLog(1) && (eLog() << Verbose(1) << "Unknown suffix " << suffix << " to for FormatParserStorage::put()." << endl); 265 return false; 266 } 267 return true; 268 } 269 245 270 /** Returns reference to the output MpqcParser, adds if not present. 246 271 * \return reference to the output MpqcParser -
src/Parser/FormatParserStorage.hpp
rf03705 r001f8a 46 46 47 47 bool get(std::istream &input, std::string suffix); 48 bool put(std::ostream &output, std::string suffix); 48 49 MpqcParser &getMpqc(); 49 50 PcpParser &getPcp(); -
src/Parser/Makefile.am
rf03705 r001f8a 14 14 MpqcParser.cpp \ 15 15 PcpParser.cpp \ 16 PdbAtomInfoContainer.cpp \ 16 17 PdbParser.cpp \ 17 18 TremoloParser.cpp \ … … 24 25 MpqcParser.hpp \ 25 26 PcpParser.hpp \ 27 PdbAtomInfoContainer.hpp \ 28 PdbKey.hpp \ 26 29 PdbParser.hpp \ 27 30 TremoloParser.hpp \ -
src/Parser/PdbParser.cpp
rf03705 r001f8a 22 22 #include "Helpers/Assert.hpp" 23 23 #include "Helpers/Log.hpp" 24 #include "Helpers/toString.hpp" 24 25 #include "Helpers/Verbose.hpp" 25 #include "PdbParser.hpp"26 26 #include "World.hpp" 27 27 #include "atom.hpp" … … 31 31 #include "periodentafel.hpp" 32 32 #include "Descriptors/AtomIdDescriptor.hpp" 33 #include "Parser/PdbParser.hpp" 33 34 34 35 #include <map> … … 44 45 */ 45 46 PdbParser::PdbParser() { 46 knownKeys[" "] = PdbKey::noKey; // with this we can detect invalid keys 47 knownKeys["x"] = PdbKey::x; 48 knownKeys["Id"] = PdbKey::Id; 49 knownKeys["Type"] = PdbKey::Type; 50 knownKeys["extType"] = PdbKey::extType; 51 knownKeys["name"] = PdbKey::name; 52 knownKeys["resName"] = PdbKey::resName; 53 knownKeys["chainID"] = PdbKey::chainID; 54 knownKeys["resSeq"] = PdbKey::resSeq; 55 knownKeys["occupancy"] = PdbKey::occupancy; 56 knownKeys["tempFactor"] = PdbKey::tempFactor; 57 knownKeys["segID"] = PdbKey::segID; 58 knownKeys["charge"] = PdbKey::charge; 47 knownTokens["ATOM"] = PdbKey::Atom; 48 knownTokens["TER"] = PdbKey::Filler; 49 knownTokens["END"] = PdbKey::EndOfFile; 50 knownTokens["CONECT"] = PdbKey::Connect; 51 knownTokens["REMARK"] = PdbKey::Remark; 52 knownTokens[""] = PdbKey::EndOfFile; 59 53 } 60 54 … … 65 59 additionalAtomData.clear(); 66 60 atomIdMap.clear(); 67 knownKeys.clear(); 68 } 69 70 /** 71 * Loads atoms from a tremolo-formatted file. 72 * 73 * \param tremolo file 61 } 62 63 64 /** Parses the initial word of the given \a line and returns the token type. 65 * 66 * @param line line to scan 67 * @return token type 68 */ 69 enum PdbKey::KnownTokens PdbParser::getToken(string &line) 70 { 71 // look for first space 72 const size_t space_location = line.find(' '); 73 const size_t tab_location = line.find('\t'); 74 size_t location = space_location < tab_location ? space_location : tab_location; 75 string token; 76 if (location != string::npos) { 77 //DoLog(1) && (Log() << Verbose(1) << "Found space at position " << space_location << std::endl); 78 token = line.substr(0,space_location); 79 } else { 80 token = line; 81 } 82 83 //DoLog(1) && (Log() << Verbose(1) << "Token is " << token << std::endl); 84 if (knownTokens.count(token) == 0) 85 return PdbKey::NoToken; 86 else 87 return knownTokens[token]; 88 89 return PdbKey::NoToken; 90 } 91 92 /** 93 * Loads atoms from a PDB-formatted file. 94 * 95 * \param PDB file 74 96 */ 75 97 void PdbParser::load(istream* file) { 76 // TODO: PdbParser::load implementation 77 ASSERT(false, "Not implemented yet"); 78 // string line; 79 // string::size_type location; 80 // 81 // usedFields.clear(); 82 // while (file->good()) { 83 // std::getline(*file, line, '\n'); 84 // if (usedFields.empty()) { 85 // location = line.find("ATOMDATA", 0); 86 // if (location != string::npos) { 87 // parseAtomDataKeysLine(line, location + 8); 88 // } 89 // } 90 // if (line.length() > 0 && line.at(0) != '#') { 91 // readAtomDataLine(line); 92 // } 93 // } 94 // 95 // processNeighborInformation(); 96 // adaptImprData(); 97 // adaptTorsion(); 98 } 99 100 /** 101 * Saves the World's current state into as a tremolo file. 98 string line; 99 size_t linecount = 0; 100 enum PdbKey::KnownTokens token; 101 102 molecule *newmol = World::getInstance().createMolecule(); 103 newmol->ActiveFlag = true; 104 bool NotEndOfFile = true; 105 // TODO: Remove the insertion into molecule when saving does not depend on them anymore. Also, remove molecule.hpp include 106 World::getInstance().getMolecules()->insert(newmol); 107 while (NotEndOfFile) { 108 std::getline(*file, line, '\n'); 109 // extract first token 110 token = getToken(line); 111 //DoLog(1) && (Log() << Verbose(1) << " Recognized token of type : " << token << std::endl); 112 switch (token) { 113 case PdbKey::Atom: 114 readAtomDataLine(line, newmol); 115 break; 116 case PdbKey::Remark: 117 break; 118 case PdbKey::Connect: 119 readNeighbors(line); 120 break; 121 case PdbKey::Filler: 122 break; 123 case PdbKey::EndOfFile: 124 NotEndOfFile = false; 125 break; 126 default: 127 // TODO: put a throw here 128 DoeLog(2) && (eLog() << Verbose(2) << "Unknown token: '" << line << "'" << std::endl); 129 //ASSERT(0, "PdbParser::load() - Unknown token in line "+toString(linecount)+": "+line+"."); 130 break; 131 } 132 NotEndOfFile = NotEndOfFile && (file->good()); 133 linecount++; 134 } 135 } 136 137 /** 138 * Saves the World's current state into as a PDB file. 102 139 * 103 140 * \param file where to save the state … … 120 157 } 121 158 159 // we distribute new atom numbers, hence clear map beforehand 160 atomIdMap.clear(); 122 161 { 123 162 vector<atom *> AtomList = World::getInstance().getAllAtoms(); … … 155 194 156 195 /** 157 * Writes one line of tremolo-formatted data to the provided stream.196 * Writes one line of PDB-formatted data to the provided stream. 158 197 * 159 198 * \param stream where to write the line to … … 198 237 if (!currentAtom->ListOfBonds.empty()) { 199 238 *file << "CONECT"; 200 *file << setw(5) << get AtomId(currentAtom->getId());239 *file << setw(5) << getSerial(currentAtom->getId()); 201 240 int MaxNo = 0; 202 241 for(BondList::iterator currentBond = currentAtom->ListOfBonds.begin(); currentBond != currentAtom->ListOfBonds.end(); ++currentBond) { 203 242 if (MaxNo < MaxnumberOfNeighbors) { 204 *file << setw(5) << get AtomId((*currentBond)->GetOtherAtom(currentAtom)->getId());243 *file << setw(5) << getSerial((*currentBond)->GetOtherAtom(currentAtom)->getId()); 205 244 } 206 245 MaxNo++; … … 215 254 * \return value 216 255 */ 217 int PdbParser::getAtomId(int atomid) const 256 size_t PdbParser::getSerial(const size_t atomid) const 257 { 258 ConvertTo<size_t> toSize_t; 259 ASSERT(additionalAtomData.find(atomid) != additionalAtomData.end(), 260 "PdbParser::getSerial: atomid "+toString(atomid)+" not present in Map."); 261 const PdbAtomInfoContainer &atomInfo = additionalAtomData.at(atomid); 262 263 return toSize_t(atomInfo.get(PdbKey::serial)); 264 } 265 266 /** Retrieves a value from PdbParser::atomIdMap. 267 * \param atomid key 268 * \return value 269 */ 270 size_t PdbParser::getAtomId(const size_t atomid) const 218 271 { 219 272 ASSERT(atomIdMap.find(atomid) != atomIdMap.end(), "PdbParser::getAtomId: atomid not present in Map."); … … 226 279 * \return true - key not present, false - value present 227 280 */ 228 void PdbParser::setAtomId( int localatomid, int atomid)229 { 230 pair<std::map< int,int>::iterator, bool > inserter;231 inserter = atomIdMap.insert( pair<int, int>(localatomid, atomid) );281 void PdbParser::setAtomId(const size_t localatomid, const size_t atomid) 282 { 283 pair<std::map<size_t,size_t>::iterator, bool > inserter; 284 inserter = atomIdMap.insert( make_pair(localatomid, atomid) ); 232 285 ASSERT(inserter.second, "PdbParser::setAtomId: atomId already present in Map."); 233 286 } 234 287 235 /** 236 * Reads one data line of a tremolo file and interprets it according to the keys 237 * obtained from the ATOMDATA line. 288 /** Parse an ATOM line from a PDB file. 289 * 290 * Reads one data line of a pdstatus file and interprets it according to the 291 * specifications of the PDB 3.2 format: http://www.wwpdb.org/docs.html 292 * 293 * A new atom is created and filled with available information, non- 294 * standard information is placed in additionalAtomData at the atom's id. 238 295 * 239 296 * \param line to parse as an atom 240 */ 241 void PdbParser::readAtomDataLine(string line) { 242 // vector<string>::iterator it; 243 // stringstream lineStream; 244 // atom* newAtom = World::getInstance().createAtom(); 245 // PdbAtomInfoContainer *atomInfo = NULL; 246 // additionalAtomData[newAtom->getId()] = *(new PdbAtomInfoContainer); 247 // atomInfo = &additionalAtomData[newAtom->getId()]; 248 // PdbKey::atomDataKey currentField; 249 // string word; 250 // int oldId; 251 // double tmp; 252 // 253 // lineStream << line; 254 // for (it = usedFields.begin(); it < usedFields.end(); it++) { 255 // currentField = knownKeys[it->substr(0, it->find("="))]; 256 // switch (currentField) { 257 // case PdbKey::x : 258 // // for the moment, assume there are always three dimensions 259 // for (int i=0;i<NDIM;i++) { 260 // lineStream >> tmp; 261 // newAtom->set(i, tmp); 262 // } 263 // break; 264 // case PdbKey::u : 265 // // for the moment, assume there are always three dimensions 266 // lineStream >> newAtom->AtomicVelocity[0]; 267 // lineStream >> newAtom->AtomicVelocity[1]; 268 // lineStream >> newAtom->AtomicVelocity[2]; 269 // break; 270 // case PdbKey::Type : 271 // char type[3]; 272 // lineStream >> type; 273 // newAtom->setType(World::getInstance().getPeriode()->FindElement(type)); 274 // ASSERT(newAtom->getType(), "Type was not set for this atom"); 275 // break; 276 // case PdbKey::Id : 277 // lineStream >> oldId; 278 // atomIdMap[oldId] = newAtom->getId(); 279 // break; 280 // case PdbKey::neighbors : 281 // readNeighbors(&lineStream, 282 // atoi(it->substr(it->find("=") + 1, 1).c_str()), newAtom->getId()); 283 // break; 284 // default : 285 // lineStream >> word; 286 // atomInfo->set(currentField, word); 287 // break; 288 // } 297 * \param newmol molecule to add parsed atoms to 298 */ 299 void PdbParser::readAtomDataLine(std::string &line, molecule *newmol = NULL) { 300 vector<string>::iterator it; 301 stringstream lineStream; 302 atom* newAtom = World::getInstance().createAtom(); 303 additionalAtomData[newAtom->getId()] = *(new PdbAtomInfoContainer); 304 PdbAtomInfoContainer &atomInfo = additionalAtomData[newAtom->getId()]; 305 string word; 306 ConvertTo<size_t> toSize_t; 307 double tmp; 308 309 lineStream << line; 310 atomInfo.set(PdbKey::serial, line.substr(6,5)); 311 std::pair< std::set<size_t>::const_iterator, bool> Inserter = 312 SerialSet.insert(toSize_t(atomInfo.get(PdbKey::serial))); 313 ASSERT(Inserter.second, 314 "PdbParser::readAtomDataLine() - ATOM contains entry with serial " 315 +atomInfo.get(PdbKey::serial)+" already present!"); 316 // assign hightest+1 instead, but then beware of CONECT entries! Another map needed! 317 // if (!Inserter.second) { 318 // const size_t id = (*SerialSet.rbegin())+1; 319 // SerialSet.insert(id); 320 // atomInfo.set(PdbKey::serial, toString(id)); 321 // DoeLog(2) && (eLog() << Verbose(2) 322 // << "Serial " << atomInfo.get(PdbKey::serial) << " already present, " 323 // << "assigning " << toString(id) << " instead." << std::endl); 289 324 // } 325 326 // check whether serial exists, if so, assign next available 327 328 // DoLog(2) && (Log() << Verbose(2) << "Split line:" 329 // << line.substr(6,5) << "|" 330 // << line.substr(12,4) << "|" 331 // << line.substr(16,1) << "|" 332 // << line.substr(17,3) << "|" 333 // << line.substr(21,1) << "|" 334 // << line.substr(22,4) << "|" 335 // << line.substr(26,1) << "|" 336 // << line.substr(30,8) << "|" 337 // << line.substr(38,8) << "|" 338 // << line.substr(46,8) << "|" 339 // << line.substr(54,6) << "|" 340 // << line.substr(60,6) << "|" 341 // << line.substr(76,2) << "|" 342 // << line.substr(78,2) << std::endl); 343 344 setAtomId(toSize_t(atomInfo.get(PdbKey::serial)), newAtom->getId()); 345 atomInfo.set(PdbKey::name, line.substr(12,4)); 346 atomInfo.set(PdbKey::altloc, line.substr(16,1)); 347 atomInfo.set(PdbKey::resName, line.substr(17,3)); 348 atomInfo.set(PdbKey::chainID, line.substr(21,1)); 349 atomInfo.set(PdbKey::resSeq, line.substr(22,4)); 350 atomInfo.set(PdbKey::iCode, line.substr(26,1)); 351 PdbAtomInfoContainer::ScanKey(tmp, line.substr(30,8)); 352 newAtom->set(0, tmp); 353 PdbAtomInfoContainer::ScanKey(tmp, line.substr(38,8)); 354 newAtom->set(1, tmp); 355 PdbAtomInfoContainer::ScanKey(tmp, line.substr(46,8)); 356 newAtom->set(2, tmp); 357 atomInfo.set(PdbKey::occupancy, line.substr(54,6)); 358 atomInfo.set(PdbKey::tempFactor, line.substr(60,6)); 359 atomInfo.set(PdbKey::charge, line.substr(78,2)); 360 PdbAtomInfoContainer::ScanKey(word, line.substr(76,2)); 361 newAtom->setType(World::getInstance().getPeriode()->FindElement(word)); 362 363 if (newmol != NULL) 364 newmol->AddAtom(newAtom); 365 366 // printAtomInfo(newAtom); 367 } 368 369 /** Prints all PDB-specific information known about an atom. 370 * 371 */ 372 void PdbParser::printAtomInfo(const atom * const newAtom) const 373 { 374 const PdbAtomInfoContainer &atomInfo = additionalAtomData.at(newAtom->getId()); // operator[] const does not exist 375 376 DoLog(1) && (Log() << Verbose(1) << "We know about atom " << newAtom->getId() << ":" << std::endl); 377 DoLog(1) && (Log() << Verbose(1) << "\tserial is " << atomInfo.get(PdbKey::serial) << std::endl); 378 DoLog(1) && (Log() << Verbose(1) << "\tname is " << atomInfo.get(PdbKey::name) << std::endl); 379 DoLog(1) && (Log() << Verbose(1) << "\taltloc is " << atomInfo.get(PdbKey::altloc) << std::endl); 380 DoLog(1) && (Log() << Verbose(1) << "\tresName is " << atomInfo.get(PdbKey::resName) << std::endl); 381 DoLog(1) && (Log() << Verbose(1) << "\tchainID is " << atomInfo.get(PdbKey::chainID) << std::endl); 382 DoLog(1) && (Log() << Verbose(1) << "\tresSeq is " << atomInfo.get(PdbKey::resSeq) << std::endl); 383 DoLog(1) && (Log() << Verbose(1) << "\tiCode is " << atomInfo.get(PdbKey::iCode) << std::endl); 384 DoLog(1) && (Log() << Verbose(1) << "\tx is " << newAtom->getPosition() << std::endl); 385 DoLog(1) && (Log() << Verbose(1) << "\toccupancy is " << atomInfo.get(PdbKey::occupancy) << std::endl); 386 DoLog(1) && (Log() << Verbose(1) << "\ttempFactor is " << atomInfo.get(PdbKey::tempFactor) << std::endl); 387 DoLog(1) && (Log() << Verbose(1) << "\telement is '" << *(newAtom->getType()) << "'" << std::endl); 388 DoLog(1) && (Log() << Verbose(1) << "\tcharge is " << atomInfo.get(PdbKey::charge) << std::endl); 290 389 } 291 390 … … 293 392 * Reads neighbor information for one atom from the input. 294 393 * 295 * \param stream where to read the information from 296 * \param number of neighbors to read 297 * \param world id of the atom the information belongs to 298 */ 299 void PdbParser::readNeighbors(stringstream* line, int numberOfNeighbors, int atomId) { 300 // int neighborId = 0; 301 // for (int i = 0; i < numberOfNeighbors; i++) { 302 // *line >> neighborId; 303 // // 0 is used to fill empty neighbor positions in the tremolo file. 304 // if (neighborId > 0) { 305 // additionalAtomData[atomId].neighbors.push_back(neighborId); 306 // } 307 // } 308 } 309 310 /** 311 * Adds the collected neighbor information to the atoms in the world. The atoms 312 * are found by their current ID and mapped to the corresponding atoms with the 313 * Id found in the parsed file. 314 */ 315 void PdbParser::processNeighborInformation() { 316 // if (!isUsedField("neighbors")) { 317 // return; 318 // } 319 // 320 // for(map<int, PdbAtomInfoContainer>::iterator currentInfo = additionalAtomData.begin(); 321 // currentInfo != additionalAtomData.end(); currentInfo++ 322 // ) { 323 // for(vector<int>::iterator neighbor = currentInfo->second.neighbors.begin(); 324 // neighbor != currentInfo->second.neighbors.end(); neighbor++ 325 // ) { 326 // World::getInstance().getAtom(AtomById(currentInfo->first)) 327 // ->addBond(World::getInstance().getAtom(AtomById(atomIdMap[*neighbor]))); 328 // } 329 // } 394 * \param line to parse as an atom 395 */ 396 void PdbParser::readNeighbors(std::string &line) 397 { 398 const size_t length = line.length(); 399 std::list<size_t> ListOfNeighbors; 400 ConvertTo<size_t> toSize_t; 401 402 // obtain neighbours 403 // show split line for debugging 404 string output; 405 ASSERT(length >=16, 406 "PdbParser::readNeighbors() - CONECT entry has not enough entries: "+line+"!"); 407 // output = "Split line:|"; 408 // output += line.substr(6,5) + "|"; 409 const size_t id = toSize_t(line.substr(6,5)); 410 for (size_t index = 11; index <= 26; index+=5) { 411 if (index+5 <= length) { 412 // output += line.substr(index,5) + "|"; 413 const size_t otherid = toSize_t(line.substr(index,5)); 414 ListOfNeighbors.push_back(otherid); 415 } else { 416 break; 417 } 418 } 419 // DoLog(2) && (Log() << Verbose(2) << output << std::endl); 420 421 // add neighbours 422 atom *_atom = World::getInstance().getAtom(AtomById(getAtomId(id))); 423 for (std::list<size_t>::const_iterator iter = ListOfNeighbors.begin(); 424 iter != ListOfNeighbors.end(); 425 ++iter) { 426 // DoLog(1) && (Log() << Verbose(1) << "Adding Bond (" << getAtomId(id) << "," << getAtomId(*iter) << ")" << std::endl); 427 atom * const _Otheratom = World::getInstance().getAtom(AtomById(getAtomId(*iter))); 428 _atom->addBond(_Otheratom); 429 } 330 430 } 331 431 … … 339 439 * \return input string with modified atom IDs 340 440 */ 341 string PdbParser::adaptIdDependentDataString(string data) {441 //string PdbParser::adaptIdDependentDataString(string data) { 342 442 // // there might be no IDs 343 443 // if (data == "-") { … … 358 458 // 359 459 // return result.str(); 360 return ""; 361 } 362 363 364 PdbAtomInfoContainer::PdbAtomInfoContainer() : 365 name("-"), 366 resName("-"), 367 chainID("0"), 368 resSeq("0"), 369 occupancy("0"), 370 tempFactor("0"), 371 segID("0"), 372 charge("0") 373 {} 374 375 void PdbAtomInfoContainer::set(PdbKey::PdbDataKey key, string value) { 376 switch (key) { 377 case PdbKey::extType : 378 extType = value; 379 break; 380 case PdbKey::name : 381 name = value; 382 break; 383 case PdbKey::resName : 384 resName = value; 385 break; 386 case PdbKey::chainID : 387 chainID = value; 388 break; 389 case PdbKey::resSeq : 390 resSeq = value; 391 break; 392 case PdbKey::occupancy : 393 occupancy = value; 394 break; 395 case PdbKey::tempFactor : 396 tempFactor = value; 397 break; 398 case PdbKey::segID : 399 segID = value; 400 break; 401 case PdbKey::charge : 402 charge = value; 403 break; 404 default : 405 cout << "Unknown key: " << key << ", value: " << value << endl; 406 break; 407 } 408 } 409 410 string PdbAtomInfoContainer::get(PdbKey::PdbDataKey key) { 411 switch (key) { 412 case PdbKey::extType : 413 return extType; 414 case PdbKey::name : 415 return name; 416 case PdbKey::resName : 417 return resName; 418 case PdbKey::chainID : 419 return chainID; 420 case PdbKey::resSeq : 421 return resSeq; 422 case PdbKey::occupancy : 423 return occupancy; 424 case PdbKey::tempFactor : 425 return tempFactor; 426 case PdbKey::segID : 427 return segID; 428 case PdbKey::charge : 429 return charge; 430 default : 431 cout << "Unknown key: " << key << endl; 432 return ""; 433 } 434 } 435 460 // return ""; 461 //} 462 463 464 bool PdbParser::operator==(const PdbParser& b) const 465 { 466 bool status = true; 467 World::AtomComposite atoms = World::getInstance().getAllAtoms(); 468 for (World::AtomComposite::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter) { 469 if ((additionalAtomData.find((*iter)->getId()) != additionalAtomData.end()) 470 && (b.additionalAtomData.find((*iter)->getId()) != b.additionalAtomData.end())) { 471 const PdbAtomInfoContainer &atomInfo = additionalAtomData.at((*iter)->getId()); 472 const PdbAtomInfoContainer &OtheratomInfo = b.additionalAtomData.at((*iter)->getId()); 473 474 status = status && (atomInfo.get(PdbKey::serial) == OtheratomInfo.get(PdbKey::serial)); 475 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in serials!" << std::endl); 476 status = status && (atomInfo.get(PdbKey::name) == OtheratomInfo.get(PdbKey::name)); 477 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in names!" << std::endl); 478 status = status && (atomInfo.get(PdbKey::altloc) == OtheratomInfo.get(PdbKey::altloc)); 479 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in altlocs!" << std::endl); 480 status = status && (atomInfo.get(PdbKey::resName) == OtheratomInfo.get(PdbKey::resName)); 481 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resNames!" << std::endl); 482 status = status && (atomInfo.get(PdbKey::chainID) == OtheratomInfo.get(PdbKey::chainID)); 483 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in chainIDs!" << std::endl); 484 status = status && (atomInfo.get(PdbKey::resSeq) == OtheratomInfo.get(PdbKey::resSeq)); 485 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in resSeqs!" << std::endl); 486 status = status && (atomInfo.get(PdbKey::iCode) == OtheratomInfo.get(PdbKey::iCode)); 487 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in iCodes!" << std::endl); 488 status = status && (atomInfo.get(PdbKey::occupancy) == OtheratomInfo.get(PdbKey::occupancy)); 489 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in occupancies!" << std::endl); 490 status = status && (atomInfo.get(PdbKey::tempFactor) == OtheratomInfo.get(PdbKey::tempFactor)); 491 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in tempFactors!" << std::endl); 492 status = status && (atomInfo.get(PdbKey::charge) == OtheratomInfo.get(PdbKey::charge)); 493 if (!status) DoeLog(1) && (eLog() << Verbose(1) << "Mismatch in charges!" << std::endl); 494 } 495 } 496 497 return status; 498 } 499 -
src/Parser/PdbParser.hpp
rf03705 r001f8a 10 10 11 11 #include <string> 12 #include "Parser/FormatParser.hpp" 12 #include "FormatParser.hpp" 13 #include "PdbAtomInfoContainer.hpp" 14 #include "PdbKey.hpp" 13 15 14 16 /** 15 * Known keys for the Pdb line. 16 */ 17 class PdbKey { 18 public: 19 enum PdbDataKey { 20 noKey, 21 x, 22 Id, 23 Type, 24 extType, 25 name, 26 resName, 27 chainID, 28 resSeq, 29 occupancy, 30 tempFactor, 31 segID, 32 charge 33 }; 34 }; 35 36 /** 37 * Holds tremolo-specific information which is not store in the atom class. 38 */ 39 class PdbAtomInfoContainer { 40 public: 41 PdbAtomInfoContainer(); 42 void set(PdbKey::PdbDataKey key, std::string value); 43 std::string get(PdbKey::PdbDataKey key); 44 std::string name; 45 std::string extType; 46 std::string resName; 47 std::string chainID; 48 std::string resSeq; 49 std::string occupancy; 50 std::string tempFactor; 51 std::string segID; 52 std::string charge; 53 }; 54 55 /** 56 * Loads a tremolo file into the World and saves the World as a tremolo file. 17 * Loads a PDB format 3.2 file into the World and saves the World as a PDB file. 57 18 */ 58 19 class PdbParser : public FormatParser … … 64 25 void save(std::ostream* file); 65 26 27 bool operator==(const PdbParser& b) const; 28 void printAtomInfo(const atom *newAtom) const; 66 29 67 30 private: 68 void readAtomDataLine(string line); 31 enum PdbKey::KnownTokens getToken(string &line); 32 void readAtomDataLine(string &line, molecule *newmol); 69 33 void parseAtomDataKeysLine(string line, int offset); 70 void readNeighbors(std::stringstream* line, int numberOfNeighbors, int atomId); 71 void processNeighborInformation(); 72 void adaptImprData(); 73 void adaptTorsion(); 74 std::string adaptIdDependentDataString(std::string data); 34 void readNeighbors(std::string &line); 35 // void adaptImprData(); 36 // void adaptTorsion(); 37 // std::string adaptIdDependentDataString(std::string data); 75 38 bool isUsedField(std::string fieldName); 76 39 void writeNeighbors(std::ostream* file, int numberOfNeighbors, atom* currentAtom); 77 40 void saveLine(ostream* file, const atom* currentAtom, const char *name, const int AtomNo, const int ResdueNo); 78 int getAtomId(int atomid) const; 79 void setAtomId(int localatomid, int atomid); 41 42 // internal getter and setter 43 size_t getSerial(const size_t atomid) const; 44 size_t getAtomId(const size_t atomid) const; 45 void setAtomId(const size_t localatomid, const size_t atomid); 80 46 81 47 /** 82 48 * Map to associate the known keys with numbers. 83 49 */ 84 std::map<std::string, PdbKey:: PdbDataKey> knownKeys;50 std::map<std::string, PdbKey::KnownTokens> knownTokens; 85 51 86 52 /** … … 88 54 * file. 89 55 */ 90 std::map< int, PdbAtomInfoContainer> additionalAtomData;56 std::map<size_t, PdbAtomInfoContainer> additionalAtomData; 91 57 92 58 /** … … 99 65 * world. 100 66 */ 101 std::map<int, int> atomIdMap; 67 std::map<size_t, size_t> atomIdMap; 68 69 /** 70 * Maps original atom IDs received from the parsed file to atom IDs in the 71 * world. 72 */ 73 std::set<size_t> SerialSet; 74 102 75 }; 103 76 -
src/Parser/XyzParser.cpp
rf03705 r001f8a 84 84 void XyzParser::save(ostream* file) { 85 85 DoLog(0) && (Log() << Verbose(0) << "Saving changes to xyz." << std::endl); 86 if (comment == "") {86 //if (comment == "") { 87 87 time_t now = time((time_t *)NULL); // Get the system time and put it into 'now' as 'calender time' 88 88 comment = "Created by molecuilder on "; … … 94 94 else 95 95 comment += time; 96 }96 //} 97 97 *file << World::getInstance().numAtoms() << endl << "\t" << comment << endl; 98 98 -
src/unittests/Makefile.am
rf03705 r001f8a 35 35 MoleculeDescriptorTest \ 36 36 ObserverTest \ 37 ParserUnitTest \ 37 ParserCommonUnitTest \ 38 ParserTremoloUnitTest \ 38 39 periodentafelTest \ 39 40 PlaneUnittest \ … … 48 49 VectorContentUnitTest \ 49 50 VectorUnitTest 50 51 51 52 52 53 check_PROGRAMS = $(TESTS) 53 54 noinst_PROGRAMS = $(TESTS) TestRunner … … 96 97 MoleculeDescriptorTest.cpp \ 97 98 ObserverTest.cpp \ 98 ParserUnitTest.cpp \ 99 ParserCommonUnitTest.cpp \ 100 ParserTremoloUnitTest.cpp \ 99 101 periodentafelTest.cpp \ 100 102 PlaneUnittest.cpp \ … … 137 139 ObserverTest.hpp \ 138 140 periodentafelTest.hpp \ 139 ParserUnitTest.hpp \ 141 ParserCommonUnitTest.hpp \ 142 ParserTremoloUnitTest.hpp \ 140 143 PlaneUnittest.hpp \ 141 144 RegistryUnitTest.hpp \ … … 203 206 LineUnittest_LDADD = ${ALLLIBS} 204 207 205 LinkedCellUnitTest_SOURCES = UnitTestMain.cpp LinkedCellUnitTest.cpp LinkedCellUnitTest.hpp 208 LinkedCellUnitTest_SOURCES = UnitTestMain.cpp LinkedCellUnitTest.cpp LinkedCellUnitTest.hpp 206 209 LinkedCellUnitTest_LDADD = ${ALLLIBS} 207 210 … … 209 212 ListOfBondsUnitTest_LDADD = ${ALLLIBS} 210 213 211 LogUnitTest_SOURCES = UnitTestMain.cpp logunittest.cpp logunittest.hpp 214 LogUnitTest_SOURCES = UnitTestMain.cpp logunittest.cpp logunittest.hpp 212 215 LogUnitTest_LDADD = ${ALLLIBS} 213 216 … … 227 230 ObserverTest_LDADD = ${ALLLIBS} 228 231 229 ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp 230 ParserUnitTest_LDADD = ${ALLLIBS} 232 ParserCommonUnitTest_SOURCES = UnitTestMain.cpp ParserCommonUnitTest.cpp ParserCommonUnitTest.hpp 233 ParserCommonUnitTest_LDADD = ${ALLLIBS} 234 235 ParserTremoloUnitTest_SOURCES = UnitTestMain.cpp ParserTremoloUnitTest.cpp ParserTremoloUnitTest.hpp 236 ParserTremoloUnitTest_LDADD = ${ALLLIBS} 231 237 232 238 periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp -
tests/regression/Simple_configuration/2/post/test.conf
rf03705 r001f8a 28 28 OutSrcStep 5 # Output "restart" data every ..th step 29 29 TargetTemp 0.000950045 # Target temperature 30 MaxPsiStep 0# number of Minimisation steps per state (0 - default)30 MaxPsiStep 3 # number of Minimisation steps per state (0 - default) 31 31 EpsWannier 1e-07 # tolerance value for spread minimisation of orbitals 32 32 … … 36 36 RelEpsKineticE 1e-05 # relative change in kinetic energy 37 37 MaxMinStopStep 1 # check every ..th steps 38 MaxMinGapStopStep 0# check every ..th steps38 MaxMinGapStopStep 1 # check every ..th steps 39 39 40 40 # Values specifying when to stop for INIT, otherwise same as above … … 43 43 InitRelEpsKineticE 0.0001 # relative change in kinetic energy 44 44 InitMaxMinStopStep 1 # check every ..th steps 45 InitMaxMinGapStopStep 0# check every ..th steps45 InitMaxMinGapStopStep 1 # check every ..th steps 46 46 47 47 BoxLength # (Length of a unit cell) -
tests/regression/Simple_configuration/2/post/test.pdb
rf03705 r001f8a 1 1 REMARK created by molecuilder on Fri Aug 27 12:18:33 2010 2 ATOM 1 H01 nonb 0 10.0 10.0 10.0 1.0 1.0 0 H 02 ATOM 1 H01 tes b 0 10.0 10.0 10.0 1.0 1.0 0 H 0 3 3 END -
tests/regression/Simple_configuration/2/pre/test.xyz
rf03705 r001f8a 1 1 1 2 # test configuration, created by molecuilder test suite 3 H 10 . 10. 10.2 Created by molecuilder on Tue Oct 6 18:34:23 2009 3 H 10 10 10 -
tests/regression/testsuite-domain.at
rf03705 r001f8a 36 36 AT_KEYWORDS([domain]) 37 37 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Domain/5/pre/test.conf .], 0) 38 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ - s"0.5, 1., 0.9"], 0, [stdout], [stderr])38 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ --scale-box "0.5, 1., 0.9"], 0, [stdout], [stderr]) 39 39 AT_CHECK([diff test.conf ${abs_top_srcdir}/${AUTOTEST_PATH}/Domain/5/post/test.conf], 0, [stdout], [stderr]) 40 40 AT_CLEANUP -
tests/regression/testsuite-molecules.at
rf03705 r001f8a 57 57 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/pre/test-*.xyz .], 0) 58 58 AT_CHECK([../../molecuilder -i test-rotated-z90.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 59 AT_CHECK([file="test-rotated-z90.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])59 AT_CHECK([file="test-rotated-z90.xyz"; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 60 60 AT_CHECK([../../molecuilder -i test-rotated-z180.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 61 AT_CHECK([file="test-rotated-z180.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])61 AT_CHECK([file="test-rotated-z180.xyz"; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 62 62 AT_CHECK([../../molecuilder -i test-rotated-z360.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 63 AT_CHECK([file="test-rotated-z360.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])63 AT_CHECK([file="test-rotated-z360.xyz"; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 64 64 AT_CHECK([../../molecuilder -i test-rotated-xYz20.xyz -e ${abs_top_srcdir}/src/ --select-molecule-by-id 0 -m "0,0,1"], 0, [stdout], [stderr]) 65 AT_CHECK([file="test-rotated-xYz20.xyz"; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore])65 AT_CHECK([file="test-rotated-xYz20.xyz"; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/8/post/$file], 0, [ignore], [ignore]) 66 66 AT_CLEANUP 67 67 … … 71 71 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 72 72 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-atoms --rotate-origin 90. --position "0,0,1"], 0, [stdout], [stderr]) 73 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z90.xyz], 0, [ignore], [ignore])73 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z90.xyz], 0, [ignore], [ignore]) 74 74 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 75 75 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-atoms --rotate-origin 180. --position "0,0,1"], 0, [stdout], [stderr]) 76 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z180.xyz], 0, [ignore], [ignore])76 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z180.xyz], 0, [ignore], [ignore]) 77 77 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 78 78 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-atoms --rotate-origin 360. --position "0,0,1"], 0, [stdout], [stderr]) 79 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z360.xyz], 0, [ignore], [ignore])80 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz], 0, [ignore], [ignore])79 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-z360.xyz], 0, [ignore], [ignore]) 80 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz], 0, [ignore], [ignore]) 81 81 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/pre/test.xyz .], 0) 82 82 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-atoms --rotate-origin 20. --position "1,2,1"], 0, [stdout], [stderr]) 83 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore])83 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/9/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore]) 84 84 AT_CLEANUP 85 85 … … 89 89 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 90 90 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 90. --position "0,0,1"], 0, [stdout], [stderr]) 91 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z90.xyz], 0, [ignore], [ignore])91 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z90.xyz], 0, [ignore], [ignore]) 92 92 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 93 93 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 180. --position "0,0,1"], 0, [stdout], [stderr]) 94 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z180.xyz], 0, [ignore], [ignore])94 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z180.xyz], 0, [ignore], [ignore]) 95 95 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 96 96 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 360. --position "0,0,1"], 0, [stdout], [stderr]) 97 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z360.xyz], 0, [ignore], [ignore])98 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz], 0, [ignore], [ignore])97 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-z360.xyz], 0, [ignore], [ignore]) 98 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz], 0, [ignore], [ignore]) 99 99 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/pre/test.xyz .], 0) 100 100 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-all-molecules --rotate-self 20. --position "1,2,1"], 0, [stdout], [stderr]) 101 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore])101 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/10/post/test-rotated-xYz20.xyz], 0, [ignore], [ignore]) 102 102 AT_CLEANUP 103 103 … … 107 107 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/pre/test.xyz test-copy.xyz], 0) 108 108 AT_CHECK([../../molecuilder -i test-copy.xyz -e ${abs_top_srcdir}/src/ --copy-molecule 0 --position "0,0,10"], 0, [stdout], [stderr]) 109 AT_CHECK([diff test-copy.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/post/test-copy.xyz], 0, [ignore], [ignore])109 AT_CHECK([diff -I '.*Created by molecuilder.*' test-copy.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/post/test-copy.xyz], 0, [ignore], [ignore]) 110 110 AT_CLEANUP 111 111 … … 114 114 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/pre/test.xyz test-copy.xyz], 0) 115 115 AT_CHECK([../../molecuilder -i test-copy.xyz -e ${abs_top_srcdir}/src/ --copy-molecule 0 --position "0,0,10" --undo], 0, [stdout], [stderr]) 116 AT_CHECK([diff test-copy.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/pre/test.xyz], 0, [ignore], [ignore])116 AT_CHECK([diff -I '.*Created by molecuilder.*' test-copy.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/pre/test.xyz], 0, [ignore], [ignore]) 117 117 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/pre/test.xyz test-copy.xyz], 0) 118 118 AT_CHECK([../../molecuilder -i test-copy.xyz -e ${abs_top_srcdir}/src/ --copy-molecule 0 --position "0,0,10" --undo --redo], 0, [stdout], [stderr]) 119 AT_CHECK([diff test-copy.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/post/test-copy.xyz], 0, [ignore], [ignore])119 AT_CHECK([diff -I '.*Created by molecuilder.*' test-copy.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Molecules/11/post/test-copy.xyz], 0, [ignore], [ignore]) 120 120 AT_CLEANUP -
tests/regression/testsuite-simple_configuration.at
rf03705 r001f8a 10 10 AT_CLEANUP 11 11 12 # 2. parsing an xyz 13 AT_SETUP([Simple configuration - parsing xyz file]) 14 AT_KEYWORDS([configuration]) 15 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz parsertest.xyz], 0) 16 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o mpqc pcp pdb xyz -p parsertest.xyz], 0, [ignore], [ignore]) 17 AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1 10.000000000 10.000000000 10.000000000 0 # molecule nr 0 18 ], [ignore]) 12 # 2. parsing and storing an xyz 13 AT_SETUP([Simple configuration - loading conf file]) 14 AT_KEYWORDS([configuration]) 15 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o pcp -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.conf], 0, [ignore], [ignore]) 19 16 AT_CHECK([file=test.conf; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 17 AT_CLEANUP 18 AT_SETUP([Simple configuration - not implemented: loading mpqc file]) 19 AT_KEYWORDS([configuration]) 20 #AT_CHECK([../../molecuilder -i test.in -e ${abs_top_srcdir}/src/ -o mpqc -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.in], 139, [ignore], [ignore]) 21 # not working with NDEBUG it's 139, without its 132 22 AT_CLEANUP 23 AT_SETUP([Simple configuration - storing mpqc from loaded xyz file]) 24 AT_KEYWORDS([configuration]) 25 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o mpqc -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz], 0, [ignore], [ignore]) 20 26 AT_CHECK([file=test.in; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 27 AT_CLEANUP 28 AT_SETUP([Simple configuration - loading mpqc file]) 29 AT_KEYWORDS([configuration]) 30 #AT_CHECK([../../molecuilder -i test.in -e ${abs_top_srcdir}/src/ -o mpqc -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.in], 139, [ignore], [ignore]) 31 # not working with NDEBUG it's 139, without its 132 32 AT_CLEANUP 33 AT_SETUP([Simple configuration - loading pdb file]) 34 AT_KEYWORDS([configuration]) 35 AT_CHECK([../../molecuilder -i test.pdb -e ${abs_top_srcdir}/src/ -o pdb -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.pdb], 0, [ignore], [ignore]) 36 AT_CHECK([file=test.pdb; diff -I '.*created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 37 AT_CLEANUP 38 AT_SETUP([Simple configuration - loading xyz file]) 39 AT_KEYWORDS([configuration]) 40 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o xyz -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz], 0, [ignore], [ignore]) 21 41 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 22 AT_CHECK([file=test.pdb; diff -I '.*created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/$file], 0, [ignore], [ignore]) 42 AT_CLEANUP 43 AT_SETUP([Simple configuration - saving conf file]) 44 AT_KEYWORDS([configuration]) 45 AT_CHECK([../../molecuilder -i test.conf -e ${abs_top_srcdir}/src/ -o pcp -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.conf -s store.conf], 0, [ignore], [ignore]) 46 AT_CHECK([diff store.conf ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.conf], 0, [ignore], [ignore]) 47 AT_CLEANUP 48 AT_SETUP([Simple configuration - saving mpqc (from parsed xyz) file]) 49 AT_KEYWORDS([configuration]) 50 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o mpqc -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz -s store.in], 0, [ignore], [ignore]) 51 AT_CHECK([diff store.in ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.in], 0, [ignore], [ignore]) 52 AT_CLEANUP 53 AT_SETUP([Simple configuration - saving pdb file]) 54 AT_KEYWORDS([configuration]) 55 AT_CHECK([../../molecuilder -i test.pdb -e ${abs_top_srcdir}/src/ -o pdb -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.pdb -s store.pdb], 0, [ignore], [ignore]) 56 AT_CHECK([diff -I '.*created by molecuilder.*' store.pdb ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.pdb], 0, [ignore], [ignore]) 57 AT_CLEANUP 58 AT_SETUP([Simple configuration - saving xyz file]) 59 AT_KEYWORDS([configuration]) 60 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ -o xyz -l ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/pre/test.xyz -s store.xyz], 0, [ignore], [ignore]) 61 AT_CHECK([diff -I '.*Created by molecuilder.*' store.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/2/post/test.xyz], 0, [ignore], [ignore]) 23 62 AT_CLEANUP 24 63 … … 47 86 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 48 87 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 ], 0, [ignore], [ignore]) 49 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])88 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 50 89 AT_CLEANUP 51 90 AT_SETUP([Simple configuration - Changing element with Undo/Redo]) … … 53 92 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 54 93 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo], 0, [ignore], [ignore]) 55 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore])94 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/$file], 0, [ignore], [ignore]) 56 95 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/pre/test.xyz test.xyz], 0) 57 96 AT_CHECK([../../molecuilder -i test.xyz -e ${abs_top_srcdir}/src/ --select-atom-by-id 0 -E 6 --undo --redo], 0, [ignore], [ignore]) 58 AT_CHECK([file=test.xyz; diff $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore])97 AT_CHECK([file=test.xyz; diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/4/post/$file], 0, [ignore], [ignore]) 59 98 AT_CLEANUP 60 99 … … 172 211 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/pre/test.xyz .], 0) 173 212 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms -t "1,0,0"], 0, [stdout], [stderr]) 174 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/post/test-shifted.xyz], 0, [ignore], [ignore])213 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/post/test-shifted.xyz], 0, [ignore], [ignore]) 175 214 AT_CLEANUP 176 215 AT_SETUP([Simple configuration - Translation with Undo/Redo]) … … 178 217 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/pre/test.xyz .], 0) 179 218 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms -t "1,0,0" --undo], 0, [stdout], [stderr]) 180 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/pre/test.xyz], 0, [ignore], [ignore])219 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/pre/test.xyz], 0, [ignore], [ignore]) 181 220 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/pre/test.xyz .], 0) 182 221 AT_CHECK([../../molecuilder -i test.xyz --select-all-atoms -t "1,0,0" --undo --redo], 0, [stdout], [stderr]) 183 AT_CHECK([diff test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/post/test-shifted.xyz], 0, [ignore], [ignore])184 AT_CLEANUP 222 AT_CHECK([diff -I '.*Created by molecuilder.*' test.xyz ${abs_top_srcdir}/${AUTOTEST_PATH}/Simple_configuration/9/post/test-shifted.xyz], 0, [ignore], [ignore]) 223 AT_CLEANUP
Note:
See TracChangeset
for help on using the changeset viewer.