From cc20fe9a60ad018141ae58142e93cb3c6b83ec3c Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 23 Jun 2011 15:45:07 +0100 Subject: [PATCH] patch for JAL-846 made targetChain mapping constraint selective so computed mappings are limited to cases where chain codes were explicitly supplied --- .../structure/StructureSelectionManager.java | 23 +++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index d1bccd8..32241a5 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -152,16 +152,32 @@ public class StructureSelectionManager ex.printStackTrace(); return null; } - + String targetChain; for (int s = 0; s < sequence.length; s++) { + boolean infChain = true; if (targetChains != null && targetChains[s] != null) + { + infChain = false; targetChain = targetChains[s]; + } else if (sequence[s].getName().indexOf("|") > -1) { targetChain = sequence[s].getName().substring( sequence[s].getName().lastIndexOf("|") + 1); + if (targetChain.length() > 1) + { + if (targetChain.trim().length() == 0) + { + targetChain = " "; + } + else + { + // not a valid chain identifier + targetChain = ""; + } + } } else targetChain = ""; @@ -173,14 +189,11 @@ public class StructureSelectionManager boolean first = true; for (int i = 0; i < pdb.chains.size(); i++) { - // TODO: re http://issues.jalview.org/browse/JAL-583 : this patch may - // need to be revoked PDBChain chain = ((PDBChain) pdb.chains.elementAt(i)); - if (targetChain.length() > 0 && !targetChain.equals(chain.id)) + if (targetChain.length() > 0 && !targetChain.equals(chain.id) && !infChain) { continue; // don't try to map chains don't match. } - // end of patch for limiting computed mappings // TODO: correctly determine sequence type for mixed na/peptide // structures AlignSeq as = new AlignSeq(sequence[s], -- 1.7.10.2