Commit 66fa88ec by maarten

more diagnostics for Robbie

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@292 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 4738d979
...@@ -3290,7 +3290,8 @@ void PDBFileParser::ConstructEntities() ...@@ -3290,7 +3290,8 @@ void PDBFileParser::ConstructEntities()
if (residuesSeen.count(k) == 0) if (residuesSeen.count(k) == 0)
residuesSeen[k] = resName; residuesSeen[k] = resName;
else if (residuesSeen[k] != resName) else if (residuesSeen[k] != resName)
throw runtime_error("inconsistent residue type for " + string{chainID} + to_string(resSeq) + iCode + altLoc); throw runtime_error("inconsistent residue type for " + string{chainID} + to_string(resSeq) + iCode + altLoc + "\n" +
" (" + residuesSeen[k] + " != " + resName + ")");
auto& chain = GetChainForID(chainID); auto& chain = GetChainForID(chainID);
...@@ -5200,6 +5201,7 @@ void PDBFileParser::Parse(istream& is, cif::File& result) ...@@ -5200,6 +5201,7 @@ void PDBFileParser::Parse(istream& is, cif::File& result)
ParseCoordinateTransformation(); ParseCoordinateTransformation();
uint32 modelNr = 1; uint32 modelNr = 1;
bool hasAtoms = false;
while (mRec->is("MODEL ") or mRec->is("ATOM ") or mRec->is("HETATM")) while (mRec->is("MODEL ") or mRec->is("ATOM ") or mRec->is("HETATM"))
{ {
...@@ -5213,6 +5215,8 @@ void PDBFileParser::Parse(istream& is, cif::File& result) ...@@ -5213,6 +5215,8 @@ void PDBFileParser::Parse(istream& is, cif::File& result)
GetNextRecord(); GetNextRecord();
} }
hasAtoms = hasAtoms or mRec->is("ATOM ") or mRec->is("HETATM");
ParseCoordinate(modelNr); ParseCoordinate(modelNr);
if (model) if (model)
...@@ -5222,6 +5226,9 @@ void PDBFileParser::Parse(istream& is, cif::File& result) ...@@ -5222,6 +5226,9 @@ void PDBFileParser::Parse(istream& is, cif::File& result)
} }
} }
if (not hasAtoms)
throw runtime_error("Either the PDB file has no atom records, or the field " + string(mRec->mName) + " is not at the correct location");
for (auto e: mAtomTypes) for (auto e: mAtomTypes)
getCategory("atom_type")->emplace({ getCategory("atom_type")->emplace({
{ "symbol", e } { "symbol", e }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment