From 9e7b5a1d3af2af268d19b2f82c964ce2c27e9c3e Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 13 Feb 2018 13:45:28 +0000 Subject: [PATCH] =?utf8?q?JAL-2781=20refactor=20possibly=20non-functional=20?= =?utf8?q?=E2=80=98extract=20secondary=20structure=E2=80=99=20logic=20out=20?= =?utf8?q?of=20computeMapping?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../structure/StructureSelectionManager.java | 75 +++++++++++++------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 14cef12..8380b19 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -383,33 +383,16 @@ public class StructureSelectionManager IProgressIndicator progress) { long progressSessionId = System.currentTimeMillis() * 3; + + /** + * do we extract and transfer annotation from 3D data ? */ - boolean parseSecStr = processSecondaryStructure; - if (isPDBFileRegistered(pdbFile)) - { - for (SequenceI sq : sequenceArray) - { - SequenceI ds = sq; - while (ds.getDatasetSequence() != null) - { - ds = ds.getDatasetSequence(); - } - ; - if (ds.getAnnotation() != null) - { - for (AlignmentAnnotation ala : ds.getAnnotation()) - { - // 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 (PDBfile.isCalcIdForFile(ala, findIdForPDBFile(pdbFile))) - { - parseSecStr = false; - } - } - } - } - } + // FIXME: possibly should just delete + + boolean parseSecStr = processSecondaryStructure + ? isStructureFileProcessed(pdbFile, sequenceArray) + : false; + StructureFile pdb = null; boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts(); try @@ -628,6 +611,46 @@ public class StructureSelectionManager return pdb; } + /** + * check if we need to extract secondary structure from given pdbFile and + * transfer to sequences + * + * @param pdbFile + * @param sequenceArray + * @return + */ + private boolean isStructureFileProcessed(String pdbFile, + SequenceI[] sequenceArray) + { + boolean parseSecStr = true; + if (isPDBFileRegistered(pdbFile)) + { + for (SequenceI sq : sequenceArray) + { + SequenceI ds = sq; + while (ds.getDatasetSequence() != null) + { + ds = ds.getDatasetSequence(); + } + ; + if (ds.getAnnotation() != null) + { + for (AlignmentAnnotation ala : ds.getAnnotation()) + { + // 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 (PDBfile.isCalcIdForFile(ala, findIdForPDBFile(pdbFile))) + { + parseSecStr = false; + } + } + } + } + } + return parseSecStr; + } + public void addStructureMapping(StructureMapping sm) { mappings.add(sm); -- 1.7.10.2