JAL-4366 JAL-4371 tighten up detection of chain code and allow two-character codes...
authorJames Procter <j.procter@dundee.ac.uk>
Sun, 14 Jan 2024 15:05:10 +0000 (15:05 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Sun, 14 Jan 2024 15:05:10 +0000 (15:05 +0000)
src/jalview/struture/PDBEntryUtils.java

index 08d192f..2d67434 100644 (file)
@@ -61,7 +61,7 @@ public class PDBEntryUtils
     }
     return targetChainId;
   }
-  protected static Pattern id_and_chain=Pattern.compile("(\\d[0-9A-Za-z]{3})[_:]?(.+)*");
+  protected static Pattern id_and_chain=Pattern.compile("(\\d[0-9A-Za-z]{3})[_:|]?(.{1,2})?");
 
   public static List<PDBEntry> inferPDBEntry(SequenceI seq)
   {
@@ -145,6 +145,8 @@ public class PDBEntryUtils
           putativeEntry = pdbe;
           return putativeEntry;
         }
+      } else {
+        return pdbe;
       }
     }
     return null;