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

fixed carb terminal links

parent aad85a79
No related branches found
No related tags found
No related merge requests found
...@@ -203,12 +203,12 @@ function markCarbohydrate(loci: Loci, structure: Structure, apply: (interval: In ...@@ -203,12 +203,12 @@ function markCarbohydrate(loci: Loci, structure: Structure, apply: (interval: In
for (const e of loci.elements) { for (const e of loci.elements) {
OrderedSet.forEach(e.indices, v => { OrderedSet.forEach(e.indices, v => {
const { model, elements } = e.unit const { model, elements } = e.unit
const { index, offsets } = model.atomicHierarchy.residueAtomSegments const { index, offsets } = model.atomicHierarchy.residueAtomSegments
const rI = index[elements[v]] const rI = index[elements[v]]
const unitIndexMin = OrderedSet.findPredecessorIndex(elements, offsets[rI]) const unitIndexMin = OrderedSet.findPredecessorIndex(elements, offsets[rI])
const unitIndexMax = OrderedSet.findPredecessorIndex(elements, offsets[rI + 1] - 1) const unitIndexMax = OrderedSet.findPredecessorIndex(elements, offsets[rI + 1] - 1)
const unitIndexInterval = Interval.ofRange(unitIndexMin, unitIndexMax) const unitIndexInterval = Interval.ofRange(unitIndexMin, unitIndexMax)
if(!OrderedSet.isSubset(e.indices, unitIndexInterval)) return if (!OrderedSet.isSubset(e.indices, unitIndexInterval)) return
const eI = getAnomericCarbon(e.unit, rI) const eI = getAnomericCarbon(e.unit, rI)
if (eI !== undefined) { if (eI !== undefined) {
const idx = getElementIndex(e.unit, eI) const idx = getElementIndex(e.unit, eI)
......
...@@ -34,9 +34,9 @@ async function createCarbohydrateTerminalLinkCylinderMesh(ctx: VisualContext, st ...@@ -34,9 +34,9 @@ async function createCarbohydrateTerminalLinkCylinderMesh(ctx: VisualContext, st
const l = terminalLinks[edgeIndex] const l = terminalLinks[edgeIndex]
if (l.fromCarbohydrate) { if (l.fromCarbohydrate) {
Vec3.copy(posA, elements[l.carbohydrateIndex].geometry.center) Vec3.copy(posA, elements[l.carbohydrateIndex].geometry.center)
l.elementUnit.conformation.position(l.elementIndex, posB) l.elementUnit.conformation.position(l.elementUnit.elements[l.elementIndex], posB)
} else { } else {
l.elementUnit.conformation.position(l.elementIndex, posA) l.elementUnit.conformation.position(l.elementUnit.elements[l.elementIndex], posA)
Vec3.copy(posB, elements[l.carbohydrateIndex].geometry.center) Vec3.copy(posB, elements[l.carbohydrateIndex].geometry.center)
} }
}, },
...@@ -123,7 +123,7 @@ function getTerminalLinkLoci(pickingId: PickingId, structure: Structure, id: num ...@@ -123,7 +123,7 @@ function getTerminalLinkLoci(pickingId: PickingId, structure: Structure, id: num
l.elementUnit, l.elementIndex, l.elementUnit, l.elementIndex,
carb.unit, carbIndex as StructureElement.UnitIndex carb.unit, carbIndex as StructureElement.UnitIndex
) )
]) ])
} }
return EmptyLoci return EmptyLoci
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment