From db49817596814aee5d269aabdf640f5bc5ed2363 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 6 Oct 2014 15:51:25 +0100 Subject: [PATCH] JAL-1500 JAL-1265 patch to parse PDB database refs in PFAM stockholm --- src/jalview/util/DBRefUtils.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index d6965f5..4cc888d 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -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.setProperty(new Hashtable()); pdbr.getProperty().put("CHAIN", chaincode); seq.addPDBId(pdbr); + } else { + System.err.println("Malformed PDB DR line:"+acn); } } else -- 1.7.10.2