JAL-1823 improvement to all chain code specification from manual pdb entry mode
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 27 May 2016 10:17:14 +0000 (11:17 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 27 May 2016 10:17:14 +0000 (11:17 +0100)
src/jalview/gui/StructureChooser.java

index d924e73..10d3a9d 100644 (file)
@@ -800,6 +800,10 @@ public class StructureChooser extends GStructureChooser implements
       if (pdbEntry == null)
       {
         pdbEntry = new PDBEntry();
+            if (pdbIdStr.split(":").length > 1)
+            {
+              pdbEntry.setChainCode(pdbIdStr.split(":")[1]);
+            }
         pdbEntry.setId(pdbIdStr);
         pdbEntry.setType(PDBEntry.Type.PDB);
         selectedSequence.getDatasetSequence().addPDBId(pdbEntry);
@@ -943,6 +947,9 @@ public class StructureChooser extends GStructureChooser implements
         isValidPBDEntry = false;
         if (txt_search.getText().length() > 0)
         {
+          String searchTerm = txt_search.getText().toLowerCase();
+          searchTerm = searchTerm.split(":")[0];
+          System.out.println(">>>>> search term : " + searchTerm);
           List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
           FTSRestRequest pdbRequest = new FTSRestRequest();
           pdbRequest.setAllowEmptySeq(false);
@@ -950,7 +957,7 @@ public class StructureChooser extends GStructureChooser implements
           pdbRequest.setFieldToSearchBy("(pdb_id:");
           pdbRequest.setWantedFields(wantedFields);
           pdbRequest
-                  .setSearchTerm(txt_search.getText().toLowerCase() + ")");
+.setSearchTerm(searchTerm + ")");
           pdbRequest.setAssociatedSequence(selectedSequence);
           pdbRestCleint = PDBFTSRestClient.getInstance();
           wantedFields.add(pdbRestCleint.getPrimaryKeyColumn());