X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=c90b3c83f27b797bdae15fb64aa93cd6fd7b0bb6;hb=refs%2Fheads%2Ffeatures%2FJAL-2040_JAL-2137_phyre2;hp=7db85ff49985f496af075ca6aa5cf4fc1cba0acf;hpb=13bc8a3fb89b083922d9fa9dad5050e6aaa1f661;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 7db85ff..c90b3c8 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -32,6 +32,7 @@ import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; import jalview.datamodel.SearchResults; import jalview.datamodel.SequenceI; +import jalview.ext.jmol.JmolParser; import jalview.gui.IProgressIndicator; import jalview.io.AppletFormatAdapter; import jalview.io.StructureFile; @@ -326,7 +327,6 @@ public class StructureSelectionManager return setMapping(true, sequence, targetChains, pdbFile, protocol); } - /** * create sequence structure mappings between each sequence and the given * pdbFile (retrieved via the given protocol). @@ -347,8 +347,7 @@ public class StructureSelectionManager */ synchronized public StructureFile setMapping(boolean forStructureView, SequenceI[] sequenceArray, String[] targetChainIds, - String pdbFile, - String protocol) + String pdbFile, String protocol) { /* * There will be better ways of doing this in the future, for now we'll use @@ -384,14 +383,16 @@ public class StructureSelectionManager boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts(); try { - pdb = new jalview.ext.jmol.JmolParser(addTempFacAnnot, parseSecStr, - secStructServices, pdbFile, protocol); + pdb = new JmolParser(pdbFile, protocol); if (pdb.getId() != null && pdb.getId().trim().length() > 0 && AppletFormatAdapter.FILE.equals(protocol)) { registerPDBFile(pdb.getId().trim(), pdbFile); } + // if PDBId is unavailable then skip SIFTS mapping execution path + isMapUsingSIFTs = pdb.isPPDBIdAvailable(); + } catch (Exception ex) { ex.printStackTrace(); @@ -538,8 +539,7 @@ public class StructureSelectionManager try { StructureMapping siftsMapping = getStructureMapping(seq, - pdbFile, - chain.id, pdb, chain, sqmpping, maxAlignseq); + pdbFile, chain.id, pdb, chain, sqmpping, maxAlignseq); foundSiftsMappings.add(siftsMapping); } catch (SiftsException e) { @@ -614,24 +614,23 @@ public class StructureSelectionManager PDBChain maxChain, jalview.datamodel.Mapping sqmpping, AlignSeq maxAlignseq) throws SiftsException { - StructureMapping curChainMapping = siftsClient - .getSiftsStructureMapping(seq, pdbFile, targetChainId); - try - { + StructureMapping curChainMapping = siftsClient + .getSiftsStructureMapping(seq, pdbFile, targetChainId); + try + { PDBChain chain = pdb.findChain(targetChainId); if (chain != null) { chain.transferResidueAnnotation(curChainMapping, sqmpping); } - } catch (Exception e) - { - e.printStackTrace(); - } - return curChainMapping; + } catch (Exception e) + { + e.printStackTrace(); + } + return curChainMapping; } - private StructureMapping getNWMappings(SequenceI seq, - String pdbFile, + private StructureMapping getNWMappings(SequenceI seq, String pdbFile, String maxChainId, PDBChain maxChain, StructureFile pdb, AlignSeq maxAlignseq) { @@ -1356,4 +1355,9 @@ public class StructureSelectionManager return seqmappings; } + public static StructureSelectionManager getStructureSelectionManager() + { + return instances.values().iterator().next(); + } + }