From: tcofoegbu Date: Tue, 13 Sep 2016 14:25:20 +0000 (+0100) Subject: JAL-2164 JAL-1919 disabled and removed PDB file parser configuration option, JmolPars... X-Git-Tag: Release_2_10_0~44 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=13bc8a3fb89b083922d9fa9dad5050e6aaa1f661;p=jalview.git JAL-2164 JAL-1919 disabled and removed PDB file parser configuration option, JmolParser is now the sole parser for parsing PDB and mmCIF format files. --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 508e8a7..0972ced 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -235,8 +235,6 @@ public class Cache private final static String PDB_DOWNLOAD_FORMAT = PDBEntry.Type.MMCIF .toString(); - private final static String DEFAULT_PDB_FILE_PARSER = StructureImportSettings.StructureParser.JMOL_PARSER - .toString(); /* * a date formatter using a fixed (rather than the user's) locale; @@ -446,9 +444,7 @@ public class Cache StructureImportSettings.setDefaultStructureFileFormat(jalview.bin.Cache .getDefault( "PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT)); - StructureImportSettings - .setDefaultPDBFileParser(jalview.bin.Cache.getDefault( - "DEFAULT_PDB_FILE_PARSER", DEFAULT_PDB_FILE_PARSER)); + // jnlpVersion will be null if we're using InstallAnywhere // Dont do this check if running in headless mode if (jnlpVersion == null diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 55bb03d..da7eb1d 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -279,29 +279,12 @@ public class AppletFormatAdapter } else if (format.equals("PDB")) { - // TODO obtain config value from preference settings. - // Set value to 'true' to test PDB processing with Jmol: JAL-1213 - boolean isParseWithJMOL = StructureImportSettings - .getDefaultPDBFileParser().equalsIgnoreCase( - StructureImportSettings.StructureParser.JMOL_PARSER - .toString()); - if (isParseWithJMOL) - { + StructureImportSettings.addSettings(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct); alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure, localSecondaryStruct, serviceSecondaryStruct, inFile, type); - } - else - { - StructureImportSettings.addSettings(annotFromStructure, - localSecondaryStruct, serviceSecondaryStruct); - StructureImportSettings.setShowSeqFeatures(true); - alignFile = new MCview.PDBfile(annotFromStructure, - localSecondaryStruct, serviceSecondaryStruct, inFile, - type); - } ((StructureFile) alignFile).setDbRefType(format); } else if (format.equalsIgnoreCase("mmCIF")) diff --git a/src/jalview/structure/StructureImportSettings.java b/src/jalview/structure/StructureImportSettings.java index 82b5f69..f168413 100644 --- a/src/jalview/structure/StructureImportSettings.java +++ b/src/jalview/structure/StructureImportSettings.java @@ -48,7 +48,6 @@ public class StructureImportSettings * Determines the parser used for parsing PDB format file. Possible options * are : JMolParser|JalveiwParser */ - private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER; public static void addSettings(boolean addAlignmentAnnotations, boolean processSecStr, boolean externalSecStr) { @@ -113,21 +112,5 @@ public class StructureImportSettings .valueOf(defaultStructureFileFormat.toUpperCase()); } - public static String getDefaultPDBFileParser() - { - return defaultPDBFileParser.toString(); - } - - public static void setDefaultPDBFileParser( - StructureParser defaultPDBFileParser) - { - StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser; - } - - public static void setDefaultPDBFileParser(String defaultPDBFileParser) - { - StructureImportSettings.defaultPDBFileParser = StructureParser - .valueOf(defaultPDBFileParser.toUpperCase()); - } } diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index c27289c..7db85ff 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -384,21 +384,8 @@ 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); - } if (pdb.getId() != null && pdb.getId().trim().length() > 0 && AppletFormatAdapter.FILE.equals(protocol)) diff --git a/test/jalview/ext/jmol/JmolParserTest.java b/test/jalview/ext/jmol/JmolParserTest.java index 7ab058e..6ed49cd 100644 --- a/test/jalview/ext/jmol/JmolParserTest.java +++ b/test/jalview/ext/jmol/JmolParserTest.java @@ -31,7 +31,6 @@ import jalview.gui.AlignFrame; import jalview.io.AppletFormatAdapter; import jalview.io.FileLoader; import jalview.structure.StructureImportSettings; -import jalview.structure.StructureImportSettings.StructureParser; import java.util.Vector; @@ -91,8 +90,6 @@ public class JmolParserTest Cache.applicationProperties.setProperty("ADD_SS_ANN", Boolean.TRUE.toString()); StructureImportSettings.setDefaultStructureFileFormat("PDB"); - StructureImportSettings - .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER); } @Test(groups = { "Functional" }) diff --git a/test/jalview/io/AnnotatedPDBFileInputTest.java b/test/jalview/io/AnnotatedPDBFileInputTest.java index e03f7a1..f79b7c6 100644 --- a/test/jalview/io/AnnotatedPDBFileInputTest.java +++ b/test/jalview/io/AnnotatedPDBFileInputTest.java @@ -32,7 +32,6 @@ import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; import jalview.structure.StructureImportSettings; -import jalview.structure.StructureImportSettings.StructureParser; import java.io.File; @@ -101,11 +100,11 @@ public class AnnotatedPDBFileInputTest { System.out.println("CalcId: " + aa.getCalcId()); - if (StructureImportSettings.getDefaultPDBFileParser().equals( - StructureParser.JALVIEW_PARSER)) - { - assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId)); - } + // if (StructureImportSettings.getDefaultPDBFileParser().equals( + // StructureParser.JALVIEW_PARSER)) + // { + // assertTrue(MCview.PDBfile.isCalcIdForFile(aa, pdbId)); + // } } } } diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index c1d1144..b911107 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -26,7 +26,6 @@ import jalview.bin.Cache; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; import jalview.structure.StructureImportSettings; -import jalview.structure.StructureImportSettings.StructureParser; import jalview.ws.seqfetcher.DbSourceProxy; import java.util.List; @@ -88,8 +87,6 @@ public class PDBSequenceFetcherTest Cache.applicationProperties.setProperty("STRUCT_FROM_PDB", Boolean.TRUE.toString()); StructureImportSettings.setDefaultStructureFileFormat("PDB"); - StructureImportSettings - .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER); testRetrieveProteinSeqFromPDB(); }