JAL-4366 JAL-4371 allow cruft after inferred pdb ids, ex 1xyz_A.pdb yields 1xyzA
authorJames Procter <j.procter@dundee.ac.uk>
Mon, 15 Jan 2024 17:16:03 +0000 (17:16 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Mon, 15 Jan 2024 17:16:57 +0000 (17:16 +0000)
src/jalview/gui/structurechooser/PDBStructureChooserQuerySource.java
src/jalview/struture/PDBEntryUtils.java

index 2aa0401..bd9a2ab 100644 (file)
@@ -146,7 +146,7 @@ public class PDBStructureChooserQuerySource
       }
     }
     
-    if (!isPDBRefsFound && !isUniProtRefsFound)
+    if (!isPDBRefsFound && !isUniProtRefsFound && pdbids.isEmpty())
     {
       String seqName = seq.getName();
       seqName = sanitizeSeqName(seqName);
index 2d67434..131030c 100644 (file)
@@ -61,11 +61,12 @@ public class PDBEntryUtils
     }
     return targetChainId;
   }
-  protected static Pattern id_and_chain=Pattern.compile("(\\d[0-9A-Za-z]{3})[_:|]?(.{1,2})?");
+  protected static Pattern id_and_chain=Pattern.compile("(\\d[0-9A-Za-z]{3})[_:|]?([0-9A-Za-z]{1,2})?.*");
 
   public static List<PDBEntry> inferPDBEntry(SequenceI seq)
   {
     Matcher matcher = id_and_chain.matcher(seq.getName());
+    
     if (matcher.matches())
     {
       String id = matcher.group(1);