Skip to content
Snippets Groups Projects
Commit bc6bc1d5 authored by Alexander Rose's avatar Alexander Rose
Browse files

fix StructureElement.Stats

parent 4a692b9a
No related branches found
No related tags found
No related merge requests found
...@@ -52,13 +52,15 @@ export namespace Stats { ...@@ -52,13 +52,15 @@ export namespace Stats {
const { index, offsets } = unit.model.atomicHierarchy.residueAtomSegments const { index, offsets } = unit.model.atomicHierarchy.residueAtomSegments
let i = 0 let i = 0
while (i < size) { while (i < size) {
let j = 0
const eI = elements[OrderedSet.getAt(indices, i)] const eI = elements[OrderedSet.getAt(indices, i)]
const rI = index[eI] const rI = index[eI]
while (i < size && index[elements[OrderedSet.getAt(indices, i)]] === rI) { while (i < size && index[elements[OrderedSet.getAt(indices, i)]] === rI) {
++i ++i
++j
} }
if (offsets[rI + 1] - offsets[rI] === i) { if (offsets[rI + 1] - offsets[rI] === j) {
// full residue // full residue
stats.residueCount += 1 stats.residueCount += 1
if (stats.residueCount === 1) { if (stats.residueCount === 1) {
...@@ -66,7 +68,7 @@ export namespace Stats { ...@@ -66,7 +68,7 @@ export namespace Stats {
} }
} else { } else {
// partial residue // partial residue
stats.elementCount += i stats.elementCount += j
} }
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment