JAL-2164 JAL-1919 disabled and removed PDB file parser configuration option, JmolPars...
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 13 Sep 2016 14:25:20 +0000 (15:25 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Tue, 13 Sep 2016 14:31:52 +0000 (15:31 +0100)
src/jalview/bin/Cache.java
src/jalview/io/AppletFormatAdapter.java
src/jalview/structure/StructureImportSettings.java
src/jalview/structure/StructureSelectionManager.java
test/jalview/ext/jmol/JmolParserTest.java
test/jalview/io/AnnotatedPDBFileInputTest.java
test/jalview/ws/PDBSequenceFetcherTest.java

index 508e8a7..0972ced 100755 (executable)
@@ -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
index 55bb03d..da7eb1d 100755 (executable)
@@ -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"))
index 82b5f69..f168413 100644 (file)
@@ -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());
-  }
 
 }
index c27289c..7db85ff 100644 (file)
@@ -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))
index 7ab058e..6ed49cd 100644 (file)
@@ -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" })
index e03f7a1..f79b7c6 100644 (file)
@@ -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));
+        // }
       }
     }
   }
index c1d1144..b911107 100644 (file)
@@ -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();
   }