From 1719c61073682fdfe66a63408bab498b6ca4234c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Tue, 13 Feb 2018 13:47:37 +0000 Subject: [PATCH] JAL-2781 refactor StructureSelectionManager.siftsClient to local variable in computeMapping --- src/jalview/structure/StructureSelectionManager.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 434d4ff..0e43841 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -74,8 +74,6 @@ public class StructureSelectionManager private boolean addTempFacAnnot = false; - private SiftsClient siftsClient = null; - /* * Set of any registered mappings between (dataset) sequences. */ @@ -414,7 +412,10 @@ public class StructureSelectionManager ex.printStackTrace(); return null; } - + /* + * sifts client - non null if SIFTS mappings are to be used + */ + SiftsClient siftsClient = null; try { if (isMapUsingSIFTs) @@ -527,7 +528,7 @@ public class StructureSelectionManager try { siftsMapping = getStructureMapping(seq, pdbFile, targetChainId, - pdb, maxChain, sqmpping, maxAlignseq); + pdb, maxChain, sqmpping, maxAlignseq, siftsClient); seqToStrucMapping.add(siftsMapping); maxChain.makeExactMapping(siftsMapping, seq); maxChain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this @@ -559,7 +560,8 @@ public class StructureSelectionManager try { siftsMapping = getStructureMapping(seq, - pdbFile, chain.id, pdb, chain, sqmpping, maxAlignseq); + pdbFile, chain.id, pdb, chain, sqmpping, maxAlignseq, + siftsClient); foundSiftsMappings.add(siftsMapping); chain.makeExactMapping(siftsMapping, seq); chain.transferRESNUMFeatures(seq, "IEA: SIFTS");// FIXME: is this @@ -668,13 +670,15 @@ public class StructureSelectionManager * @param maxChain * @param sqmpping * @param maxAlignseq + * @param siftsClient + * client for retrieval of SIFTS mappings for this structure * @return * @throws SiftsException */ private StructureMapping getStructureMapping(SequenceI seq, String pdbFile, String targetChainId, StructureFile pdb, PDBChain maxChain, jalview.datamodel.Mapping sqmpping, - AlignSeq maxAlignseq) throws SiftsException + AlignSeq maxAlignseq, SiftsClient siftsClient) throws SiftsException { StructureMapping curChainMapping = siftsClient .getSiftsStructureMapping(seq, pdbFile, targetChainId); -- 1.7.10.2