comparison macros_inspectclusters.xml @ 0:4ea021bd7513 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/raceid3 commit f880060c478d42202df5b78a81329f8af56b1138
author iuc
date Thu, 22 Nov 2018 04:43:57 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4ea021bd7513
1 <macros>
2 <macro name="inspectclusters_inputs" >
3 <param name="inputrds" type="data" format="rdata" label="Input RaceID RDS" help="Requires the RDS output from the cluster analysis" />
4 <conditional name="plotgen">
5 <param name="do_opt" type="select" label="Plot All Clusters?" help="Generates tSNE and F-R plots" >
6 <option value="yes" selected="true" >Yes</option>
7 <option value="no" >No</option>
8 </param>
9 <when value="no" />
10 <when value="yes" />
11 </conditional>
12 <conditional name="plotsym" >
13 <param name="do_opt" type="select" label="Perform Subset Analysis?" >
14 <expand macro="yesno_checkedno" />
15 </param>
16 <when value="no" />
17 <when value="yes">
18 <param name="types_regex" type="text" optional="true" label="Types Regex (removal)" help="Regular expression to be used to remove portions of the cell names, in order to indicate cell type. e.g. if your cells are labelled as 'cdk5_1, cdk5_2, glow_1, glow_2', then a regex of '_\\d$' would trim off the ends and set the cell types to 'cdk5, cdk5, glow, glow'. " >
19 <expand macro="sanitize_regex" />
20 </param>
21 <expand macro="use_defaults_no" >
22 <param name="subset_regex" type="text" optional="true" label="Subset of Types: Regex (select)" help="Regular expression to be used to select for cell types of interest. e.g. if we are only interested in 'cdk5' positive cells, then we would simply put 'cdk5' here. ">
23 <expand macro="sanitize_regex" />
24 </param>
25 <param name="fr" type="boolean" checked="false" label="Output FR map instead of tSNE" help="Performs a Fruchterman-Rheingold projection instead of tSNE" />
26 </expand>
27 </when>
28 </conditional>
29 <conditional name="gois" >
30 <param name="do_opt" type="select" label="Examine Genes of Interest" >
31 <expand macro="yesno_checkedno" />
32 </param>
33 <when value="no" />
34 <when value="yes">
35 <param name="inspect_goi_genes" type="text" value="" label="Genes to Examine" >
36 <expand macro="sanitize_string_vector" />
37 </param>
38 <param name="inspect_goi_cells" type="text" optional="true" label="Cells to Examine" help="Leave blank to examine all" ><!-- "":NULL -->
39 <expand macro="sanitize_string_vector" />
40 </param>
41 <expand macro="use_defaults_no" >
42 <!-- Yes, examine genes of interest, but no do not use defaults... -->
43 <param name="inspect_goi_imputed" type="boolean" checked="false" label="Impute Genes" help="Only works if k-nearest neighbours was used in the clustering" />
44 <param name="plotexp_n" type="text" optional="true" label="Title of plot" help="If blank, the list of genes are used" >
45 <expand macro="sanitize_title" />
46 </param>
47 <param name="plotmarkg_cthr" type="integer" min="0" value="0" label="Cluster Threshold" help="Include only clusters with cells greater than this" />
48 <param name="plotmarkg_cl" type="text" optional="true" label="Cluster List" help="List of cluster numbers to include. Leave blank to include all" >
49 <expand macro="sanitize_numeric_vector" />
50 </param><!-- "":NULL -->
51 <param name="plotmarkg_order_cells" type="boolean" checked="false" label="Order Cells" help="Order heatmap by cell names, not by cluster" />
52 <param name="plotmarkg_aggr" type="boolean" checked="false" label="Average Expression" help="Show only average expression for each cluster" />
53 <param name="plotmarkg_norm" type="boolean" checked="false" label="Normalise Gene Expression " help="Normalise gene expression to 1 to depict genes on the same scale" />
54 <param name="plotmarkg_flo" type="integer" max="-5" optional="true" label="Lower-bound for Gene Expression" /><!-- negative or null vals only for this seem to work-->
55 <param name="plotmarkg_cap" type="integer" min="1" optional="true" label="Upper-bound for Gene Expression" />
56 <param name="plotmarkg_samples" type="text" optional="true" label="Regex to Select Sample Names For Each cell" >
57 <expand macro="sanitize_regex" />
58 </param>
59 <param name="plotmarkg_cluster_cols" type="boolean" checked="false" label="Cluster columns" />
60 <param name="plotmarkg_cluster_rows" type="boolean" checked="true" label="Cluster rows" />
61 <param name="plotmarkg_cluster_set" type="boolean" checked="false" label="Order Clusters by Heirarchal Clustering of Cluster Medoids." />
62 </expand>
63 </when>
64 </conditional>
65 <conditional name="diffgtest" >
66 <param name="do_opt" type="select" label="Differential Gene Testing" >
67 <expand macro="yesno_checkedno" />
68 </param>
69 <when value="no" />
70 <when value="yes" >
71 <expand macro="select_cells" sectionname="set_a" sectiontitle="Cells in Set A" />
72 <expand macro="select_cells" sectionname="set_b" sectiontitle="Cells in Set B" />
73 <expand macro="use_defaults_no" >
74 <param name="plotdiffg_pthr" type="float" min="0" max="1" value="0.05" label="P-value cutoff" help="Cutoff for displaying differentially expressed genes" />
75 <param name="plotdiffg_padj" type="boolean" checked="true" label="Apply B-H Correction" help="Display genes with a Benjamini-Hochberg corrected false discovery rate lower than the above P-value threshold" />
76 <param name="plotdiffg_lthr" type="float" min="0" value="0" label="Log2-Fold Threshold" help="Differentially expressed genes are displayed only for log2 fold-changes higher than this" />
77 <param name="plotdiffg_mthr" type="float" optional="true" label="Log2 Mean Threshold" help="Differentially expressed genes are displayed only for log2 mean expression greater than this" /><!-- opt:-Inf -->
78 <param name="plotdiffg_show_names" type="boolean" checked="false" label="Display Gene Names" />
79 </expand>
80 </when>
81 </conditional>
82 </macro>
83 <macro name="inspectclusters_tests" >
84 <test><!-- general plots, plotgen -->
85 <param name="inputrds" value="out_cluster_default.rdat" />
86 <conditional name="plotgen" >
87 <param name="do_opt" value="yes" />
88 </conditional>
89 <output name="outpdf" value="out_cluster_general_default.pdf" />
90 </test>
91 <test><!-- default test, plotsym -->
92 <param name="inputrds" value="out_cluster_default.rdat" />
93 <conditional name="plotsym" >
94 <param name="do_opt" value="yes" />
95 <param name="types_regex" value="\\_\\d+" />
96 <expand macro="test_nondef" >
97 <param name="subset_regex" value="IV|V" />
98 </expand>
99 </conditional>
100 <conditional name="gois" >
101 <param name="do_opt" value="yes" />
102 <param name="inspect_goi_genes" value="Apoa1,Apoa1bp,Apoa2,Apoa4,Apoa5" />
103 </conditional>
104 <output name="outpdf" value="out_cluster_inspect_default.pdf" />
105 </test>
106 <test><!-- Advanced 1 -->
107 <param name="inputrds" value="out_cluster_default.rdat" />
108 <conditional name="plotsym" >
109 <param name="do_opt" value="yes" />
110 <param name="types_regex" value="\\_\\d+" />
111 <expand macro="test_nondef" >
112 <param name="subset_regex" value="IV|V" />
113 <param name="fr" value="true" />
114 </expand>
115 </conditional>
116 <conditional name="gois" >
117 <param name="do_opt" value="yes" />
118 <param name="inspect_goi_genes" value="Apoa1,Apoa1bp,Apoa2,Apoa4,Apoa5" />
119 <expand macro="test_nondef" >
120 <param name="inspect_goi_imputed" value="false" />
121 <param name="plotexp_n" value="Test Title" />
122 <param name="plotmarkg_order_cells" value="true" />
123 <param name="plotmarkg_aggr" value="true" />
124 <param name="plotmarkg_norm" value="true" />
125 <param name="plotmarkg_flo" value="-10" />
126 <param name="plotmarkg_cap" value="100" />
127 <param name="plotmarkg_samples" value="(\\_\\d+)$" />
128 <param name="plotmarkg_cluster_cols" value="true" />
129 <param name="plotmarkg_cluster_rows" value="false" />
130 <param name="plotmarkg_cluster_set" value="true" />
131 </expand>
132 </conditional>
133 <conditional name="diffgtest" >
134 <param name="do_opt" value="yes" />
135 <section name="set_a" >
136 <param name="name_set" value="Test set A" />
137 <conditional name="meth" >
138 <param name="type" value="regex" />
139 <param name="selector" value="^V5.*" />
140 </conditional>
141 </section>
142 <section name="set_b" >
143 <param name="name_set" value="Test set B" />
144 <conditional name="meth" >
145 <param name="type" value="manual" />
146 <param name="selector" value="I5d_3,I5d_4,I5d_6,I5d_8,I5d_9,I5d_10,I5d_11,I5d_12,I5d_13,I5d_14" />
147 </conditional>
148 </section>
149 <expand macro="test_nondef" >
150 <param name="plotdiffg_pthr" value="0.1" />
151 <param name="plotdiffg_padj" value="false" />
152 <param name="plotdiffg_lthr" value="0.2" />
153 <param name="plotdiffg_mthr" value="0.2" />
154 <param name="plotdiffg_show_names" value="true" />
155 </expand>
156 </conditional>
157 <output name="outpdf" value="out_cluster_inspect_advanced1.pdf" />
158 </test>
159 <test><!-- Advanced 2 -->
160 <param name="inputrds" value="out_cluster_default.rdat" />
161 <conditional name="plotsym" >
162 <param name="do_opt" value="yes" />
163 <expand macro="test_nondef" >
164 <param name="fr" value="false" />
165 </expand>
166 </conditional>
167 <conditional name="gois" >
168 <param name="do_opt" value="yes" />
169 <param name="inspect_goi_genes" value="Sp1,Spc24,Spcs1,Spcs2,Spcs3" />
170 <expand macro="test_nondef" >
171 <param name="plotexp_n" value="Test Title 2" />
172 <param name="plotmarkg_order_cells" value="true" />
173 <param name="plotmarkg_aggr" value="true" />
174 <param name="plotmarkg_norm" value="false" />
175 <param name="plotmarkg_flo" value="-10" />
176 <param name="plotmarkg_cap" value="10" />
177 <param name="plotmarkg_cluster_cols" value="true" />
178 <param name="plotmarkg_cluster_rows" value="true" />
179 <param name="plotmarkg_cluster_set" value="true" />
180 </expand>
181 </conditional>
182 <conditional name="diffgtest" >
183 <param name="do_opt" value="yes" />
184 <section name="set_a" >
185 <param name="name_set" value="Test set A" />
186 <conditional name="meth" >
187 <param name="type" value="regex" />
188 <param name="selector" value="^IV.*" />
189 </conditional>
190 </section>
191 <section name="set_b" >
192 <param name="name_set" value="Test set B" />
193 <conditional name="meth" >
194 <param name="type" value="cln" />
195 <param name="selector" value="3" />
196 </conditional>
197 </section>
198 <expand macro="test_nondef" >
199 <param name="plotdiffg_pthr" value="0.8" />
200 <param name="plotdiffg_padj" value="true" />
201 <param name="plotdiffg_lthr" value="0.8" />
202 <param name="plotdiffg_mthr" value="0.8" />
203 <param name="plotdiffg_show_names" value="false" />
204 </expand>
205 </conditional>
206 <output name="outpdf" value="out_cluster_inspect_advanced2.pdf" />
207 </test>
208 </macro>
209 <token name="@INSPECTCLUSTERS_CHEETAH@"><![CDATA[
210
211 in.rdat = readRDS('${inputrds}')
212
213 perform.plotting = FALSE
214 perform.symbolmap = FALSE
215 perform.genesofinterest = FALSE
216 perform.diffgene = FALSE
217
218 #if str($plotgen.do_opt) == "yes":
219 perform.plotting = TRUE
220 #end if
221
222 #if str($plotsym.do_opt) == "yes":
223 perform.symbolmap = TRUE
224 plotsym = formals(plotsymbolsmap)
225 plotsym.use.typeremoveregex = NULL
226 plotsym.use.typeremoveregex.subselect = NULL
227 plotsym.use.typeremoveregex = as.character( '$plotsym.types_regex' )
228 #if str($plotsym.use.def) == "no":
229 plotsym\$fr = as.logical( '$plotsym.use.fr' )
230 #if $plotsym.use.subset_regex:
231 plotsym.use.typeremoveregex.subselect = as.character( '$plotsym.use.subset_regex' )
232 #end if
233 #end if
234 #end if
235
236 #if str($gois.do_opt) == "yes":
237 perform.genesofinterest = TRUE
238 plotexp = formals(plotexpmap)
239 plotmarkg = formals(plotmarkergenes)
240
241 inspect.goi.use.genes = string2textvector( '$gois.inspect_goi_genes' )
242 plotexp\$g = inspect.goi.use.genes
243 plotmarkg\$genes = inspect.goi.use.genes
244
245 #if $gois.inspect_goi_cells:
246 inspect.goi.use.cells = as.character( '$gois.inspect_goi_cells' )
247 plotexp\$cells = inspect.goi.use.cells
248 plotmarkg\$cells = inspect.goi.use.cells
249 #end if
250 #if str($gois.use.def) == "no":
251 inspect.goi.use.imputed = as.logical( '$gois.use.inspect_goi_imputed' )
252 plotexp\$imputed = inspect.goi.use.imputed
253 plotmarkg\$imputed = inspect.goi.use.imputed
254 #if $gois.use.plotmarkg_cl
255 plotmarkg\$cl = string2numericvector( '$gois.use.plotmarkg_cl' )
256 #end if
257 #if $gois.use.plotmarkg_cap
258 plotmarkg\$cap = as.integer( '$gois.use.plotmarkg_cap' )
259 #end if
260 #if $gois.use.plotmarkg_flo
261 plotmarkg\$flo = as.integer( '$gois.use.plotmarkg_flo' )
262 #end if
263 #if $gois.use.plotmarkg_samples
264 plotmarkg\$samples = as.character( '$gois.use.plotmarkg_samples' )
265 #end if
266 #if $gois.use.plotexp_n
267 plotexp\$n = as.character( '$gois.use.plotexp_n' )
268 #end if
269 plotmarkg\$cthr = as.integer( '$gois.use.plotmarkg_cthr' )
270 plotmarkg\$order.cells = as.logical( '$gois.use.plotmarkg_order_cells' )
271 plotmarkg\$aggr = as.logical( '$gois.use.plotmarkg_aggr' )
272 plotmarkg\$norm = as.logical( '$gois.use.plotmarkg_norm' )
273 plotmarkg\$cluster_cols = as.logical( '$gois.use.plotmarkg_cluster_cols' )
274 plotmarkg\$cluster_rows = as.logical( '$gois.use.plotmarkg_cluster_rows' )
275 plotmarkg\$cluster_set = as.logical( '$gois.use.plotmarkg_cluster_set' )
276 #end if
277 #end if
278
279 #if str($diffgtest.do_opt) == "yes":
280 plotdiffg = formals(plotdiffgenesnb)
281
282 perform.diffgene = TRUE
283 plotdiffg\$Aname = '$diffgtest.set_a.name_set'
284 plotdiffg\$Bname = '$diffgtest.set_b.name_set'
285
286 gfdat.A.use = list()
287 gfdat.B.use = list()
288
289 gfdat.A.use\$manual = NULL
290 gfdat.A.use\$regex = NULL
291 gfdat.A.use\$cln = NULL
292 gfdat.B.use\$manual = NULL
293 gfdat.B.use\$regex = NULL
294 gfdat.B.use\$cln = NULL
295
296 #if str($diffgtest.set_a.meth.type) == "cln":
297 gfdat.A.use\$cln = c( '$diffgtest.set_a.meth.selector' )
298 #else if str($diffgtest.set_a.meth.type) == "regex":
299 gfdat.A.use\$regex = as.character( '$diffgtest.set_a.meth.selector' )
300 #else if str($diffgtest.set_a.meth.type) == "manual":
301 gfdat.A.use\$manual = string2textvector( '$diffgtest.set_a.meth.selector' )
302 #end if
303
304 #if str($diffgtest.set_b.meth.type) == "cln":
305 gfdat.B.use\$cln = c( '$diffgtest.set_b.meth.selector' )
306 #else if str($diffgtest.set_b.meth.type) == "regex":
307 gfdat.B.use\$regex = as.character( '$diffgtest.set_b.meth.selector' )
308 #else if str($diffgtest.set_b.meth.type) == "manual":
309 gfdat.B.use\$manual = string2textvector( '$diffgtest.set_b.meth.selector' )
310 #end if
311
312 #if str($diffgtest.use.def) == "no":
313 plotdiffg\$pthr = as.numeric( '$diffgtest.use.plotdiffg_pthr' )
314 plotdiffg\$padj = as.logical( '$diffgtest.use.plotdiffg_padj' )
315 plotdiffg\$lthr = as.integer( '$diffgtest.use.plotdiffg_lthr' )
316 plotdiffg\$show_names = as.logical( '$diffgtest.use.plotdiffg_show_names' )
317 #if $diffgtest.use.plotdiffg_mthr
318 plotdiffg\$mthr = as.numeric( '$diffgtest.use.plotdiffg_mthr' )
319 #end if
320 #end if
321 #end if
322
323 out.pdf='${outpdf}'
324 ]]>
325 </token>
326 </macros>