Mercurial > repos > bgruening > chemfp
comparison nxn_clustering.py @ 7:0d88631bb7de draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/chemicaltoolbox/chemfp commit ed9b6859de648aa5f7cde483732f5df20aaff90e
| author | bgruening |
|---|---|
| date | Tue, 07 May 2019 13:32:50 -0400 |
| parents | 70b071de9bee |
| children | 198b1e30c739 |
comparison
equal
deleted
inserted
replaced
| 6:e3a7d6cc87af | 7:0d88631bb7de |
|---|---|
| 67 targets = chemfp.open( args.input_path, format='fps' ) | 67 targets = chemfp.open( args.input_path, format='fps' ) |
| 68 arena = chemfp.load_fingerprints( targets ) | 68 arena = chemfp.load_fingerprints( targets ) |
| 69 distances = distance_matrix( arena, args.tanimoto_threshold ) | 69 distances = distance_matrix( arena, args.tanimoto_threshold ) |
| 70 | 70 |
| 71 if args.similarity_matrix: | 71 if args.similarity_matrix: |
| 72 distances.tofile( args.similarity_matrix ) | 72 numpy.savetxt(args.similarity_matrix, distances) |
| 73 | 73 |
| 74 if args.cluster_image: | 74 if args.cluster_image: |
| 75 linkage = hcluster.linkage( distances, method="single", metric="euclidean" ) | 75 linkage = hcluster.linkage(distances, method="single", metric="euclidean") |
| 76 hcluster.dendrogram(linkage, labels=arena.ids, leaf_rotation=90.) | |
| 77 pylab.savefig(args.cluster_image, format=args.oformat) | |
| 76 | 78 |
| 77 hcluster.dendrogram(linkage, labels=arena.ids) | |
| 78 | |
| 79 pylab.savefig( args.cluster_image, format=args.oformat ) | |
| 80 |
