Merge branch 'develop' into features/JAL-2295setChimeraAttributes
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 612b168..c8708bd 100644 (file)
@@ -390,6 +390,9 @@ public class StructureSelectionManager
       {
         registerPDBFile(pdb.getId().trim(), pdbFile);
       }
+      // if PDBId is unavailable then skip SIFTS mapping execution path
+      isMapUsingSIFTs = isMapUsingSIFTs && pdb.isPPDBIdAvailable();
+
     } catch (Exception ex)
     {
       ex.printStackTrace();
@@ -802,6 +805,27 @@ public class StructureSelectionManager
       return;
     }
 
+    SearchResults results = findAlignmentPositionsForStructurePositions(atoms);
+    for (Object li : listeners)
+    {
+      if (li instanceof SequenceListener)
+      {
+        ((SequenceListener) li).highlightSequence(results);
+      }
+    }
+  }
+
+  /**
+   * Constructs a SearchResults object holding regions (if any) in the Jalview
+   * alignment which have a mapping to the structure viewer positions in the
+   * supplied list
+   * 
+   * @param atoms
+   * @return
+   */
+  public SearchResults findAlignmentPositionsForStructurePositions(
+          List<AtomSpec> atoms)
+  {
     SearchResults results = new SearchResults();
     for (AtomSpec atom : atoms)
     {
@@ -827,13 +851,7 @@ public class StructureSelectionManager
         }
       }
     }
-    for (Object li : listeners)
-    {
-      if (li instanceof SequenceListener)
-      {
-        ((SequenceListener) li).highlightSequence(results);
-      }
-    }
+    return results;
   }
 
   /**