Mercurial > repos > bgruening > numeric_clustering
diff numeric_clustering.xml @ 4:7c1794e0f9c2 draft default tip
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/numeric_clustering commit adf077b912ddebd97b07b947b855cdd2862ed8ef-dirty
author | bgruening |
---|---|
date | Fri, 01 Jan 2016 18:00:23 -0500 |
parents | 6bfbaf81b8f4 |
children |
line wrap: on
line diff
--- a/numeric_clustering.xml Fri Jan 01 13:14:03 2016 -0500 +++ b/numeric_clustering.xml Fri Jan 01 18:00:23 2016 -0500 @@ -76,7 +76,7 @@ import sklearn.cluster import pandas -data = pandas.read_csv("$infile", sep='\t', header=0, index_col=0, parse_dates=True, encoding=None, tupleize_cols=False ) +data = pandas.read_csv("$infile", sep='\t', header=0, index_col=None, parse_dates=True, encoding=None, tupleize_cols=False ) my_class = getattr(sklearn.cluster, "$algorithm_options.selected_algorithm") cluster_object = my_class() @@ -93,8 +93,9 @@ data_matrix = data.values #end if prediction = cluster_object.fit_predict( data_matrix ) -data[len(data.columns)] = prediction -data.to_csv(path_or_buf = "$outfile", sep="\t") +prediction_df = pandas.DataFrame(prediction) +res = pandas.concat([data, prediction_df], axis=1) +res.to_csv(path_or_buf = "$outfile", sep="\t", index=False) ]]> </configfile> </configfiles> @@ -298,6 +299,7 @@ <param name="end_column" value="4" /> <param name="affinity" value="euclidean"/> <param name="linkage" value="average"/> + <param name="n_clusters" value="4"/> <output name="outfile" file="cluster_result10.txt"/> </test> <test>