X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=563f0e7a4983fecff5afb3ab0176d5ab93a2c672;hb=ac27365b5f1d322f15f75f5765f74e2c06dc786f;hp=24320b54276f0f29539677311bd6a85a6914c0ff;hpb=3a65da0cf59dba22c4e15183db9f336486109538;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 24320b5..563f0e7 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -53,6 +53,7 @@ import jalview.gui.IProgressIndicator; import jalview.io.AppletFormatAdapter; import jalview.io.DataSourceType; import jalview.io.StructureFile; +import jalview.structure.StructureImportSettings.TFType; import jalview.util.MappingUtils; import jalview.util.MessageManager; import jalview.util.Platform; @@ -326,7 +327,7 @@ public class StructureSelectionManager IProgressIndicator progress) { return computeMapping(true, sequence, targetChains, pdbFile, protocol, - progress); + progress, null, null, true); } /** @@ -349,10 +350,20 @@ public class StructureSelectionManager */ synchronized public StructureFile setMapping(boolean forStructureView, SequenceI[] sequenceArray, String[] targetChainIds, - String pdbFile, DataSourceType sourceType) + String pdbFile, DataSourceType sourceType, TFType tft, + String paeFilename) + { + return setMapping(forStructureView, sequenceArray, targetChainIds, + pdbFile, sourceType, tft, paeFilename, true); + } + + synchronized public StructureFile setMapping(boolean forStructureView, + SequenceI[] sequenceArray, String[] targetChainIds, + String pdbFile, DataSourceType sourceType, TFType tft, + String paeFilename, boolean doXferSettings) { return computeMapping(forStructureView, sequenceArray, targetChainIds, - pdbFile, sourceType, null); + pdbFile, sourceType, null, tft, paeFilename, doXferSettings); } /** @@ -382,7 +393,8 @@ public class StructureSelectionManager synchronized public StructureFile computeMapping(boolean forStructureView, SequenceI[] sequenceArray, String[] targetChainIds, String pdbFile, DataSourceType sourceType, - IProgressIndicator progress) + IProgressIndicator progress, TFType tft, String paeFilename, + boolean doXferSettings) { long progressSessionId = System.currentTimeMillis() * 3; @@ -392,8 +404,7 @@ public class StructureSelectionManager // FIXME: possibly should just delete boolean parseSecStr = processSecondaryStructure - ? isStructureFileProcessed(pdbFile, sequenceArray) - : false; + && !isStructureFileProcessed(pdbFile, sequenceArray); StructureFile pdb = null; boolean isMapUsingSIFTs = SiftsSettings.isMapWithSifts(); @@ -402,10 +413,19 @@ public class StructureSelectionManager // FIXME if sourceType is not null, we've lost data here sourceType = AppletFormatAdapter.checkProtocol(pdbFile); pdb = new JmolParser(false, pdbFile, sourceType); + if (paeFilename != null) + { + pdb.setPAEMatrix(paeFilename); + } + pdb.setTemperatureFactorType(tft); pdb.addSettings(parseSecStr && processSecondaryStructure, parseSecStr && addTempFacAnnot, parseSecStr && secStructServices); + // save doXferSettings and reset after doParse() + boolean temp = pdb.getDoXferSettings(); + pdb.setDoXferSettings(doXferSettings); pdb.doParse(); + pdb.setDoXferSettings(temp); if (pdb.getId() != null && pdb.getId().trim().length() > 0 && DataSourceType.FILE == sourceType) { @@ -660,7 +680,7 @@ public class StructureSelectionManager private boolean isStructureFileProcessed(String pdbFile, SequenceI[] sequenceArray) { - boolean parseSecStr = true; + boolean processed = false; if (isPDBFileRegistered(pdbFile)) { for (SequenceI sq : sequenceArray) @@ -680,13 +700,13 @@ public class StructureSelectionManager // passed, not the structure data ID - if (PDBfile.isCalcIdForFile(ala, findIdForPDBFile(pdbFile))) { - parseSecStr = false; + processed = true; } } } } } - return parseSecStr; + return processed; } public void addStructureMapping(StructureMapping sm) @@ -1594,4 +1614,14 @@ public class StructureSelectionManager } } + public Map getPdbFileNameIdMap() + { + return pdbFileNameId; + } + + public Map getPdbIdFileNameMap() + { + return pdbIdFileName; + } + }