# HG changeset patch
# User bgruening
# Date 1370351303 14400
# Node ID 8e09c7337bf1d8671feed9262e22c78f09b73135
# Parent c709e68f550f1a55cb510bb854e8caaacceaacbc
Uploaded
diff -r c709e68f550f -r 8e09c7337bf1 ctb_machine_learning.zip
Binary file ctb_machine_learning.zip has changed
diff -r c709e68f550f -r 8e09c7337bf1 mds_plot.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mds_plot.py Tue Jun 04 09:08:23 2013 -0400
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+import argparse
+import os
+import sklearn.manifold
+import numpy
+import math
+import pylab
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser(
+ description="""2D multidimenisnal scaling of NxN matrices with scatter plot"""
+ )
+
+ parser.add_argument("-i", "--input", dest="sm",
+ required=True,
+ help="Path to the input file.")
+ parser.add_argument("--oformat", default='png', help="Output format (png, svg)")
+ parser.add_argument("-o", "--output", dest="output_path",
+ help="Path to the output file.")
+
+ args = parser.parse_args()
+ mds = sklearn.manifold.MDS( n_components=2, max_iter=300, eps=1e-6, dissimilarity='precomputed' )
+ data = numpy.fromfile( args.sm )
+ d = math.sqrt( len(data) )
+ sm = numpy.reshape( data, ( d,d ))
+ pos = mds.fit( sm ).embedding_
+ pylab.scatter( pos[:,0],pos[:,1] )
+ pylab.savefig( args.output_path, format=args.oformat )
diff -r c709e68f550f -r 8e09c7337bf1 mds_plot.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mds_plot.xml Tue Jun 04 09:08:23 2013 -0400
@@ -0,0 +1,52 @@
+
+ of molecule similarity
+
+ scikit_learn
+ matplotlib
+
+
+ mds_plot.py
+ -i $infile
+ --oformat $oformat
+ -o $outfile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+**Note**. You need an NxN similarity matrix as input. Use the NxN Clustering tool to generate one.
+
+**What it does**
+
+Scatter plot of similarity matrix after embeding in 2D coordinates using Multidimensional Scaling (MDS).
+
+-----
+
+**Example**
+
+* input::
+ Similarity Matrix
+
+* output::
+
+ Scatter plot
+
+.. image:: $PATH_TO_IMAGES/mds_plot.png
+
+
+
+
diff -r c709e68f550f -r 8e09c7337bf1 static/images/mds_plot.png
Binary file static/images/mds_plot.png has changed
diff -r c709e68f550f -r 8e09c7337bf1 test_data/mds_plot_on_sm_dat.png
Binary file test_data/mds_plot_on_sm_dat.png has changed
diff -r c709e68f550f -r 8e09c7337bf1 test_data/sm.dat
Binary file test_data/sm.dat has changed
diff -r c709e68f550f -r 8e09c7337bf1 tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml Tue Jun 04 09:08:23 2013 -0400
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+