Browse Source

RO-2605: check for single hkl operator

Sebastian Bittrich 3 years ago
parent
commit
1413afc8c6
2 changed files with 7 additions and 1 deletions
  1. 1 1
      CHANGELOG.md
  2. 6 0
      src/viewer/ui/strucmotif.tsx

+ 1 - 1
CHANGELOG.md

@@ -14,7 +14,7 @@
 - Mol* 3.0.2
 
 ### Bug fixes
-- RO-2605: check for single space-group & NCS operator
+- RO-2605: check for single space-group, hkl, & NCS operator
 
 ## [2.0.9] - 2022-01-24
 ### General

+ 6 - 0
src/viewer/ui/strucmotif.tsx

@@ -100,6 +100,7 @@ class SubmitControls extends PurePluginUIComponent<{}, { isBusy: boolean, residu
         // keep track of seen pdbIds, space-groups, and NCS operators - motifs can only have a single value
         const pdbId: Set<string> = new Set();
         const sg: Set<number> = new Set();
+        const hkl: Set<string> = new Set();
         const ncs: Set<number> = new Set();
         const residueIds: ResidueSelection[] = [];
         const exchanges: Exchange[] = [];
@@ -138,6 +139,7 @@ class SubmitControls extends PurePluginUIComponent<{}, { isBusy: boolean, residu
             const { structure, elements } = l.loci;
             pdbId.add(structure.model.entry);
             sg.add(StructureProperties.unit.spgrOp(location));
+            hkl.add(StructureProperties.unit.hkl(location).join('-'));
             ncs.add(StructureProperties.unit.struct_ncs_oper_id(location));
 
             const struct_oper_list_ids = StructureProperties.unit.pdbx_struct_oper_list_ids(location);
@@ -181,6 +183,10 @@ class SubmitControls extends PurePluginUIComponent<{}, { isBusy: boolean, residu
             alert('Motifs can only appear in a single space-group!');
             return;
         }
+        if (hkl.size > 1) {
+            alert('All motif residues must have matching hkl operators!');
+            return;
+        }
         if (ncs.size > 1) {
             alert('All motif residues must have matching NCS operators!');
             return;