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

adjust grid-cell-count in partitionAtomicUnitByResidue

parent 60ba0de2
No related branches found
No related tags found
No related merge requests found
...@@ -579,20 +579,23 @@ namespace Structure { ...@@ -579,20 +579,23 @@ namespace Structure {
// keeps atoms of residues together // keeps atoms of residues together
function partitionAtomicUnitByResidue(model: Model, indices: SortedArray, builder: StructureBuilder) { function partitionAtomicUnitByResidue(model: Model, indices: SortedArray, builder: StructureBuilder) {
model.atomicHierarchy.residueAtomSegments.offsets const { residueAtomSegments } = model.atomicHierarchy
const startIndices: number[] = [] const startIndices: number[] = []
const endIndices: number[] = [] const endIndices: number[] = []
const residueIt = Segmentation.transientSegments(model.atomicHierarchy.residueAtomSegments, indices) const residueIt = Segmentation.transientSegments(residueAtomSegments, indices)
while (residueIt.hasNext) { while (residueIt.hasNext) {
const residueSegment = residueIt.move(); const residueSegment = residueIt.move();
startIndices[startIndices.length] = indices[residueSegment.start] startIndices[startIndices.length] = indices[residueSegment.start]
endIndices[endIndices.length] = indices[residueSegment.end] endIndices[endIndices.length] = indices[residueSegment.end]
} }
const firstResidueAtomCount = endIndices[0] - startIndices[0]
const gridCellCount = 512 * firstResidueAtomCount
const { x, y, z } = model.atomicConformation; const { x, y, z } = model.atomicConformation;
const lookup = GridLookup3D({ x, y, z, indices: SortedArray.ofSortedArray(startIndices) }, 8192); const lookup = GridLookup3D({ x, y, z, indices: SortedArray.ofSortedArray(startIndices) }, gridCellCount);
const { offset, count, array } = lookup.buckets; const { offset, count, array } = lookup.buckets;
for (let i = 0, _i = offset.length; i < _i; i++) { for (let i = 0, _i = offset.length; i < _i; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment