Mercurial > repos > bgruening > sklearn_numeric_clustering
comparison numeric_clustering.xml @ 30:60d80322e1e9 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit c0a3a186966888e5787335a7628bf0a4382637e7
| author | bgruening |
|---|---|
| date | Tue, 14 May 2019 17:45:57 -0400 |
| parents | c156b85a6389 |
| children | a36e1455971d |
comparison
equal
deleted
inserted
replaced
| 29:c156b85a6389 | 30:60d80322e1e9 |
|---|---|
| 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: |
