From 560fb10bab46bb2bc9f2af28d71fdc0b6e386ad7 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Fri, 27 Oct 2017 16:42:09 +0100 Subject: [PATCH] JAL-2795 start of Jalview's Matrix conversion --- forester | 2 +- .../ext/archaeopteryx/MatrixConversionFactory.java | 66 ++++++++++++++++++++ src/jalview/ext/archaeopteryx/MergedMatrix.java | 64 +++++++++++++++++++ 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 src/jalview/ext/archaeopteryx/MatrixConversionFactory.java create mode 100644 src/jalview/ext/archaeopteryx/MergedMatrix.java diff --git a/forester b/forester index 25c731f..26d8d47 160000 --- 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 index 0000000..19409e0 --- /dev/null +++ b/src/jalview/ext/archaeopteryx/MatrixConversionFactory.java @@ -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 index 0000000..41855de --- /dev/null +++ b/src/jalview/ext/archaeopteryx/MergedMatrix.java @@ -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 -- 1.7.10.2