X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fstructure%2FStructureSelectionManager.java;h=563f0e7a4983fecff5afb3ab0176d5ab93a2c672;hb=84ff3a3c7824890b0a201e6a4ec8fa1c9b6e9e64;hp=3194cce2f5f516bf08b6e4cbbf5d10061ad186f6;hpb=7e3a6674abdd31bf48e7e249a74eff50fd2ce589;p=jalview.git diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 3194cce..563f0e7 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -327,7 +327,7 @@ public class StructureSelectionManager IProgressIndicator progress) { return computeMapping(true, sequence, targetChains, pdbFile, protocol, - progress, null, null); + progress, null, null, true); } /** @@ -353,8 +353,17 @@ public class StructureSelectionManager 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, tft, paeFilename); + pdbFile, sourceType, null, tft, paeFilename, doXferSettings); } /** @@ -384,7 +393,8 @@ public class StructureSelectionManager synchronized public StructureFile computeMapping(boolean forStructureView, SequenceI[] sequenceArray, String[] targetChainIds, String pdbFile, DataSourceType sourceType, - IProgressIndicator progress, TFType tft, String paeFilename) + IProgressIndicator progress, TFType tft, String paeFilename, + boolean doXferSettings) { long progressSessionId = System.currentTimeMillis() * 3; @@ -394,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(); @@ -412,7 +421,11 @@ public class StructureSelectionManager 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) { @@ -667,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) @@ -687,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)