JAL-3390 JAL-3400 revised commands to show structure / hide chains
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index 054ed2f..e1045c0 100644 (file)
@@ -1161,6 +1161,28 @@ public class StructureSelectionManager
   }
 
   /**
+   * Answers a (possibly empty) list of structure to sequence mappings matching
+   * the given pdb and chain ids
+   * 
+   * @param pdbId
+   * @param chain
+   * @return
+   */
+  public List<StructureMapping> getMappingForChain(String pdbId,
+          String chain)
+  {
+    List<StructureMapping> result = new ArrayList<>();
+    for (StructureMapping sm : mappings)
+    {
+      if (sm.pdbid.equals(pdbId) && sm.pdbchain.equals(chain))
+      {
+        result.add(sm);
+      }
+    }
+    return result;
+  }
+
+  /**
    * Returns a readable description of all mappings for the given pdbfile to any
    * of the given sequences
    *