Commit ecbef51b by Maarten L. Hekkelman

- fix category::clear

- fix dssp TCO value
parent dfff8c95
...@@ -1065,8 +1065,20 @@ size_t category::erase(condition &&cond, std::function<void(row_handle)> &&visit ...@@ -1065,8 +1065,20 @@ size_t category::erase(condition &&cond, std::function<void(row_handle)> &&visit
void category::clear() void category::clear()
{ {
while (m_head != nullptr) auto i = m_head;
erase(begin()); while (i != nullptr)
{
auto t = i;
i = i->m_next;
delete_row(t);
}
m_head = m_tail = nullptr;
delete m_index;
if (m_validator != nullptr)
m_index = new category_index(this);
} }
void category::erase_orphans(condition &&cond) void category::erase_orphans(condition &&cond)
......
...@@ -1364,12 +1364,9 @@ DSSP_impl::DSSP_impl(const cif::datablock &db, int model_nr, int min_poly_prolin ...@@ -1364,12 +1364,9 @@ DSSP_impl::DSSP_impl(const cif::datablock &db, int model_nr, int min_poly_prolin
cur.mNext = &next; cur.mNext = &next;
} }
for (size_t i = 0; i + 1 < mResidues.size(); ++i) for (size_t i = 0; i < mResidues.size(); ++i)
{ {
auto &cur = mResidues[i]; auto &cur = mResidues[i];
auto &next = mResidues[i + 1];
next.assignHydrogen();
if (i >= 2 and i + 2 < mResidues.size()) if (i >= 2 and i + 2 < mResidues.size())
{ {
...@@ -1388,8 +1385,13 @@ DSSP_impl::DSSP_impl(const cif::datablock &db, int model_nr, int min_poly_prolin ...@@ -1388,8 +1385,13 @@ DSSP_impl::DSSP_impl(const cif::datablock &db, int model_nr, int min_poly_prolin
} }
} }
if (NoChainBreak(cur, next)) if (i + 1 < mResidues.size())
cur.mPsi = dihedral_angle(cur.mN, cur.mCAlpha, cur.mC, next.mN); {
auto &next = mResidues[i + 1];
next.assignHydrogen();
if (NoChainBreak(cur, next))
cur.mPsi = dihedral_angle(cur.mN, cur.mCAlpha, cur.mC, next.mN);
}
if (i > 0) if (i > 0)
{ {
...@@ -1404,6 +1406,7 @@ DSSP_impl::DSSP_impl(const cif::datablock &db, int model_nr, int min_poly_prolin ...@@ -1404,6 +1406,7 @@ DSSP_impl::DSSP_impl(const cif::datablock &db, int model_nr, int min_poly_prolin
if (i >= 1 and i + 2 < mResidues.size()) if (i >= 1 and i + 2 < mResidues.size())
{ {
auto &prev = mResidues[i - 1]; auto &prev = mResidues[i - 1];
auto &next = mResidues[i + 1];
auto &nextNext = mResidues[i + 2]; auto &nextNext = mResidues[i + 2];
if (NoChainBreak(prev, nextNext)) if (NoChainBreak(prev, nextNext))
......
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