Browse Source

rename structOperExpression to struct_oper_id

JonStargaryen 3 years ago
parent
commit
95ca2484f1
3 changed files with 13 additions and 9 deletions
  1. 4 0
      CHANGELOG.md
  2. 5 5
      src/viewer/helpers/selection.ts
  3. 4 4
      src/viewer/index.html

+ 4 - 0
CHANGELOG.md

@@ -2,6 +2,10 @@
 
 [Semantic Versioning](https://semver.org/)
 
+## [1.7.1] - 2021-06-30
+### Breaking Changes
+- Rename experimental 'structOperExpression' prop to 'struct_oper_id'
+
 ## [1.7.0] - 2021-06-24
 ### Added
 - Visualize (an arbitrary number of) structural motifs

+ 5 - 5
src/viewer/helpers/selection.ts

@@ -20,7 +20,7 @@ export type Target = {
      * combination thereof. Specify the assemblyId when using this selector. Order matters, use order as specified in
      * the source CIF file.
      */
-    readonly structOperExpression?: string
+    readonly struct_oper_id?: string
 }
 
 export type Range = {
@@ -46,7 +46,7 @@ export type SelectionExpression = {
 
 /**
  * This serves as adapter between the strucmotif-/BioJava-approach to identify transformed chains and the Mol* way.
- * Looks for 'structOperExpression', converts it to an 'operatorName', and removes the original value. This will
+ * Looks for 'struct_oper_id', converts it to an 'operatorName', and removes the original value. This will
  * override pre-existing 'operatorName' values.
  * @param targets collection to process
  * @param structure parent structure
@@ -54,9 +54,9 @@ export type SelectionExpression = {
  */
 export function normalizeTargets(targets: Target[], structure: Structure, operatorName: string = 'ASM_1'): Target[] {
     return targets.map(t => {
-        if (t.structOperExpression) {
-            const { structOperExpression, ...others } = t;
-            const oper = toOperatorName(structure, structOperExpression);
+        if (t.struct_oper_id) {
+            const { struct_oper_id, ...others } = t;
+            const oper = toOperatorName(structure, struct_oper_id);
             return { ...others, operatorName: oper };
         }
         return t.operatorName ? t : { ...t, operatorName };

+ 4 - 4
src/viewer/index.html

@@ -360,7 +360,7 @@
                         targets: [
                             { label_asym_id: 'A', label_seq_id: 61 },
                             { label_asym_id: 'A', label_seq_id: 69 },
-                            { label_asym_id: 'A', label_seq_id: 87, structOperExpression: '4' }
+                            { label_asym_id: 'A', label_seq_id: 87, struct_oper_id: '4' }
                         ],
                     }
                 },
@@ -371,9 +371,9 @@
                         kind: 'motif',
                         assemblyId: '6',
                         targets: [
-                            { label_asym_id: 'A', label_seq_id: 46, structOperExpression: 'X0x5' },
-                            { label_asym_id: 'A', label_seq_id: 49, structOperExpression: 'X0x5' },
-                            { label_asym_id: 'A', label_seq_id: 145, structOperExpression: 'X0x5' }
+                            { label_asym_id: 'A', label_seq_id: 46, struct_oper_id: 'X0x5' },
+                            { label_asym_id: 'A', label_seq_id: 49, struct_oper_id: 'X0x5' },
+                            { label_asym_id: 'A', label_seq_id: 145, struct_oper_id: 'X0x5' }
                         ],
                     }
                 }