diff chemfp_clustering/nxn_clustering.py @ 21:7c84cfa515e0

ChemicalToolBoX update.
author Bjoern Gruening <bjoern.gruening@gmail.com>
date Sat, 01 Jun 2013 20:03:04 +0200
parents 438bc12d591b
children 6c496b524b41
line wrap: on
line diff
--- a/chemfp_clustering/nxn_clustering.py	Fri May 31 22:31:45 2013 +0200
+++ b/chemfp_clustering/nxn_clustering.py	Sat Jun 01 20:03:04 2013 +0200
@@ -12,6 +12,7 @@
 import scipy.cluster.hierarchy as hcluster
 import pylab
 import numpy
+import tempfile
 
 
 def distance_matrix(arena, tanimoto_threshold = 0.0):
@@ -63,8 +64,13 @@
 
     args = parser.parse_args()
 
+    # make sure that the file ending is fps
+    temp_file = tempfile.NamedTemporaryFile()
+    temp_link = "%s.%s" % (temp_file.name, 'fps')
+    temp_file.close()
+    os.symlink(args.input_path, temp_link)
 
-    arena = chemfp.load_fingerprints( args.input_path )
+    arena = chemfp.load_fingerprints( temp_link )
     distances  = distance_matrix( arena, args.tanimoto_threshold )
     linkage = hcluster.linkage( distances, method="single", metric="euclidean" )