No longer fail pdb conversion when missing compound info

This commit is contained in:
Maarten L. Hekkelman
2025-05-12 12:45:21 +02:00
parent cf34a9f3ad
commit 425f98dc07
2 changed files with 9 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ Version 8.0.1
- Add default value for B_iso_or_equiv in residue::create_new_atom
- Reconstruct some branch records in bare pdbx files
- Fix parsing PDB files (bug due to missing validator in dest. cat.)
- Do not fail conversion of PDB files when compound info is missing
Version 8.0.0
- A dictionary is for a datablock and a file can have

View File

@@ -136,10 +136,10 @@ void checkEntities(datablock &db)
for (std::string comp_id : db["pdbx_poly_seq_scheme"].find<std::string>("entity_id"_key == entity_id, "mon_id"))
{
auto compound = cf.create(comp_id);
assert(compound);
if (not compound)
throw std::runtime_error("missing information for compound " + comp_id);
formula_weight += compound->formula_weight();
if (compound)
formula_weight += compound->formula_weight();
else if (cif::VERBOSE > 0)
std::clog << "missing information for compound " + comp_id << '\n';
++n;
}
@@ -154,10 +154,10 @@ void checkEntities(datablock &db)
for (std::string comp_id : db["pdbx_entity_branch_list"].find<std::string>("entity_id"_key == entity_id, "comp_id"))
{
auto compound = cf.create(comp_id);
assert(compound);
if (not compound)
throw std::runtime_error("missing information for compound " + comp_id);
formula_weight += compound->formula_weight();
if (compound)
formula_weight += compound->formula_weight();
else if (cif::VERBOSE > 0)
std::clog << "missing information for compound " + comp_id << '\n';
++n;
}