Mercurial > repos > bgruening > sklearn_numeric_clustering
comparison numeric_clustering.xml @ 24:abb5a3f256e3 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit c0a3a186966888e5787335a7628bf0a4382637e7
author | bgruening |
---|---|
date | Tue, 14 May 2019 18:11:02 -0400 |
parents | 9d234733ccfd |
children | 37e193b3fdd7 |
comparison
equal
deleted
inserted
replaced
23:9d234733ccfd | 24:abb5a3f256e3 |
---|---|
14 <inputs name="inputs"/> | 14 <inputs name="inputs"/> |
15 <configfile name="cluster_script"> | 15 <configfile name="cluster_script"> |
16 <![CDATA[ | 16 <![CDATA[ |
17 import sys | 17 import sys |
18 import json | 18 import json |
19 import numpy as np | |
19 import sklearn.cluster | 20 import sklearn.cluster |
20 import pandas | 21 import pandas |
21 from sklearn import metrics | 22 from sklearn import metrics |
22 from scipy.io import mmread | 23 from scipy.io import mmread |
23 | 24 |
24 exec(open("$__tool_directory__/utils.py").read(), globals()) | 25 sys.path.insert(0, '$__tool_directory__') |
26 from utils import read_columns | |
27 | |
28 N_JOBS = int(__import__('os').environ.get('GALAXY_SLOTS', 1)) | |
25 | 29 |
26 input_json_path = sys.argv[1] | 30 input_json_path = sys.argv[1] |
27 with open(input_json_path, "r") as param_handler: | 31 with open(input_json_path, "r") as param_handler: |
28 params = json.load(param_handler) | 32 params = json.load(param_handler) |
29 | 33 |
54 c_option = column_option, | 58 c_option = column_option, |
55 sep='\t', | 59 sep='\t', |
56 header=header, | 60 header=header, |
57 parse_dates=True, | 61 parse_dates=True, |
58 encoding=None, | 62 encoding=None, |
59 tupleize_cols=False | 63 tupleize_cols=False) |
60 ) | |
61 #end if | 64 #end if |
62 | 65 |
63 prediction = cluster_object.fit_predict( data_matrix ) | 66 prediction = cluster_object.fit_predict( data_matrix ) |
64 | 67 |
65 if len(np.unique(prediction)) > 1: | 68 if len(np.unique(prediction)) > 1: |