JAL-2795 start of Jalview's Matrix conversion
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Fri, 27 Oct 2017 15:42:09 +0000 (16:42 +0100)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Fri, 27 Oct 2017 15:42:09 +0000 (16:42 +0100)
forester
src/jalview/ext/archaeopteryx/MatrixConversionFactory.java [new file with mode: 0644]
src/jalview/ext/archaeopteryx/MergedMatrix.java [new file with mode: 0644]

index 25c731f..26d8d47 160000 (submodule)
--- a/forester
+++ b/forester
@@ -1 +1 @@
-Subproject commit 25c731fbc8a993c2084d364e6c6c8ca9e662ad73
+Subproject commit 26d8d47ed32a0eb9bd43c409d0e26ff13570b246
diff --git a/src/jalview/ext/archaeopteryx/MatrixConversionFactory.java b/src/jalview/ext/archaeopteryx/MatrixConversionFactory.java
new file mode 100644 (file)
index 0000000..19409e0
--- /dev/null
@@ -0,0 +1,66 @@
+package jalview.ext.archaeopteryx;
+
+import jalview.math.MatrixI;
+
+import org.forester.evoinference.matrix.distance.DistanceMatrix;
+
+public class MatrixConversionFactory
+{
+  DistanceMatrix foresterMatrix;
+
+  MatrixI jalviewMatrix;
+
+  public static MatrixConversionFactory createConverter(
+          DistanceMatrix foresterInputMatrix)
+  {
+    MatrixConversionFactory converter = new MatrixConversionFactory();
+    converter.convertForesterToJalview(foresterInputMatrix);
+    return converter;
+
+  }
+
+  public static MatrixConversionFactory createConverter(MatrixI jalviewInputMatrix)
+  {
+    MatrixConversionFactory converter = new MatrixConversionFactory();
+    converter.convertJalviewToForester(jalviewInputMatrix);
+    return converter;
+
+  }
+
+  private DistanceMatrix convertJalviewToForester(
+          MatrixI jalviewMatrix)
+  {
+    this.jalviewMatrix = jalviewMatrix;
+    return foresterMatrix;
+
+  }
+
+  private MatrixI convertForesterToJalview(
+          DistanceMatrix foresterMatrix)
+  {
+    this.foresterMatrix = foresterMatrix;
+
+    return jalviewMatrix;
+  }
+
+  protected DistanceMatrix getForesterMatrix()
+  {
+    return foresterMatrix;
+  }
+
+  protected void setForesterMatrix(DistanceMatrix foresterMatrix)
+  {
+    this.foresterMatrix = foresterMatrix;
+  }
+
+  protected MatrixI getJalviewMatrix()
+  {
+    return jalviewMatrix;
+  }
+
+  protected void setJalviewMatrix(MatrixI jalviewMatrix)
+  {
+    this.jalviewMatrix = jalviewMatrix;
+  }
+
+}
diff --git a/src/jalview/ext/archaeopteryx/MergedMatrix.java b/src/jalview/ext/archaeopteryx/MergedMatrix.java
new file mode 100644 (file)
index 0000000..41855de
--- /dev/null
@@ -0,0 +1,64 @@
+package jalview.ext.archaeopteryx;
+
+import org.forester.evoinference.matrix.distance.DistanceMatrix;
+
+public class MergedMatrix implements DistanceMatrix
+{
+
+  @Override
+  public String getIdentifier(int i)
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public int getIndex(String identifier)
+  {
+    // TODO Auto-generated method stub
+    return 0;
+  }
+
+  @Override
+  public int getSize()
+  {
+    // TODO Auto-generated method stub
+    return 0;
+  }
+
+  @Override
+  public double getValue(int col, int row)
+  {
+    // TODO Auto-generated method stub
+    return 0;
+  }
+
+  @Override
+  public void setIdentifier(int i, String identifier)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void setValue(int col, int row, double distance)
+  {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public StringBuffer toStringBuffer(Format format)
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public double[][] getValues()
+  {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+}
\ No newline at end of file