From 5cdc53bb8a76f6bd364188254e873437d7ac2c7f Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Thu, 2 Nov 2017 12:11:33 +0000 Subject: [PATCH] JAL-2795 moved matrix conversion to the ForesterMatrix class --- src/jalview/ext/archaeopteryx/MatrixConverter.java | 54 -------------------- src/jalview/ext/forester/ForesterMatrix.java | 29 +++++++++++ 2 files changed, 29 insertions(+), 54 deletions(-) delete mode 100644 src/jalview/ext/archaeopteryx/MatrixConverter.java diff --git a/src/jalview/ext/archaeopteryx/MatrixConverter.java b/src/jalview/ext/archaeopteryx/MatrixConverter.java deleted file mode 100644 index ef44030..0000000 --- a/src/jalview/ext/archaeopteryx/MatrixConverter.java +++ /dev/null @@ -1,54 +0,0 @@ -package jalview.ext.archaeopteryx; - -import jalview.datamodel.SequenceI; -import jalview.ext.forester.ForesterMatrix; -import jalview.math.MatrixI; - -import org.forester.evoinference.matrix.distance.DistanceMatrix; - -public final class MatrixConverter -{ - /** - * Shouldn't get instantiated - */ - private MatrixConverter() - { - - } - - - public static DistanceMatrix convertJalviewToForester( - final MatrixI jalviewInputMatrix, - final SequenceI[] matrixSequences) - { - if (jalviewInputMatrix.width() != jalviewInputMatrix.height()) - { - // some kind of warning? - } - DistanceMatrix foresterMatrix = new ForesterMatrix(jalviewInputMatrix, - matrixSequences); - return foresterMatrix; - - - } - - public static DistanceMatrix convertJalviewToForester( - final MatrixI jalviewInputMatrix, - final String[] matrixIdentifiers) - { - if (jalviewInputMatrix.width() != jalviewInputMatrix.height()) - { - // some kind of warning? - } - - DistanceMatrix foresterMatrix = new ForesterMatrix(jalviewInputMatrix, - matrixIdentifiers); - return foresterMatrix; - - - } - - - - -} diff --git a/src/jalview/ext/forester/ForesterMatrix.java b/src/jalview/ext/forester/ForesterMatrix.java index e0f2994..a1381be 100644 --- a/src/jalview/ext/forester/ForesterMatrix.java +++ b/src/jalview/ext/forester/ForesterMatrix.java @@ -163,5 +163,34 @@ public class ForesterMatrix implements DistanceMatrix } + public static DistanceMatrix convertJalviewToForester( + final MatrixI jalviewInputMatrix, + final SequenceI[] matrixSequences) + { + if (jalviewInputMatrix.width() != jalviewInputMatrix.height()) + { + // some kind of warning? + } + DistanceMatrix foresterMatrix = new ForesterMatrix(jalviewInputMatrix, + matrixSequences); + return foresterMatrix; + + } + + public static DistanceMatrix convertJalviewToForester( + final MatrixI jalviewInputMatrix, + final String[] matrixIdentifiers) + { + if (jalviewInputMatrix.width() != jalviewInputMatrix.height()) + { + // some kind of warning? + } + + DistanceMatrix foresterMatrix = new ForesterMatrix(jalviewInputMatrix, + matrixIdentifiers); + return foresterMatrix; + + } + } \ No newline at end of file -- 1.7.10.2