Skip to content
Snippets Groups Projects
Commit c9785128 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

be more permissive when reading atom serial number

OST writes invalid atom serial numbers if they exceed the PDB format limits.
That's a feature not a bug. The new behaviour is that invalid serial numbers
don't get parsed. Any processing function working with these serial numbers
need to manually check for that. The only current effect is when reading
CONECT statements. Atoms with invalid serial numbers are not connected.
parent 4292a637
No related branches found
Tags PYTHON3-v1.0.0
No related merge requests found
......@@ -614,13 +614,10 @@ bool PDBReader::ParseAtomIdent(const StringRef& line, int line_num,
resnum=to_res_num(res_num.second, ins_c);
std::pair<bool, int> tmp = line.substr(6, 5).trim().to_int();
if(!tmp.first) {
if (profile_.fault_tolerant) {
return false;
}
throw IOException(str(format("invalid atom serial on line %d") % line_num));
if(tmp.first) {
// potentially not set - up to the caller to check for that
serial = tmp.second;
}
serial = tmp.second;
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment