Browse Source

fix polymer sequence widget .getLoci

was not taking operator.name into account
Alexander Rose 5 years ago
parent
commit
d9bac2916c
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/mol-plugin/ui/sequence/polymer.ts

+ 6 - 3
src/mol-plugin/ui/sequence/polymer.ts

@@ -58,7 +58,7 @@ export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> {
     }
 
     getLoci(seqIdx: number) {
-        const query = createResidueQuery(this.data.units[0].chainGroupId, this.seqId(seqIdx));
+        const query = createResidueQuery(this.data.units[0].chainGroupId, this.data.units[0].conformation.operator.name, this.seqId(seqIdx));
         return StructureSelection.toLociWithSourceUnits(StructureQuery.run(query, this.data.structure));
     }
 
@@ -88,10 +88,13 @@ export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> {
     }
 }
 
-function createResidueQuery(chainGroupId: number, label_seq_id: number) {
+function createResidueQuery(chainGroupId: number, operatorName: string, label_seq_id: number) {
     return Queries.generators.atoms({
         unitTest: ctx => {
-            return SP.unit.chainGroupId(ctx.element) === chainGroupId
+            return (
+                SP.unit.chainGroupId(ctx.element) === chainGroupId &&
+                SP.unit.operator_name(ctx.element) === operatorName
+            )
         },
         residueTest: ctx => {
             if (ctx.element.unit.kind === Unit.Kind.Atomic) {