Resolve merge conflict for StructureImportSettings
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Thu, 21 Jul 2016 16:20:56 +0000 (17:20 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Thu, 21 Jul 2016 16:20:56 +0000 (17:20 +0100)
18 files changed:
src/jalview/analysis/AAFrequency.java
src/jalview/api/DBRefEntryI.java
src/jalview/bin/Cache.java
src/jalview/datamodel/DBRefEntry.java
src/jalview/ext/jmol/JmolParser.java
src/jalview/gui/Jalview2XML.java
src/jalview/io/AppletFormatAdapter.java
src/jalview/io/StructureFile.java
src/jalview/structure/StructureImportSettings.java
src/jalview/viewmodel/AlignmentViewport.java
src/jalview/workers/AlignCalcWorker.java
src/jalview/workers/AnnotationWorker.java
src/jalview/workers/ColumnCounterWorker.java
src/jalview/ws/dbsources/Pdb.java
test/jalview/ext/jmol/JmolParserTest.java
test/jalview/io/AnnotatedPDBFileInputTest.java
test/jalview/ws/PDBSequenceFetcherTest.java
test/jalview/ws/sifts/SiftsClientTest.java

index 3d61b11..fb49541 100755 (executable)
@@ -624,8 +624,11 @@ public class AAFrequency
       String modalCodon = String.valueOf(CodingUtils
               .decodeCodon(modalCodonEncoded));
       if (sortedCodonCounts.length > 1
-              && sortedCodonCounts[codons.length - 2] == modalCodonEncoded)
+              && sortedCodonCounts[codons.length - 2] == sortedCodonCounts[codons.length - 1])
       {
+        /*
+         * two or more codons share the modal count
+         */
         modalCodon = "+";
       }
       float pid = sortedCodonCounts[sortedCodonCounts.length - 1] * 100
index 2ce7e4a..32245b3 100644 (file)
@@ -48,32 +48,6 @@ public interface DBRefEntryI
   public void setVersion(String version);
 
   /**
-   * 
-   * @param startRes
-   *          index of start residue in the source DB
-   */
-  public void setStartRes(int startRes);
-
-  /**
-   * 
-   * @return index of start residue in the source DB
-   */
-  public int getStartRes();
-
-  /**
-   * 
-   * @param endRes
-   *          index of end residue in the source DB
-   */
-  public void setEndRes(int endRes);
-
-  /**
-   * 
-   * @return index of end residue in the source DB
-   */
-  public int getEndRes();
-
-  /**
    * access a mapping, if present that can be used to map positions from the
    * associated dataset sequence to the DBRef's sequence frame.
    * 
index 5f0ed2c..4be7830 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.bin;
 
+import jalview.datamodel.PDBEntry;
 import jalview.structure.StructureImportSettings;
 import jalview.ws.dbsources.das.api.DasSourceRegistryI;
 import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
@@ -226,10 +227,15 @@ public class Cache
   private final static String DEFAULT_CACHE_THRESHOLD_IN_DAYS = "2";
 
   private final static String DEFAULT_FAIL_SAFE_PID_THRESHOLD = "30";
-
-  private final static String DEFAULT_STRUCTURE_FORMAT = StructureImportSettings.MMCIF;
   
-  private final static String DEFAULT_PDB_FILE_PARSER = StructureImportSettings.JMOL_PARSER;
+  /**
+   * Allowed values are PDB or mmCIF
+   */
+  private final static String DEFAULT_STRUCTURE_FORMAT = PDBEntry.Type.MMCIF
+          .toString();
+
+  private final static String DEFAULT_PDB_FILE_PARSER = StructureImportSettings.StructureParser.JMOL_PARSER
+          .toString();
 
   /**
    * Initialises the Jalview Application Log
index efdf0ac..a641b1b 100755 (executable)
@@ -25,8 +25,6 @@ import jalview.api.DBRefEntryI;
 public class DBRefEntry implements DBRefEntryI
 {
   String source = "", version = "", accessionId = "";
-
-  private int startRes, endRes;
   /**
    * maps from associated sequence to the database sequence's coordinate system
    */
@@ -282,28 +280,4 @@ public class DBRefEntry implements DBRefEntryI
   {
     return getSrcAccString();
   }
-
-  @Override
-  public int getStartRes()
-  {
-    return startRes;
-  }
-
-  @Override
-  public void setStartRes(int startRes)
-  {
-    this.startRes = startRes;
-  }
-
-  @Override
-  public int getEndRes()
-  {
-    return endRes;
-  }
-
-  @Override
-  public void setEndRes(int endRes)
-  {
-    this.endRes = endRes;
-  }
 }
index ca412d0..7056f0f 100644 (file)
@@ -177,7 +177,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener
           prot.add(chainseq);
         }
 
-        if (StructureImportSettings.isPredictSecondaryStructure())
+        if (StructureImportSettings.isProcessSecondaryStructure())
         {
           createAnnotation(chainseq, chain, ms.at);
         }
index ac85aad..1633a5d 100644 (file)
@@ -898,10 +898,10 @@ public class Jalview2XML
       for (AlignedCodonFrame acf : jac)
       {
         AlcodonFrame alc = new AlcodonFrame();
-        vamsasSet.addAlcodonFrame(alc);
         if (acf.getProtMappings() != null
                 && acf.getProtMappings().length > 0)
         {
+          boolean hasMap = false;
           SequenceI[] dnas = acf.getdnaSeqs();
           jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
           for (int m = 0; m < pmaps.length; m++)
@@ -911,6 +911,11 @@ public class Jalview2XML
             alcmap.setMapping(createVamsasMapping(pmaps[m], dnas[m], null,
                     false));
             alc.addAlcodMap(alcmap);
+            hasMap = true;
+          }
+          if (hasMap)
+          {
+            vamsasSet.addAlcodonFrame(alc);
           }
         }
         // TODO: delete this ? dead code from 2.8.3->2.9 ?
@@ -2855,8 +2860,8 @@ public class Jalview2XML
                   mapping });
             }
           }
+          al.addCodonFrame(cf);
         }
-        al.addCodonFrame(cf);
       }
     }
 
index fca7263..2243a5c 100755 (executable)
@@ -26,6 +26,7 @@ import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentView;
+import jalview.datamodel.PDBEntry.Type;
 import jalview.structure.StructureImportSettings;
 import jalview.util.MessageManager;
 
@@ -281,8 +282,8 @@ public class AppletFormatAdapter
         // 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.JMOL_PARSER);
+                .getDefaultPDBFileParser()
+                .equals(StructureImportSettings.StructureParser.JMOL_PARSER);
         if (isParseWithJMOL)
         {
           StructureImportSettings.addSettings(annotFromStructure,
@@ -450,8 +451,7 @@ public class AppletFormatAdapter
           alignFile = new MCview.PDBfile(annotFromStructure,
                   localSecondaryStruct, serviceSecondaryStruct, source);
         }
-        ((StructureFile) alignFile)
-                .setDbRefType(StructureImportSettings.PDB);
+        ((StructureFile) alignFile).setDbRefType(Type.PDB);
       }
       else if (format.equals("mmCIF"))
       {
@@ -459,8 +459,7 @@ public class AppletFormatAdapter
                 localSecondaryStruct, serviceSecondaryStruct);
         alignFile = new jalview.ext.jmol.JmolParser(annotFromStructure,
                 localSecondaryStruct, serviceSecondaryStruct, source);
-        ((StructureFile) alignFile)
-                .setDbRefType(StructureImportSettings.MMCIF);
+        ((StructureFile) alignFile).setDbRefType(Type.MMCIF);
       }
       else if (format.equals("STH"))
       {
index 97e11eb..fc0e207 100644 (file)
@@ -8,6 +8,7 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
 import jalview.datamodel.PDBEntry;
+import jalview.datamodel.PDBEntry.Type;
 import jalview.datamodel.SequenceI;
 import jalview.structure.StructureImportSettings;
 
@@ -25,7 +26,7 @@ public abstract class StructureFile extends AlignFile
 
   private String id;
 
-  private String dbRefType;
+  private PDBEntry.Type dbRefType;
 
   /**
    * set to true to add derived sequence annotations (temp factor read from
@@ -70,7 +71,7 @@ public abstract class StructureFile extends AlignFile
     this.visibleChainAnnotation = StructureImportSettings
             .isVisibleChainAnnotation();
     this.predictSecondaryStructure = StructureImportSettings
-            .isPredictSecondaryStructure();
+            .isProcessSecondaryStructure();
     this.externalSecondaryStructure = StructureImportSettings
             .isExternalSecondaryStructure();
 
@@ -116,8 +117,6 @@ public abstract class StructureFile extends AlignFile
     DBRefEntry sourceDBRef = new DBRefEntry();
     sourceDBRef.setAccessionId(getId());
     sourceDBRef.setSource(DBRefSource.PDB);
-    sourceDBRef.setStartRes(pdbSequence.getStart());
-    sourceDBRef.setEndRes(pdbSequence.getEnd());
     pdbSequence.setSourceDBRef(sourceDBRef);
     pdbSequence.addPDBId(entry);
     pdbSequence.addDBRef(sourceDBRef);
@@ -273,7 +272,7 @@ public abstract class StructureFile extends AlignFile
         StructureImportSettings.setShowSeqFeatures(false);
         StructureImportSettings.setVisibleChainAnnotation(false);
         StructureImportSettings
-                .setPredictSecondaryStructure(predictSecondaryStructure);
+                .setProcessSecondaryStructure(predictSecondaryStructure);
         StructureImportSettings
                 .setExternalSecondaryStructure(externalSecondaryStructure);
         Object jmf = constructor.newInstance(args);
@@ -401,13 +400,18 @@ public abstract class StructureFile extends AlignFile
     this.chains = chains;
   }
 
-  public String getDbRefType()
+  public Type getDbRefType()
   {
     return dbRefType;
   }
 
   public void setDbRefType(String dbRefType)
   {
+    this.dbRefType = Type.valueOf(dbRefType);
+  }
+
+  public void setDbRefType(Type dbRefType)
+  {
     this.dbRefType = dbRefType;
   }
 
index c49b141..e969d4b 100644 (file)
@@ -1,7 +1,14 @@
 package jalview.structure;
 
-import jalview.datamodel.DBRefSource;
-
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.PDBEntry.Type;
+
+/**
+ * bean holding settings for structure IO. TODO: tests for validation of values
+ * 
+ * @author tcofoegbu
+ *
+ */
 public class StructureImportSettings
 {
   /**
@@ -14,7 +21,7 @@ public class StructureImportSettings
    * Set true to predict secondary structure (using JMol for protein, Annotate3D
    * for RNA)
    */
-  private static boolean predictSecStr = false;
+  private static boolean processSecStr = false;
 
   /**
    * Set true (with predictSecondaryStructure=true) to predict secondary
@@ -24,30 +31,28 @@ public class StructureImportSettings
 
   private static boolean showSeqFeatures = true;
 
-  public static final String JMOL_PARSER = "JMolParser";
-
-  public static final String JALVIEW_PARSER = "JalViewParser";
-
-  public static final String MMCIF = "mmCIF";
+  public enum StructureParser
+  {
+    JMOL_PARSER, JALVIEW_PARSER
+  }
 
-  public static final String PDB = "PDB";
 
   /**
    * Determines the default file format for structure files to be downloaded
    * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
    */
-  private static String defaultStructureFileFormat = DBRefSource.PDB;
+  private static PDBEntry.Type defaultStructureFileFormat = Type.PDB;
 
   /**
    * Determines the parser used for parsing PDB format file. Possible options
    * are : JMolParser|JalveiwParser
    */
-  private static String defaultPDBFileParser = JMOL_PARSER;
+  private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
   public static void addSettings(boolean addAlignmentAnnotations,
-          boolean predictSecStr, boolean externalSecStr)
+          boolean processSecStr, boolean externalSecStr)
   {
     StructureImportSettings.visibleChainAnnotation = addAlignmentAnnotations;
-    StructureImportSettings.predictSecStr = predictSecStr;
+    StructureImportSettings.processSecStr = processSecStr;
     StructureImportSettings.externalSecondaryStructure = externalSecStr;
     StructureImportSettings.showSeqFeatures = true;
   }
@@ -63,15 +68,15 @@ public class StructureImportSettings
     StructureImportSettings.visibleChainAnnotation = visibleChainAnnotation;
   }
 
-  public static boolean isPredictSecondaryStructure()
+  public static boolean isProcessSecondaryStructure()
   {
-    return predictSecStr;
+    return processSecStr;
   }
 
-  public static void setPredictSecondaryStructure(
-          boolean predictSecondaryStructure)
+  public static void setProcessSecondaryStructure(
+          boolean processSecondaryStructure)
   {
-    StructureImportSettings.predictSecStr = predictSecondaryStructure;
+    StructureImportSettings.processSecStr = processSecondaryStructure;
   }
 
   public static boolean isExternalSecondaryStructure()
@@ -97,23 +102,31 @@ public class StructureImportSettings
 
   public static String getDefaultStructureFileFormat()
   {
-    return defaultStructureFileFormat;
+    return defaultStructureFileFormat.toString();
   }
 
   public static void setDefaultStructureFileFormat(
           String defaultStructureFileFormat)
   {
-    StructureImportSettings.defaultStructureFileFormat = defaultStructureFileFormat;
+    StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type
+            .valueOf(defaultStructureFileFormat);
   }
 
   public static String getDefaultPDBFileParser()
   {
-    return defaultPDBFileParser;
+    return defaultPDBFileParser.toString();
   }
 
-  public static void setDefaultPDBFileParser(String defaultPDBFileParser)
+  public static void setDefaultPDBFileParser(
+          StructureParser defaultPDBFileParser)
   {
     StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
   }
 
+  public static void setDefaultPDBFileParser(String defaultPDBFileParser)
+  {
+    StructureImportSettings.defaultPDBFileParser = StructureParser
+            .valueOf(defaultPDBFileParser);
+  }
+
 }
index d3df56c..19ebf45 100644 (file)
@@ -844,14 +844,22 @@ public abstract class AlignmentViewport implements AlignViewportI,
             && !al.getCodonFrames().isEmpty())
     {
       /*
-       * fudge - check first mapping is protein-to-nucleotide
+       * fudge - check first for protein-to-nucleotide mappings
        * (we don't want to do this for protein-to-protein)
        */
-      AlignedCodonFrame mapping = al.getCodonFrames().iterator().next();
-      // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
-      MapList[] mapLists = mapping.getdnaToProt();
-      // mapLists can be empty if project load has not finished resolving seqs
-      if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+      boolean doConsensus = false;
+      for (AlignedCodonFrame mapping : al.getCodonFrames())
+      {
+        // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
+        MapList[] mapLists = mapping.getdnaToProt();
+        // mapLists can be empty if project load has not finished resolving seqs
+        if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+        {
+          doConsensus = true;
+          break;
+        }
+      }
+      if (doConsensus)
       {
         if (calculator
                 .getRegisteredWorkersOfClass(ComplementConsensusThread.class) == null)
@@ -1872,12 +1880,20 @@ public abstract class AlignmentViewport implements AlignViewportI,
               .getCodonFrames();
       if (codonMappings != null && !codonMappings.isEmpty())
       {
-        // fudge: check mappings are not protein-to-protein
-        // TODO: nicer
-        AlignedCodonFrame mapping = codonMappings.iterator().next();
-        MapList[] mapLists = mapping.getdnaToProt();
-        // mapLists can be empty if project load has not finished resolving seqs
-        if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+        boolean doConsensus = false;
+        for (AlignedCodonFrame mapping : codonMappings)
+        {
+          // TODO hold mapping type e.g. dna-to-protein in AlignedCodonFrame?
+          MapList[] mapLists = mapping.getdnaToProt();
+          // mapLists can be empty if project load has not finished resolving
+          // seqs
+          if (mapLists.length > 0 && mapLists[0].getFromRatio() == 3)
+          {
+            doConsensus = true;
+            break;
+          }
+        }
+        if (doConsensus)
         {
           complementConsensus = new AlignmentAnnotation("cDNA Consensus",
                   "PID for cDNA", new Annotation[1], 0f, 100f,
index 7719c88..771c492 100644 (file)
@@ -26,6 +26,7 @@ import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
 
 import java.util.List;
 
@@ -103,4 +104,33 @@ public abstract class AlignCalcWorker implements AlignCalcWorkerI
     return false;
   }
 
+  /**
+   * Calculate min and max values of annotations and set as graphMin, graphMax
+   * on the AlignmentAnnotation. This is needed because otherwise, well, bad
+   * things happen.
+   * 
+   * @param ann
+   * @param anns
+   */
+  protected void setGraphMinMax(AlignmentAnnotation ann, Annotation[] anns)
+  {
+    // TODO feels like this belongs inside AlignmentAnnotation!
+    float max = Float.MIN_VALUE;
+    float min = Float.MAX_VALUE;
+    boolean set = false;
+    for (Annotation a : anns) {
+      if (a != null) {
+        set = true;
+        float val = a.value;
+        max = Math.max(max, val);
+        min = Math.min(min, val);
+      }
+    }
+    if (set)
+    {
+      ann.graphMin = min;
+      ann.graphMax = max;
+    }
+  }
+
 }
index efe707a..4d81307 100644 (file)
@@ -79,7 +79,7 @@ class AnnotationWorker extends AlignCalcWorker
         return;
       }
 
-      removeAnnotations();
+      // removeAnnotation();
       AlignmentI alignment = alignViewport.getAlignment();
       if (alignment != null)
       {
@@ -89,10 +89,19 @@ class AnnotationWorker extends AlignCalcWorker
                   alignment, new FeatureRenderer(alignViewport));
           for (AlignmentAnnotation ann : anns)
           {
-            ann.showAllColLabels = true;
-            ann.graph = AlignmentAnnotation.BAR_GRAPH;
-            ourAnnots.add(ann);
-            alignment.addAnnotation(ann);
+            AlignmentAnnotation theAnn = alignment.findOrCreateAnnotation(
+                    ann.label, ann.description, false, null, null);
+            theAnn.showAllColLabels = true;
+            theAnn.graph = AlignmentAnnotation.BAR_GRAPH;
+            theAnn.scaleColLabel = true;
+            theAnn.annotations = ann.annotations;
+            setGraphMinMax(theAnn, theAnn.annotations);
+            theAnn.validateRangeAndDisplay();
+            if (!ourAnnots.contains(theAnn))
+            {
+              ourAnnots.add(theAnn);
+            }
+            // alignment.addAnnotation(ann);
           }
         } catch (IndexOutOfBoundsException x)
         {
@@ -114,19 +123,6 @@ class AnnotationWorker extends AlignCalcWorker
       ap.adjustAnnotationHeight();
       ap.paintAlignment(true);
     }
-
-  }
-
-  /**
-   * Remove all our annotations before re-calculating them
-   */
-  void removeAnnotations()
-  {
-    for (AlignmentAnnotation ann : ourAnnots)
-    {
-      alignViewport.getAlignment().deleteAnnotation(ann);
-    }
-    ourAnnots.clear();
   }
 
   @Override
index 5f61525..2f73cb5 100644 (file)
@@ -89,7 +89,6 @@ class ColumnCounterWorker extends AlignCalcWorker
         return;
       }
 
-      removeAnnotation();
       if (alignViewport.getAlignment() != null)
       {
         try
@@ -159,21 +158,29 @@ class ColumnCounterWorker extends AlignCalcWorker
       {
         Color color = ColorUtils.getGraduatedColour(count, 0, Color.cyan,
                 max, Color.blue);
-        anns[i] = new Annotation(String.valueOf(count),
-                String.valueOf(count), '0', count, color);
+        String str = String.valueOf(count);
+        anns[i] = new Annotation(str, str, '0', count, color);
       }
     }
 
     /*
-     * construct the annotation, save it and add it to the displayed alignment
+     * construct or update the annotation
      */
-    AlignmentAnnotation ann = new AlignmentAnnotation(counter.getName(),
-            counter.getDescription(), anns);
+    AlignmentAnnotation ann = alignViewport.getAlignment()
+            .findOrCreateAnnotation(counter.getName(),
+                    counter.getDescription(), false, null,
+                    null);
+    ann.description = counter.getDescription();
     ann.showAllColLabels = true;
     ann.scaleColLabel = true;
     ann.graph = AlignmentAnnotation.BAR_GRAPH;
-    ourAnnots.add(ann);
-    alignViewport.getAlignment().addAnnotation(ann);
+    ann.annotations = anns;
+    setGraphMinMax(ann, anns);
+    ann.validateRangeAndDisplay();
+    if (!ourAnnots.contains(ann))
+    {
+      ourAnnots.add(ann);
+    }
   }
 
   /**
index 1a58466..fc636c6 100644 (file)
@@ -27,6 +27,7 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
 import jalview.datamodel.PDBEntry;
+import jalview.datamodel.PDBEntry.Type;
 import jalview.datamodel.SequenceI;
 import jalview.io.FormatAdapter;
 import jalview.io.PDBFeatureSettings;
@@ -133,8 +134,7 @@ public class Pdb extends EbiFileRetrievedProxy
       return null;
     }
     String ext = StructureImportSettings.getDefaultStructureFileFormat()
-            .equalsIgnoreCase("mmcif") ? ".cif"
-            : ".xml";
+            .equals(Type.MMCIF) ? ".cif" : ".xml";
     EBIFetchClient ebi = new EBIFetchClient();
     file = ebi.fetchDataAsFile("pdb:" + id,
             StructureImportSettings.getDefaultStructureFileFormat().toLowerCase(),
index b0e0718..7ab058e 100644 (file)
@@ -31,6 +31,7 @@ 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,7 +92,7 @@ public class JmolParserTest
             Boolean.TRUE.toString());
     StructureImportSettings.setDefaultStructureFileFormat("PDB");
     StructureImportSettings
-            .setDefaultPDBFileParser(StructureImportSettings.JALVIEW_PARSER);
+            .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
   }
 
   @Test(groups = { "Functional" })
index 5368d41..e6019aa 100644 (file)
@@ -32,6 +32,7 @@ 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;
 
@@ -68,7 +69,7 @@ public class AnnotatedPDBFileInputTest
             .get(0).getId();
     StructureImportSettings.setDefaultStructureFileFormat("PDB");
     StructureImportSettings
-            .setDefaultPDBFileParser(StructureImportSettings.JALVIEW_PARSER);
+            .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
   }
 
   @Test(groups = { "Functional" })
index d082785..fda0198 100644 (file)
@@ -26,6 +26,7 @@ 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,7 +89,7 @@ public class PDBSequenceFetcherTest
             Boolean.TRUE.toString());
     StructureImportSettings.setDefaultStructureFileFormat("PDB");
     StructureImportSettings
-            .setDefaultPDBFileParser(StructureImportSettings.JALVIEW_PARSER);
+            .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
 
     testRetrieveProteinSeqFromPDB();
   }
index 9141bad..6f9a864 100644 (file)
@@ -251,8 +251,6 @@ public class SiftsClientTest
 
     // TODO delete when auto-fetching of DBRefEntry is implemented
     DBRefEntry dbRef = new DBRefEntry("uniprot", "", "P00221");
-    dbRef.setStartRes(1);
-    dbRef.setEndRes(147);
     testSeq.addDBRef(dbRef);
     // testSeq.setSourceDBRef(dbRef);
 
@@ -327,8 +325,6 @@ public class SiftsClientTest
       DBRefEntryI expectedDBRef = new DBRefEntry();
       expectedDBRef.setSource(DBRefSource.UNIPROT);
       expectedDBRef.setAccessionId("P00221");
-      expectedDBRef.setStartRes(1);
-      expectedDBRef.setEndRes(147);
       expectedDBRef.setVersion("");
       Assert.assertEquals(actualValidSrcDBRef, expectedDBRef);
     } catch (Exception e)
@@ -376,8 +372,6 @@ public class SiftsClientTest
     DBRefEntryI validDBRef = new DBRefEntry();
     validDBRef.setSource(DBRefSource.UNIPROT);
     validDBRef.setAccessionId("P00221");
-    validDBRef.setStartRes(1);
-    validDBRef.setEndRes(147);
     validDBRef.setVersion("");
     Assert.assertTrue(siftsClient.isValidDBRefEntry(validDBRef));
   }