message: Added basic residue bonds
diff: @@ -80,49 +80,49 @@ bool PdbFormat::read(std::istream& in, Core::Molecule& mol)
  atomCount++;
  }
  - else if(startsWith(buffer, "TER"))
  - { // This is very important, each TER record also counts in the serial.
  + else if (startsWith(buffer, "TER")) { // This is very important, each TER
  + // record also counts in the serial.
  // Need to account for that when comparing with CONECT
  bool ok(false);
  terList.push_back(lexicalCast<int>(buffer.substr(6, 5), ok));
  - if(!ok)
  - {
  + if (!ok) {
  appendError("Failed to parse TER serial");
  return false;
  }
  }
  - else if(startsWith(buffer, "CONECT"))
  - {
  + else if (startsWith(buffer, "CONECT")) {
  bool ok(false);
  int a = lexicalCast<int>(buffer.substr(6, 5), ok);
  - if (!ok)
  - {
  + if (!ok) {
  appendError("Failed to parse coordinate a " + buffer.substr(6, 5));
  return false;
  }
  --a;
  int terCount;
  - for (terCount = 0; terCount < terList.size() && a > terList[terCount]; ++terCount); // semicolon is intentional
  + for (terCount = 0; terCount < terList.size() && a > terList[terCount];
  + ++terCount)
  + ; // semicolon is intentional
  a = a - terCount;
  int bCoords[] = { 11, 16, 21, 26 };
  - for (int i = 0; i < 4; i++)
  - {
  + for (int i = 0; i < 4; i++) {
  if (trimmed(buffer.substr(bCoords[i], 5)) == "")
  break;
  else {
  bool ok(false);
  int b = lexicalCast<int>(buffer.substr(bCoords[i], 5), ok) - 1;
  - if (!ok)
  - {
  - appendError ("Failed to parse coordinate b" + std::to_string(i) + " " + buffer.substr(bCoords[i], 5));
  + if (!ok) {
  + appendError("Failed to parse coordinate b" + std::to_string(i) +
  + " " + buffer.substr(bCoords[i], 5));
  return false;
  }
  - for (terCount = 0; terCount < terList.size() && b > terList[terCount]; ++terCount); // semicolon is intentional
  + for (terCount = 0; terCount < terList.size() && b > terList[terCount];
  + ++terCount)
  + ; // semicolon is intentional
  b = b - terCount;
  if (a < b) {
  @@ -132,6 +132,7 @@ bool PdbFormat::read(std::istream& in, Core::Molecule& mol)
  }
  }
  } // End while loop
  + mol.perceiveBondsSimple();
  return true;
  } // End read
  