From: jprocter Date: Thu, 23 Jun 2011 14:45:07 +0000 (+0100) Subject: patch for JAL-846 made targetChain mapping constraint selective so X-Git-Tag: Release_2_7~176 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cc20fe9a60ad018141ae58142e93cb3c6b83ec3c;p=jalview.git patch for JAL-846 made targetChain mapping constraint selective so computed mappings are limited to cases where chain codes were explicitly supplied --- 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],