Commit 9a2fc714 by Maarten L. Hekkelman

Fix sheet numbering

parent 85d7b1d5
...@@ -402,7 +402,11 @@ void writeSheets(cif::datablock &db, const dssp &dssp) ...@@ -402,7 +402,11 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
for (auto &&[sheet, strand] : strands) for (auto &&[sheet, strand] : strands)
{ {
for (auto &r : strand) for (auto &r : strand)
{
if (r.type() != ss_type::Strand)
continue;
strandMap[r.nr()] = strandNr; strandMap[r.nr()] = strandNr;
}
++strandNr; ++strandNr;
} }
...@@ -462,10 +466,9 @@ void writeSheets(cif::datablock &db, const dssp &dssp) ...@@ -462,10 +466,9 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
res_list strand1, strand2; res_list strand1, strand2;
int strandIx = 0; for (int strandIx = 0; static_cast<size_t>(strandIx) < strands.size(); ++strandIx)
for (auto const &s : strands)
{ {
const auto &[sSheet, strand] = s; const auto &[sSheet, strand] = strands[strandIx];
if (sSheet != sheet) if (sSheet != sheet)
continue; continue;
...@@ -476,8 +479,6 @@ void writeSheets(cif::datablock &db, const dssp &dssp) ...@@ -476,8 +479,6 @@ void writeSheets(cif::datablock &db, const dssp &dssp)
strand2 = strand; strand2 = strand;
break; break;
} }
++strandIx;
} }
assert(not(strand1.empty() or strand2.empty())); assert(not(strand1.empty() or strand2.empty()));
......
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