Ver Fonte

fix operator joining

JonStargaryen há 3 anos atrás
pai
commit
650638bf75
1 ficheiros alterados com 10 adições e 3 exclusões
  1. 10 3
      src/viewer/ui/strucmotif.tsx

+ 10 - 3
src/viewer/ui/strucmotif.tsx

@@ -117,15 +117,22 @@ class SubmitControls extends PurePluginUIComponent<{}, { isBusy: boolean, residu
             return false;
         };
 
+        function join(opers: any[]) {
+            if (!opers || !opers.length) return '1';
+            if (opers.length > 1) {
+                return opers[1] + 'x' + opers[0];
+            }
+            return opers[0];
+        }
+
         const loci = this.plugin.managers.structure.selection.additionsHistory;
         for (let i = 0; i < Math.min(MAX_MOTIF_SIZE, loci.length); i++) {
             const l = loci[i];
             const { structure, elements } = l.loci;
             pdbId.add(structure.model.entry);
 
-            // need to reverse here as Mol*, for some reason, inverts the order specified in the CIF file
-            const struct_oper_list_ids = StructureProperties.unit.pdbx_struct_oper_list_ids(location).reverse();
-            const struct_oper_id = struct_oper_list_ids?.length ? struct_oper_list_ids.join('x') : '1';
+            const struct_oper_list_ids = StructureProperties.unit.pdbx_struct_oper_list_ids(location);
+            const struct_oper_id = join(struct_oper_list_ids);
 
             // only first element and only first index will be considered (ignoring multiple residues)
             if (!determineBackboneAtom(structure, elements[0])) {