Commit 71da0ce3 by Maarten L. Hekkelman

fix in fixing distance for LINK records

parent 7dc574b5
...@@ -5787,20 +5787,28 @@ void PDBFileParser::Parse(std::istream& is, cif::File& result) ...@@ -5787,20 +5787,28 @@ void PDBFileParser::Parse(std::istream& is, cif::File& result)
{ "ptnr1_label_asym_id", "ptnr1_label_seq_id", "ptnr1_label_atom_id", "ptnr1_symmetry", { "ptnr1_label_asym_id", "ptnr1_label_seq_id", "ptnr1_label_atom_id", "ptnr1_symmetry",
"ptnr2_label_asym_id", "ptnr2_label_seq_id", "ptnr2_label_atom_id", "ptnr2_symmetry" }); "ptnr2_label_asym_id", "ptnr2_label_seq_id", "ptnr2_label_atom_id", "ptnr2_symmetry" });
auto a1 = atom_site.find1("label_asym_id"_key == asym1 and "label_seq_id"_key == seq1 and "label_atom_id"_key == atom1); try
auto a2 = atom_site.find1("label_asym_id"_key == asym2 and "label_seq_id"_key == seq2 and "label_atom_id"_key == atom2); {
auto a1 = atom_site.find1("label_asym_id"_key == asym1 and "label_seq_id"_key == seq1 and "label_atom_id"_key == atom1);
auto a2 = atom_site.find1("label_asym_id"_key == asym2 and "label_seq_id"_key == seq2 and "label_atom_id"_key == atom2);
const auto& [x1, y1, z1] = a1.get<float,float,float>({"cartn_x", "cartn_y", "cartn_z"}); const auto& [x1, y1, z1] = a1.get<float,float,float>({"cartn_x", "cartn_y", "cartn_z"});
const auto& [x2, y2, z2] = a2.get<float,float,float>({"cartn_x", "cartn_y", "cartn_z"}); const auto& [x2, y2, z2] = a2.get<float,float,float>({"cartn_x", "cartn_y", "cartn_z"});
float distance = 1.0f; float distance = 1.0f;
if (symm1 == "1_555" and symm2 == "1_555") if (symm1 == "1_555" and symm2 == "1_555")
distance = mmcif::Distance(mmcif::Point{x1, y1, z1}, mmcif::Point{x2, y2, z2}); distance = mmcif::Distance(mmcif::Point{x1, y1, z1}, mmcif::Point{x2, y2, z2});
else if (cif::VERBOSE) else if (cif::VERBOSE)
std::cerr << "Cannot calculate distance for link since one of the atoms is in another dimension" << std::endl; std::cerr << "Cannot calculate distance for link since one of the atoms is in another dimension" << std::endl;
r["pdbx_dist_value"] = distance; r["pdbx_dist_value"] = distance;
}
catch (std::exception& ex)
{
if (cif::VERBOSE)
std::cerr << "Error finding atom: " << ex.what() << std::endl;
}
} }
} }
catch (const std::exception& ex) catch (const std::exception& ex)
......
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