From 187dc0d09071687d3975c052b6e63067c5804937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBok?= Date: Thu, 25 Oct 2018 14:49:54 +0200 Subject: [PATCH 1/3] update versions for hotfix --- mcq-cli/pom.xml | 2 +- mcq-clustering/pom.xml | 2 +- mcq-core/pom.xml | 2 +- mcq-gui/pom.xml | 2 +- pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mcq-cli/pom.xml b/mcq-cli/pom.xml index e4b08e97..f7fbfef5 100644 --- a/mcq-cli/pom.xml +++ b/mcq-cli/pom.xml @@ -5,7 +5,7 @@ mcq-parent pl.poznan.put - 1.4 + 1.4.1 mcq-cli diff --git a/mcq-clustering/pom.xml b/mcq-clustering/pom.xml index f6e5b0c2..198c416d 100644 --- a/mcq-clustering/pom.xml +++ b/mcq-clustering/pom.xml @@ -4,7 +4,7 @@ mcq-parent pl.poznan.put - 1.4 + 1.4.1 mcq-clustering diff --git a/mcq-core/pom.xml b/mcq-core/pom.xml index 244634a1..8905a0bb 100644 --- a/mcq-core/pom.xml +++ b/mcq-core/pom.xml @@ -5,7 +5,7 @@ mcq-parent pl.poznan.put - 1.4 + 1.4.1 mcq-core diff --git a/mcq-gui/pom.xml b/mcq-gui/pom.xml index 78e5c461..3274fd28 100644 --- a/mcq-gui/pom.xml +++ b/mcq-gui/pom.xml @@ -5,7 +5,7 @@ mcq-parent pl.poznan.put - 1.4 + 1.4.1 mcq-gui diff --git a/pom.xml b/pom.xml index c089e242..ded7be62 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ pl.poznan.put mcq-parent - 1.4 + 1.4.1 pom From 163327f27f5721a44a061bb8671ba40ea90b8916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBok?= Date: Thu, 25 Oct 2018 14:50:33 +0200 Subject: [PATCH 2/3] Update scripts --- mcq-cli/global | 2 +- mcq-cli/lcs | 2 +- mcq-cli/local | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mcq-cli/global b/mcq-cli/global index db89f406..bb175948 100755 --- a/mcq-cli/global +++ b/mcq-cli/global @@ -1,2 +1,2 @@ #! /bin/bash -exec java -cp $(dirname $0)/target/mcq-cli-1.4-SNAPSHOT-jar-with-dependencies.jar pl.poznan.put.mcq.cli.Global $@ +exec java -cp $(dirname $0)/target/mcq-cli-1.4.1-jar-with-dependencies.jar pl.poznan.put.mcq.cli.Global $@ diff --git a/mcq-cli/lcs b/mcq-cli/lcs index 3415ac2c..b6bfac38 100755 --- a/mcq-cli/lcs +++ b/mcq-cli/lcs @@ -1,2 +1,2 @@ #! /bin/bash -exec java -cp $(dirname $0)/target/mcq-cli-1.4-SNAPSHOT-jar-with-dependencies.jar pl.poznan.put.mcq.cli.Lcs $@ +exec java -cp $(dirname $0)/target/mcq-cli-1.4.1-jar-with-dependencies.jar pl.poznan.put.mcq.cli.Lcs $@ diff --git a/mcq-cli/local b/mcq-cli/local index 866d5524..240a24cb 100755 --- a/mcq-cli/local +++ b/mcq-cli/local @@ -1,2 +1,2 @@ #! /bin/bash -exec java -cp $(dirname $0)/target/mcq-cli-1.4-SNAPSHOT-jar-with-dependencies.jar pl.poznan.put.mcq.cli.Local $@ +exec java -cp $(dirname $0)/target/mcq-cli-1.4.1-jar-with-dependencies.jar pl.poznan.put.mcq.cli.Local $@ From ddb65903e891064f58d55d2449d7039fdc804c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBok?= Date: Thu, 25 Oct 2018 15:00:34 +0200 Subject: [PATCH 3/3] Cluster and visualize only for more than 2 structures --- .../java/pl/poznan/put/mcq/cli/Global.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/mcq-cli/src/main/java/pl/poznan/put/mcq/cli/Global.java b/mcq-cli/src/main/java/pl/poznan/put/mcq/cli/Global.java index c21a9aea..6e7613c5 100644 --- a/mcq-cli/src/main/java/pl/poznan/put/mcq/cli/Global.java +++ b/mcq-cli/src/main/java/pl/poznan/put/mcq/cli/Global.java @@ -68,7 +68,7 @@ private Global() { private static final class Listener implements ParallelGlobalComparator.ProgressListener { private final ProgressBar progressBar; - public Listener(final ProgressBar progressBar) { + private Listener(final ProgressBar progressBar) { super(); this.progressBar = progressBar; } @@ -80,20 +80,25 @@ public void setProgress(final int progress) { @Override public void complete(final GlobalMatrix matrix) { - progressBar.close(); - - final PrototypeBasedClusterer clusterer = new KMedoids(); - final double[][] rawMatrix = matrix.getDistanceMatrix().getMatrix(); - final ScoredClusteringResult clustering = - KScanner.parallelScan(clusterer, rawMatrix, PAM.getInstance()); - final PartitionalClustering partitionalClustering = - new PartitionalClustering(matrix.getDistanceMatrix(), clustering); - try { + progressBar.close(); + final File directory = ExecHelper.createRandomDirectory(); Listener.exportResults(directory, matrix); - Listener.exportDrawing(directory, partitionalClustering); - Listener.exportClustering(directory, partitionalClustering); + + final double[][] rawMatrix = matrix.getDistanceMatrix().getMatrix(); + + if (rawMatrix.length > 2) { + final PrototypeBasedClusterer clusterer = new KMedoids(); + final ScoredClusteringResult clustering = + KScanner.parallelScan(clusterer, rawMatrix, PAM.getInstance()); + final PartitionalClustering partitionalClustering = + new PartitionalClustering(matrix.getDistanceMatrix(), clustering); + + Listener.exportDrawing(directory, partitionalClustering); + Listener.exportClustering(directory, partitionalClustering); + } + System.out.println("Results available in: " + directory); } catch (final IOException e) { System.err.println("Failed to store results");