Commit f0a913cc by Maarten L. Hekkelman

Fixes for deuterium...

Fixes for sugar branches
parent de4fc8a0
......@@ -166,7 +166,7 @@ enum atom_type : uint8_t
No = 102, // Nobel­ium
Lr = 103, // Lawren­cium
D = 129, // Deuterium
D = 119, // Deuterium
};
// --------------------------------------------------------------------
......
......@@ -81,6 +81,11 @@ struct symop_data
return m_packed == rhs.m_packed;
}
bool operator<(const symop_data &rhs) const
{
return m_packed < rhs.m_packed;
}
std::array<int, 15> data() const
{
return {
......
......@@ -1077,9 +1077,13 @@ bool atom_type_traits::is_metal(const std::string& symbol)
auto atom_type_traits::wksf(int charge) const -> const SFData&
{
auto type = m_info->type;
if (type == D)
type = H;
for (auto& sf: data::kWKSFData)
{
if (sf.symbol == m_info->type and sf.charge == charge)
if (sf.symbol == type and sf.charge == charge)
return sf.sf;
}
......@@ -1092,7 +1096,7 @@ auto atom_type_traits::wksf(int charge) const -> const SFData&
for (auto& sf: data::kWKSFData)
{
if (sf.symbol == m_info->type and sf.charge == 0)
if (sf.symbol == type and sf.charge == 0)
return sf.sf;
}
}
......@@ -1102,9 +1106,13 @@ auto atom_type_traits::wksf(int charge) const -> const SFData&
auto atom_type_traits::elsf() const -> const SFData&
{
auto type = m_info->type;
if (type == D)
type = H;
for (auto& sf: data::kELSFData)
{
if (sf.symbol == m_info->type)
if (sf.symbol == type)
return sf.sf;
}
......
......@@ -1118,8 +1118,8 @@ branch::branch(structure &structure, const std::string &asym_id)
for (const auto &[num1, num2, atom1, atom2] : branch_link.find<size_t, size_t, std::string, std::string>(
"entity_id"_key == entity_id, "entity_branch_list_num_1", "entity_branch_list_num_2", "atom_id_1", "atom_id_2"))
{
if (not iequals(atom1, "c1"))
throw std::runtime_error("invalid pdbx_entity_branch_link");
// if (not iequals(atom1, "c1"))
// throw std::runtime_error("invalid pdbx_entity_branch_link");
auto &s1 = at(num1 - 1);
auto &s2 = at(num2 - 1);
......@@ -1143,8 +1143,8 @@ void branch::link_atoms()
for (const auto &[num1, num2, atom1, atom2] : branch_link.find<size_t, size_t, std::string, std::string>(
"entity_id"_key == entity_id, "entity_branch_list_num_1", "entity_branch_list_num_2", "atom_id_1", "atom_id_2"))
{
if (not iequals(atom1, "c1"))
throw std::runtime_error("invalid pdbx_entity_branch_link");
// if (not iequals(atom1, "c1"))
// throw std::runtime_error("invalid pdbx_entity_branch_link");
auto &s1 = at(num1 - 1);
auto &s2 = at(num2 - 1);
......@@ -1279,7 +1279,7 @@ void structure::load_atoms_for_model(StructureOpenOptions options)
if (model_nr and *model_nr != m_model_nr)
continue;
if ((options bitand StructureOpenOptions::SkipHydrogen) and type_symbol == "H")
if ((options bitand StructureOpenOptions::SkipHydrogen) and (type_symbol == "H" or type_symbol == "D"))
continue;
emplace_atom(std::make_shared<atom::atom_impl>(m_db, id));
......
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