JAL-1683 replace year/version strings with tokens in source
[jalview.git] / src / jalview / util / DBRefUtils.java
index a757d79..9a4ffc8 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -418,11 +418,15 @@ public class DBRefUtils
         // check for chaincode and mapping
         // PFAM style stockhom PDB citation
         com.stevesoft.pat.Regex r = new com.stevesoft.pat.Regex(
-                "([0-9][0-9A-Za-z]{3})\\s*(.?)\\s*;([0-9]+)-([0-9]+)");
+                "([0-9][0-9A-Za-z]{3})\\s*(.?)\\s*;\\s*([0-9]+)-([0-9]+)");
         if (r.search(acn.trim()))
         {
           String pdbid = r.stringMatched(1);
           String chaincode = r.stringMatched(2);
+          if (chaincode==null)
+          {
+            chaincode = " ";
+          }
           String mapstart = r.stringMatched(3);
           String mapend = r.stringMatched(4);
           if (chaincode.equals(" "))
@@ -433,8 +437,11 @@ public class DBRefUtils
           ref = new DBRefEntry(locsrc, version, pdbid + chaincode);
           PDBEntry pdbr = new PDBEntry();
           pdbr.setId(pdbid);
-          pdbr.getProperty().put("CHAIN",chaincode);
+          pdbr.setProperty(new Hashtable());
+          pdbr.getProperty().put("CHAIN", chaincode);
           seq.addPDBId(pdbr);
+        } else {
+          System.err.println("Malformed PDB DR line:"+acn);
         }
       }
       else