X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=6912836683b796e6e3b5b38ff63658b82fead7a9;hb=457deb581a5614633f1c4dd15fee5eeaea5c9758;hp=c27289c468bdc1a396b6b78e9cd92cf410c38b3d;hpb=9e9c7a6358edca8b749b6f760f7faabe364feadf;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index c27289c..6912836 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -31,7 +31,9 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; import jalview.datamodel.PDBEntry; import jalview.datamodel.SearchResults; +import jalview.datamodel.SearchResultsI; import jalview.datamodel.SequenceI; +import jalview.ext.jmol.JmolParser; import jalview.gui.IProgressIndicator; import jalview.io.AppletFormatAdapter; import jalview.io.StructureFile; @@ -326,7 +328,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 +348,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,27 +384,16 @@ public class StructureSelectionManager boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts(); try { - - boolean isParseWithJMOL = StructureImportSettings - .getDefaultPDBFileParser().equalsIgnoreCase( - StructureImportSettings.StructureParser.JMOL_PARSER - .toString()); - if (isParseWithJMOL || (pdbFile != null && isCIFFile(pdbFile))) - { - pdb = new jalview.ext.jmol.JmolParser(addTempFacAnnot, parseSecStr, - secStructServices, pdbFile, protocol); - } - else - { - pdb = new PDBfile(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(); @@ -551,8 +540,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) { @@ -627,24 +615,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) { @@ -819,7 +806,7 @@ public class StructureSelectionManager return; } - SearchResults results = new SearchResults(); + SearchResultsI results = new SearchResults(); for (AtomSpec atom : atoms) { SequenceI lastseq = null; @@ -869,7 +856,7 @@ public class StructureSelectionManager { boolean hasSequenceListeners = handlingVamsasMo || !seqmappings.isEmpty(); - SearchResults results = null; + SearchResultsI results = null; if (seqPos == -1) { seqPos = seq.findPosition(indexpos);