浏览代码

fixed wrong property use in seq widget

Alexander Rose 5 年之前
父节点
当前提交
e226f27041
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 7 2
      src/mol-plugin/ui/sequence.tsx
  2. 1 1
      src/mol-plugin/ui/sequence/polymer.ts

+ 7 - 2
src/mol-plugin/ui/sequence.tsx

@@ -10,7 +10,7 @@ import { PluginUIComponent } from './base';
 import { StateTreeSpine } from '../../mol-state/tree/spine';
 import { PluginStateObject as SO } from '../state/objects';
 import { Sequence } from './sequence/sequence';
-import { Structure, StructureElement, StructureProperties as SP } from '../../mol-model/structure';
+import { Structure, StructureElement, StructureProperties as SP, Unit } from '../../mol-model/structure';
 import { SequenceWrapper } from './sequence/wrapper';
 import { PolymerSequenceWrapper } from './sequence/polymer';
 import { StructureElementSelectionManager } from '../util/structure-element-selection';
@@ -75,7 +75,12 @@ function getChainOptions(structure: Structure, entityId: string) {
         const id = unit.invariantId
         if (seen.has(id)) continue
 
-        let label = `${SP.chain.label_asym_id(l)}: ${SP.chain.auth_asym_id(l)}`
+        let label = ''
+        if (Unit.isAtomic(unit)) {
+            label = `${SP.chain.label_asym_id(l)}: ${SP.chain.auth_asym_id(l)}`
+        } else {
+            label = `${SP.coarse.asym_id(l)}`
+        }
         if (SP.entity.type(l) === 'water') {
             const count = water.get(label) || 1
             water.set(label, count + 1)

+ 1 - 1
src/mol-plugin/ui/sequence/polymer.ts

@@ -72,7 +72,7 @@ export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> {
         this.missing = data.unit.model.properties.missingResidues
 
         this.modelNum = data.unit.model.modelNum
-        this.asymId = SP.chain.label_asym_id(l)
+        this.asymId = Unit.isAtomic(data.unit) ? SP.chain.label_asym_id(l) : SP.coarse.asym_id(l)
 
         const missing: number[] = []
         for (let i = 0; i < length; ++i) {