From e59522eaf09bd68c355590d144c004d0a0b14bfa Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 30 Oct 2014 15:47:07 +0000 Subject: [PATCH] JAL-674 use PDB ID<>File registry to look up correct ID for PDB file derived annotation on a mapped sequence --- .../structure/StructureSelectionManager.java | 32 +++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 449e133..9396be1 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -246,17 +246,29 @@ public class StructureSelectionManager */ MCview.PDBfile pdb = null; boolean parseSecStr=true; - for (SequenceI sq:sequence) + if (isPDBFileRegistered(pdbFile)) { - SequenceI ds = sq;while (ds.getDatasetSequence()!=null) { ds = ds.getDatasetSequence();}; - if (ds.getAnnotation()!=null) + for (SequenceI sq : sequence) { - for (AlignmentAnnotation ala:ds.getAnnotation()) + SequenceI ds = sq; + while (ds.getDatasetSequence() != null) { - // false if any annotation present from this structure - if (MCview.PDBfile.isCalcIdForFile(ala.getCalcId(), pdbFile)) + ds = ds.getDatasetSequence(); + } + ; + if (ds.getAnnotation() != null) + { + for (AlignmentAnnotation ala : ds.getAnnotation()) { - parseSecStr = false; + + // false if any annotation present from this structure + // JBPNote this fails for jmol/chimera view because the *file* is + // passed, not the structure data ID - + if (MCview.PDBfile.isCalcIdForFile(ala.getCalcId(), + findIdForPDBFile(pdbFile))) + { + parseSecStr = false; + } } } } @@ -264,7 +276,11 @@ public class StructureSelectionManager try { pdb = new MCview.PDBfile(true, parseSecStr, pdbFile, protocol); - + if (pdb.id != null && pdb.id.trim().length() > 0 + && FormatAdapter.FILE.equals(protocol)) + { + registerPDBFile(pdb.id.trim(), pdbFile); + } } catch (Exception ex) { ex.printStackTrace(); -- 1.7.10.2