Ver Fonte

fixed polymer/chain-id color theme for coarse models

Alexander Rose há 5 anos atrás
pai
commit
8140b75086
2 ficheiros alterados com 5 adições e 3 exclusões
  1. 2 1
      src/mol-theme/color/chain-id.ts
  2. 3 2
      src/mol-theme/color/polymer-id.ts

+ 2 - 1
src/mol-theme/color/chain-id.ts

@@ -63,7 +63,8 @@ function getAsymIdSerialMap(structure: Structure) {
             const chainIt = Segmentation.transientSegments(chainElementSegments, unit.elements)
             while (chainIt.hasNext) {
                 const { index: chainIndex } = chainIt.move()
-                const asymId = asym_id.value(chainIndex)
+                const elementIndex = chainElementSegments.offsets[chainIndex]
+                const asymId = asym_id.value(elementIndex)
                 if (!map.has(asymId)) map.set(asymId, map.size)
             }
         }

+ 3 - 2
src/mol-theme/color/polymer-id.ts

@@ -68,10 +68,11 @@ function getPolymerAsymIdSerialMap(structure: Structure) {
             const chainIt = Segmentation.transientSegments(chainElementSegments, unit.elements)
             while (chainIt.hasNext) {
                 const { index: chainIndex } = chainIt.move()
-                const entityId = entity_id.value(chainIndex)
+                const elementIndex = chainElementSegments.offsets[chainIndex]
+                const entityId = entity_id.value(elementIndex)
                 const eI = model.entities.getEntityIndex(entityId)
                 if (model.entities.data.type.value(eI) === 'polymer') {
-                    const asymId = asym_id.value(chainIndex)
+                    const asymId = asym_id.value(elementIndex)
                     if (!map.has(asymId)) map.set(asymId, map.size)
                 }
             }