Browse Source

make assemblyId determination chain-aware

JonStargaryen 3 years ago
parent
commit
449c8a300c
3 changed files with 20 additions and 3 deletions
  1. 4 0
      CHANGELOG.md
  2. 4 3
      src/viewer/helpers/preset.ts
  3. 12 0
      src/viewer/index.html

+ 4 - 0
CHANGELOG.md

@@ -2,6 +2,10 @@
 
 [Semantic Versioning](https://semver.org/)
 
+## [1.7.2] - 2021-07-05
+### Bug fixes
+- Code that determines assemblyId is now aware of label_asym_id
+
 ## [1.7.1] - 2021-07-02
 ### Bug fixes
 - Strucmotif UI now reports chained operators that can be used by sierra/arches/strucmotif

+ 4 - 3
src/viewer/helpers/preset.ts

@@ -334,17 +334,18 @@ function determineAssemblyId(traj: any, p: MotifProps) {
         return ret;
     }
 
-    // set of provided struct_oper_ids
-    const struct_oper_ids = p.targets.map(t => t.struct_oper_id || '1').filter((x, i, a) => a.indexOf(x) === i);
+    // set of provided [struct_oper_id, label_asym_id] combinations
+    const ids = p.targets.map(t => [t.struct_oper_id || '1', t.label_asym_id!]).filter((x, i, a) => a.indexOf(x) === i);
 
     try {
         // find first assembly that contains all requested struct_oper_ids - if multiple, the first will be returned
         const pdbx_struct_assembly_gen = traj.obj.data.representative.sourceData.data.frame.categories.pdbx_struct_assembly_gen;
         const assembly_id = pdbx_struct_assembly_gen.getField('assembly_id');
         const oper_expression = pdbx_struct_assembly_gen.getField('oper_expression');
+        const asym_id_list = pdbx_struct_assembly_gen.getField('asym_id_list');
 
         for (let i = 0, il = pdbx_struct_assembly_gen.rowCount; i < il; i++) {
-            if (struct_oper_ids.some(val => !equals(oper_expression.str(i), val))) continue;
+            if (ids.some(val => !equals(oper_expression.str(i), val[0]) || asym_id_list.str(i).indexOf(val[1]) === -1)) continue;
 
             Object.assign(p, { assemblyId: assembly_id.str(i) });
             return;

+ 12 - 0
src/viewer/index.html

@@ -376,6 +376,18 @@
                             { label_asym_id: 'A', label_seq_id: 145, struct_oper_id: 'X0x5' }
                         ],
                     }
+                },
+                {
+                    id: '1G2F',
+                    info: 'motif selection with strucmotif-expression & chain: STRUCTURE OF A CYS2HIS2 ZINC FINGER/TATA BOX COMPLEX (TATAZF;CLONE #6)',
+                    props: {
+                        kind: 'motif',
+                        targets: [
+                            { label_asym_id: 'F', label_seq_id: 7 },
+                            { label_asym_id: 'F', label_seq_id: 25 },
+                            { label_asym_id: 'F', label_seq_id: 29 }
+                        ],
+                    }
                 }
             ];