80
|
1 <tool id="kpca1" name="Kernel Principal Component Analysis" version="1.1.0">
|
|
2 <description> </description>
|
|
3 <expand macro="requirements" />
|
|
4 <macros>
|
|
5 <import>statistic_tools_macros.xml</import>
|
|
6 </macros>
|
|
7 <command interpreter="python">
|
|
8 kpca.py
|
|
9 --input=$input1
|
|
10 --output1=$out_file1
|
|
11 --output2=$out_file2
|
|
12 --var_cols=$var_cols
|
|
13 --kernel=$kernelChoice.kernel
|
|
14 --features=$features
|
|
15 #if $kernelChoice.kernel == "rbfdot" or $kernelChoice.kernel == "anovadot":
|
|
16 --sigma=$kernelChoice.sigma
|
|
17 --degree="None"
|
|
18 --scale="None"
|
|
19 --offset="None"
|
|
20 --order="None"
|
|
21 #elif $kernelChoice.kernel == "polydot":
|
|
22 --sigma="None"
|
|
23 --degree=$kernelChoice.degree
|
|
24 --scale=$kernelChoice.scale
|
|
25 --offset=$kernelChoice.offset
|
|
26 --order="None"
|
|
27 #elif $kernelChoice.kernel == "tanhdot":
|
|
28 --sigma="None"
|
|
29 --degree="None"
|
|
30 --scale=$kernelChoice.scale
|
|
31 --offset=$kernelChoice.offset
|
|
32 --order="None"
|
|
33 #elif $kernelChoice.kernel == "besseldot":
|
|
34 --sigma=$kernelChoice.sigma
|
|
35 --degree=$kernelChoice.degree
|
|
36 --scale="None"
|
|
37 --offset="None"
|
|
38 --order=$kernelChoice.order
|
|
39 #elif $kernelChoice.kernel == "anovadot":
|
|
40 --sigma=$kernelChoice.sigma
|
|
41 --degree=$kernelChoice.degree
|
|
42 --scale="None"
|
|
43 --offset="None"
|
|
44 --order="None"
|
|
45 #else:
|
|
46 --sigma="None"
|
|
47 --degree="None"
|
|
48 --scale="None"
|
|
49 --offset="None"
|
|
50 --order="None"
|
|
51 #end if
|
|
52 </command>
|
|
53 <inputs>
|
|
54 <param format="tabular" name="input1" type="data" label="Select data" help="Dataset missing? See TIP below."/>
|
|
55 <param name="var_cols" label="Select columns containing input variables " type="data_column" data_ref="input1" numerical="True" multiple="true" >
|
|
56 <validator type="no_options" message="Please select at least one column."/>
|
|
57 </param>
|
|
58 <param name="features" size="10" type="integer" value="2" label="Number of principal components to return" help="To return all, enter 0"/>
|
|
59 <conditional name="kernelChoice">
|
|
60 <param name="kernel" type="select" label="Kernel function">
|
|
61 <option value="rbfdot" selected="true">Gaussian Radial Basis Function</option>
|
|
62 <option value="polydot">Polynomial</option>
|
|
63 <option value="vanilladot">Linear</option>
|
|
64 <option value="tanhdot">Hyperbolic</option>
|
|
65 <option value="laplacedot">Laplacian</option>
|
|
66 <option value="besseldot">Bessel</option>
|
|
67 <option value="anovadot">ANOVA Radial Basis Function</option>
|
|
68 <option value="splinedot">Spline</option>
|
|
69 </param>
|
|
70 <when value="vanilladot" />
|
|
71 <when value="splinedot" />
|
|
72 <when value="rbfdot">
|
|
73 <param name="sigma" size="10" type="float" value="1" label="sigma (inverse kernel width)" />
|
|
74 </when>
|
|
75 <when value="laplacedot">
|
|
76 <param name="sigma" size="10" type="float" value="1" label="sigma (inverse kernel width)" />
|
|
77 </when>
|
|
78 <when value="polydot">
|
|
79 <param name="degree" size="10" type="integer" value="1" label="degree" />
|
|
80 <param name="scale" size="10" type="integer" value="1" label="scale" />
|
|
81 <param name="offset" size="10" type="integer" value="1" label="offset" />
|
|
82 </when>
|
|
83 <when value="tanhdot">
|
|
84 <param name="scale" size="10" type="integer" value="1" label="scale" />
|
|
85 <param name="offset" size="10" type="integer" value="1" label="offset" />
|
|
86 </when>
|
|
87 <when value="besseldot">
|
|
88 <param name="sigma" size="10" type="integer" value="1" label="sigma" />
|
|
89 <param name="order" size="10" type="integer" value="1" label="order" />
|
|
90 <param name="degree" size="10" type="integer" value="1" label="degree" />
|
|
91 </when>
|
|
92 <when value="anovadot">
|
|
93 <param name="sigma" size="10" type="integer" value="1" label="sigma" />
|
|
94 <param name="degree" size="10" type="integer" value="1" label="degree" />
|
|
95 </when>
|
|
96 </conditional>
|
|
97 </inputs>
|
|
98 <outputs>
|
|
99 <data format="input" name="out_file1" metadata_source="input1" />
|
|
100 <data format="pdf" name="out_file2" />
|
|
101 </outputs>
|
|
102 <tests>
|
|
103 <test>
|
|
104 <param name="input1" value="iris.tabular"/>
|
|
105 <param name="var_cols" value="1,2,3,4"/>
|
|
106 <param name="kernel" value="polydot"/>
|
|
107 <param name="features" value="2"/>
|
|
108 <param name="offset" value="0"/>
|
|
109 <param name="scale" value="1"/>
|
|
110 <param name="degree" value="2"/>
|
|
111 <output name="out_file1" file="kpca_out1.tabular"/>
|
|
112 <output name="out_file2" file="kpca_out2.pdf"/>
|
|
113 </test>
|
|
114 </tests>
|
|
115 <help>
|
|
116
|
|
117
|
|
118 .. class:: infomark
|
|
119
|
|
120 **TIP:** If your data is not TAB delimited, use *Edit Datasets->Convert characters*
|
|
121
|
|
122 -----
|
|
123
|
|
124 .. class:: infomark
|
|
125
|
|
126 **What it does**
|
|
127
|
|
128 This tool uses functions from 'kernlab' library from R statistical package to perform Kernel Principal Component Analysis (kPCA) on the input data. It outputs two files, one containing the summary statistics of the performed kPCA, and the other containing a scatterplot matrix of rotated values reported by kPCA.
|
|
129
|
|
130 *Alexandros Karatzoglou, Alex Smola, Kurt Hornik, Achim Zeileis (2004). kernlab - An S4 Package for Kernel Methods in R. Journal of Statistical Software 11(9), 1-20. URL http://www.jstatsoft.org/v11/i09/*
|
|
131
|
|
132 -----
|
|
133
|
|
134 .. class:: warningmark
|
|
135
|
|
136 **Note**
|
|
137
|
|
138 This tool currently treats all variables as continuous numeric variables. Running the tool on categorical variables might result in incorrect results. Rows containing non-numeric (or missing) data in any of the chosen columns will be skipped from the analysis.
|
|
139
|
|
140 </help>
|
|
141 </tool>
|