42
|
1 <tool id="MaREA_cluester" name="Cluster Analysis" version="1.1.2">
|
29
|
2 <description></description>
|
16
|
3 <macros>
|
|
4 <import>marea_macros.xml</import>
|
|
5 </macros>
|
|
6 <requirements>
|
17
|
7 <requirement type="package" version="0.25.1">pandas</requirement>
|
16
|
8 <requirement type="package" version="1.1.0">scipy</requirement>
|
|
9 <requirement type="package" version="0.10.1">cobra</requirement>
|
|
10 <requirement type="package" version="0.21.3">scikit-learn</requirement>
|
|
11 <requirement type="package" version="2.2.2">matplotlib</requirement>
|
|
12 <requirement type="package" version="1.17">numpy</requirement>
|
|
13 </requirements>
|
|
14 <command detect_errors="exit_code">
|
|
15 <![CDATA[
|
|
16 python $__tool_directory__/marea_cluster.py
|
|
17 --input $input
|
|
18 --tool_dir $__tool_directory__
|
|
19 --out_log $log
|
28
|
20 --best_cluster $best_cluster
|
24
|
21 --cluster_type ${data.clust_type}
|
16
|
22 #if $data.clust_type == 'kmeans':
|
|
23 --k_min ${data.k_min}
|
|
24 --k_max ${data.k_max}
|
|
25 --elbow ${data.elbow}
|
|
26 --silhouette ${data.silhouette}
|
|
27 #end if
|
|
28 #if $data.clust_type == 'dbscan':
|
|
29 #if $data.dbscan_advanced.advanced == 'true'
|
|
30 --eps ${data.dbscan_advanced.eps}
|
|
31 --min_samples ${data.dbscan_advanced.min_samples}
|
|
32 #end if
|
|
33 #end if
|
|
34 #if $data.clust_type == 'hierarchy':
|
|
35 --k_min ${data.k_min}
|
|
36 --k_max ${data.k_max}
|
34
|
37 --silhouette ${data.silhouette}
|
16
|
38 #end if
|
|
39 ]]>
|
|
40 </command>
|
|
41 <inputs>
|
31
|
42 <param name="input" argument="--input" type="data" format="tabular, csv, tsv" label="Input dataset" />
|
16
|
43
|
|
44 <conditional name="data">
|
|
45 <param name="clust_type" argument="--cluster_type" type="select" label="Choose clustering type:">
|
|
46 <option value="kmeans" selected="true">KMeans</option>
|
|
47 <option value="dbscan">DBSCAN</option>
|
|
48 <option value="hierarchy">Agglomerative Hierarchical</option>
|
|
49 </param>
|
|
50 <when value="kmeans">
|
31
|
51 <param name="k_min" argument="--k_min" type="integer" min="2" max="20" value="2" label="Min number of clusters (k) to be tested" />
|
|
52 <param name="k_max" argument="--k_max" type="integer" min="2" max="20" value="3" label="Max number of clusters (k) to be tested" />
|
16
|
53 <param name="elbow" argument="--elbow" type="boolean" value="true" label="Draw the elbow plot from k-min to k-max"/>
|
|
54 <param name="silhouette" argument="--silhouette" type="boolean" value="true" label="Draw the Silhouette plot from k-min to k-max"/>
|
|
55 </when>
|
|
56 <when value="dbscan">
|
|
57 <conditional name="dbscan_advanced">
|
|
58 <param name="advanced" type="boolean" value="false" label="Want to use custom params for DBSCAN? (if not optimal values will be used)">
|
|
59 <option value="true">Yes</option>
|
|
60 <option value="false">No</option>
|
|
61 </param>
|
|
62 <when value="false"></when>
|
|
63 <when value="true">
|
|
64 <param name="eps" argument="--eps" type="float" value="0.5" label="Epsilon - The maximum distance between two samples for one to be considered as in the neighborhood of the other" />
|
|
65 <param name="min_samples" argument="min_samples" type="integer" value="5" label="Min samples - The number of samples in a neighborhood for a point to be considered as a core point (this includes the point itself)"/>
|
|
66
|
|
67 </when>
|
|
68 </conditional>
|
|
69 </when>
|
|
70 <when value="hierarchy">
|
34
|
71 <param name="k_min" argument="--k_min" type="integer" min="2" max="20" value="2" label="Min number of clusters (k) to be tested" />
|
|
72 <param name="k_max" argument="--k_max" type="integer" min="3" max="20" value="3" label="Max number of clusters (k) to be tested" />
|
|
73 <param name="silhouette" argument="--silhouette" type="boolean" value="true" label="Draw the Silhouette plot from k-min to k-max"/>
|
16
|
74 </when>
|
|
75 </conditional>
|
|
76 </inputs>
|
|
77
|
|
78 <outputs>
|
|
79 <data format="txt" name="log" label="${tool.name} - Log" />
|
33
|
80 <data format="tabular" name="best_cluster" label="${tool.name} - best cluster assignment" />
|
28
|
81 <collection name="results" type="list" label="${tool.name} - Plots and results">
|
16
|
82 <discover_datasets pattern="__name_and_ext__" directory="clustering"/>
|
33
|
83 <filter>data['clust_type'] == "kmeans" or data['clust_type'] == "hierarchy"</filter>
|
16
|
84 </collection>
|
|
85 </outputs>
|
|
86 <help>
|
|
87 <![CDATA[
|
|
88
|
|
89 What it does
|
|
90 -------------
|
|
91
|
34
|
92 The tool performs cluster analysis of any dataset, according to most used algorithms: K-means, agglomerative
|
|
93 clustering and DBSCAN (Density Based Spatial Clustering of Applications with Noise).
|
|
94
|
|
95 Accepted files are:
|
|
96 - Tabular files in which rows indicate different variables and columns different observations. The first row reports the observations’ labels.
|
|
97
|
|
98
|
|
99 Example of input dataset:
|
|
100 -------------------------
|
|
101
|
|
102 +----------+----------+----------+
|
|
103 |TCGAA62670|TCGAA62671|TCGAA62672|
|
|
104 +==========+==========+==========+
|
|
105 | 0.523167 | 0.371355 | 0.925661 |
|
|
106 +----------+----------+----------+
|
|
107 | 0.568765 | 0.765567 | 0.456789 |
|
|
108 +----------+----------+----------+
|
|
109 | 0.876545 | 0.768933 | 0.987654 |
|
|
110 +----------+----------+----------+
|
|
111 | 0.456788 | 0.876543 | 0.876542 |
|
|
112 +----------+----------+----------+
|
|
113 | 0.876543 | 0.786543 | 0.897654 |
|
|
114 +----------+----------+----------+
|
|
115
|
|
116 .
|
|
117
|
|
118
|
|
119 Options:
|
|
120 --------
|
|
121
|
|
122 The following clustering types can be chosen:
|
|
123 - K-means. This option requires the number of clusters (k) to be set. Different values of k can be tested.
|
|
124 - Agglomerative clustering. Different values of k can be set, to cut the resulting dendrogram.
|
|
125 - DBSCAN. The DBSCAN method chooses the number of clusters based on parameters that define when a region is to be considered dense. Custom parameters may be used, namely the maximum distance between two samples for one to be considered as in the neighborhood of the other and the number of samples in a neighborhood for a point to be considered as a core point.
|
|
126
|
|
127 The tool generates:
|
|
128 - a tab-separated file: reporting the affiliation of each observation to a cluster. In case different numbers of clusters have been tested, the best cluster assignment is reported according to maximum average silhouette score. If desired, the elbow plot is generated, as well as silhouette plot for each k.
|
|
129 - a list of items, including: 1) the cluster assignment for each tested number of clusters 2) the dendrogram in case of agglomerative clustering 3) elbow and silhouete plots in case of k-means clustering.
|
|
130 - a log file (.txt).
|
|
131
|
|
132
|
|
133 .. class:: infomark
|
|
134
|
70
|
135 **TIP**: This tool has been conceived to cluster gene expression data, by using the RAS scores computed by `Ras tool`_.
|
34
|
136
|
|
137 .. class:: infomark
|
|
138
|
|
139 **TIP**: If your data is not TAB delimited, use `Convert delimiters to TAB`_.
|
|
140
|
|
141
|
|
142
|
|
143 @REFERENCE@
|
|
144
|
70
|
145 .. _Ras tool: http://bimib.disco.unimib.it:5555/?tool_id=toolshed.g2.bx.psu.edu%2Frepos%2Fbimib%2Fmarea%2FMaREA+RAS+Generator%2F1.0.6&version=1.0.6&__identifer=auulv6gbp76
|
|
146 .. _Convert delimiters to TAB: http://bimib.disco.unimib.it:5555/?tool_id=Convert+characters1&version=1.0.0&__identifer=76g7trea4j6
|
34
|
147
|
16
|
148
|
|
149 ]]>
|
|
150 </help>
|
|
151 <expand macro="citations" />
|
|
152 </tool>
|
|
153
|
|
154
|