From: jprocter Date: Sun, 19 Sep 2010 22:37:25 +0000 (+0000) Subject: resolve pdb id/chain to pdb file/model number and chain X-Git-Tag: Release_2_6~24 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=103b87ed34e2ca785e4ecd16a2901feb85363558;p=jalview.git resolve pdb id/chain to pdb file/model number and chain --- diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 09303c7..916579f 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -79,6 +79,7 @@ public abstract class JalviewJmolBinding implements StructureListener, Vector atomsPicked = new Vector(); public Vector chainNames; + Hashtable chainFile; /** * array of target chains for seuqences - tied to pdbentry and sequence[] @@ -210,8 +211,9 @@ public abstract class JalviewJmolBinding implements StructureListener, p = mlength; mlength = lbl.indexOf(":", p); } while (p < mlength && mlength < (lbl.length() - 2)); - cmd.append(":" + lbl.substring(mlength + 1) + " /" - + getModelNum(lbl.substring(0, mlength)) + " or "); + // TODO: lookup each pdb id and recover proper model number for it. + cmd.append(":" + lbl.substring(mlength + 1) + " /" + + (1+getModelNum((String)chainFile.get(lbl))) + " or "); } if (cmd.length() > 0) cmd.setLength(cmd.length() - 4); @@ -543,7 +545,7 @@ public abstract class JalviewJmolBinding implements StructureListener, Color col = sr.getResidueBoxColour(sequence[pdbfnum][s], r); - if (showFeatures) + if (showFeatures && fr!=null) col = fr.findFeatureColour(col, sequence[pdbfnum][s], r); String newSelcom = (mapping[m].getChain() != " " ? ":" + mapping[m].getChain() : "") @@ -1051,6 +1053,7 @@ public abstract class JalviewJmolBinding implements StructureListener, String[] oldmodels = modelFileNames; modelFileNames = null; chainNames = new Vector(); + chainFile = new Hashtable(); boolean notifyLoaded = false; String[] modelfilenames = getPdbFile(); ssm = StructureSelectionManager.getStructureSelectionManager(); @@ -1160,8 +1163,10 @@ public abstract class JalviewJmolBinding implements StructureListener, // add an entry for every chain in the model for (int i = 0; i < pdb.chains.size(); i++) { - chainNames.addElement(new String(pdb.id + ":" - + ((MCview.PDBChain) pdb.chains.elementAt(i)).id)); + String chid = new String(pdb.id + ":" + + ((MCview.PDBChain) pdb.chains.elementAt(i)).id); + chainFile.put(chid, pdbentry[pe].getFile()); + chainNames.addElement(chid); } notifyLoaded = true; }