Skip to content

Commit 4fcee83

Browse files
committed
cleaning macro
1 parent dae5436 commit 4fcee83

File tree

5 files changed

+72
-73
lines changed

5 files changed

+72
-73
lines changed

tools/flexynesis/flexynesis.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
#end if
216216
]]></command>
217217
<inputs>
218-
<expand macro="commercial_use"/>
218+
<expand macro="commercial_use_param"/>
219219
<conditional name="training_type">
220220
<param name="model" type="select" label="Type of Analysis" >
221221
<option value="s_train">Supervised training</option>
@@ -262,13 +262,13 @@
262262
<when value="XGBoost"/>
263263
</conditional>
264264
<param argument="--target_variables" type="text" label="Target variables" help="Which variables in 'clin.csv' to use for predictions, comma-separated if multiple.">
265-
<expand macro="sanitizer"/>
265+
<expand macro="sanitizer_printable"/>
266266
</param>
267267
<param argument="--surv_event_var" type="text" label="Survival event" help="Which column in 'clin.csv' to use as event/status indicator for survival modeling.">
268-
<expand macro="sanitizer"/>
268+
<expand macro="sanitizer_printable"/>
269269
</param>
270270
<param argument="--surv_time_var" type="text" label="Survival time" help="Which column in 'clin.csv' to use as time/duration indicator for survival modeling.">
271-
<expand macro="sanitizer"/>
271+
<expand macro="sanitizer_printable"/>
272272
</param>
273273
<expand macro="advanced"/>
274274
</when>
@@ -314,7 +314,7 @@
314314
<option value="pca" selected="true">PCA</option>
315315
<option value="umap">UMAP</option>
316316
</param>
317-
<expand macro="plots"/>
317+
<expand macro="plots_common_param"/>
318318
</when>
319319
</conditional>
320320
<conditional name="plot_km_conditional">
@@ -326,9 +326,9 @@
326326
</when>
327327
<when value="yes">
328328
<param name="event_value" type="text" label="Event value" optional="false" help="The value in the event column that indicates an event (e.g. death) has occurred.">
329-
<expand macro="sanitizer"/>
329+
<expand macro="sanitizer_printable"/>
330330
</param>
331-
<expand macro="plots"/>
331+
<expand macro="plots_common_param"/>
332332
</when>
333333
</conditional>
334334
<conditional name="plot_cox_conditional">
@@ -340,18 +340,18 @@
340340
</when>
341341
<when value="yes">
342342
<param name="omics_name" type="text" label="Omics layer to use for cox input" optional="false" help="If not specified, the first omics layer will be used.">
343-
<expand macro="sanitizer"/>
343+
<expand macro="sanitizer_printable"/>
344344
</param>
345345
<param name="clinical_variables" type="text" label="Clinical covariates" optional="true" help="Comma-separated list of clinical covariates to include in the Cox model (e.g SEX, AGE, ...).">
346-
<expand macro="sanitizer">
346+
<expand macro="sanitizer_printable">
347347
<remove value=" "/>
348348
</expand>
349349
</param>
350350
<param argument="--top_features" type="integer" min="1" value="20" label="Number of top important features to include in Cox model"/>
351351
<param name="event_value" type="text" label="Event value" optional="false" help="The value in the event column that indicates an event (e.g. death) has occurred.">
352-
<expand macro="sanitizer"/>
352+
<expand macro="sanitizer_printable"/>
353353
</param>
354-
<expand macro="plots"/>
354+
<expand macro="plots_common_param"/>
355355
</when>
356356
</conditional>
357357
<conditional name="plot_scatter_conditional">
@@ -362,7 +362,7 @@
362362
<when value="no">
363363
</when>
364364
<when value="yes">
365-
<expand macro="plots"/>
365+
<expand macro="plots_common_param"/>
366366
</when>
367367
</conditional>
368368
<conditional name="plot_concordance_conditional">
@@ -373,7 +373,7 @@
373373
<when value="no">
374374
</when>
375375
<when value="yes">
376-
<expand macro="plots"/>
376+
<expand macro="plots_common_param"/>
377377
</when>
378378
</conditional>
379379
<conditional name="plot_pr_curves_conditional">
@@ -384,7 +384,7 @@
384384
<when value="no">
385385
</when>
386386
<when value="yes">
387-
<expand macro="plots"/>
387+
<expand macro="plots_common_param"/>
388388
</when>
389389
</conditional>
390390
<conditional name="plot_roc_curves_conditional">
@@ -395,7 +395,7 @@
395395
<when value="no">
396396
</when>
397397
<when value="yes">
398-
<expand macro="plots"/>
398+
<expand macro="plots_common_param"/>
399399
</when>
400400
</conditional>
401401
<conditional name="plot_boxplot_conditional">
@@ -406,7 +406,7 @@
406406
<when value="no">
407407
</when>
408408
<when value="yes">
409-
<expand macro="plots"/>
409+
<expand macro="plots_common_param"/>
410410
</when>
411411
</conditional>
412412
</section>

tools/flexynesis/flexynesis_cbioportal_import.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ with open(output_path, 'w') as f:
3030
]]></configfile>
3131
</configfiles>
3232
<inputs>
33-
<expand macro="commercial_use"/>
33+
<expand macro="commercial_use_param"/>
3434
<param name="study_id" label="cBioPortal study ID" type="select" help="contact the administrator of this Galaxy instance if you miss a study ID">
3535
<options from_data_table="cbio"/>
3636
</param>

tools/flexynesis/flexynesis_plot.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ from flexynesis_plot import (
4747
match_samples_to_embeddings
4848
)
4949
#if $plot_conditional.plot_type == "dimred":
50-
@PLOT_CONFIG@
50+
@PLOT_COMMON_CONFIG@
5151
embeddings, sample_names = load_embeddings('inputs/$plot_conditional.embeddings.element_identifier.$plot_conditional.embeddings.ext')
5252
matched_labels = match_samples_to_embeddings(sample_names, label_data)
5353
@@ -63,7 +63,7 @@ fig = plot_dim_reduced(
6363
output_path = "plots/{label}_${plot_conditional.method}.${plot_conditional.format}"
6464
fig.save(output_path, dpi=$plot_conditional.dpi, bbox_inches='tight')
6565
#else if $plot_conditional.plot_type == "scatter":
66-
@PLOT_CONFIG@
66+
@PLOT_COMMON_CONFIG@
6767
6868
true_label = label_data.columns[$plot_conditional.true_label-1]
6969
predicted_label = label_data.columns[$plot_conditional.predicted_label-1]
@@ -79,7 +79,7 @@ output_path = "plots/${plot_conditional.true_label}_${plot_conditional.predicted
7979
fig.save(output_path, dpi=$plot_conditional.dpi, bbox_inches='tight')
8080
8181
#else if $plot_conditional.plot_type == "concordance_heatmap":
82-
@PLOT_CONFIG@
82+
@PLOT_COMMON_CONFIG@
8383
8484
true_label = label_data.columns[$plot_conditional.true_label-1]
8585
predicted_label = label_data.columns[$plot_conditional.predicted_label-1]
@@ -92,21 +92,21 @@ output_path = "plots/{true_label}_{predicted_label}_concordance_heatmap.${plot_c
9292
fig.savefig(output_path, dpi=$plot_conditional.dpi, bbox_inches='tight')
9393
9494
#else if $plot_conditional.plot_type == "pr_curve":
95-
@PR_ROC_COMMON@
95+
@PR_ROC_CONFIG@
9696
9797
fig = plot_pr_curves(y_true_np, y_probs_np)
9898
9999
output_path = "plots/pr_curves.${plot_conditional.format}"
100100
fig.save(output_path, dpi=$plot_conditional.dpi, bbox_inches='tight')
101101
102102
#else if $plot_conditional.plot_type == "roc_curve":
103-
@PR_ROC_COMMON@
103+
@PR_ROC_CONFIG@
104104
fig = plot_roc_curves(y_true_np, y_probs_np)
105105
output_path = "plots/roc_curves.${plot_conditional.format}"
106106
fig.save(output_path, dpi=$plot_conditional.dpi, bbox_inches='tight')
107107
108108
#else if $plot_conditional.plot_type == "box_plot":
109-
@PR_ROC_BOX_COMMON@
109+
@PR_ROC_BOX_CONFIG@
110110
# Remove rows with missing data
111111
clean_data = label_data.dropna(subset=['known_label', 'probability'])
112112
@@ -140,7 +140,7 @@ for class_label in classes:
140140
]]></configfile>
141141
</configfiles>
142142
<inputs>
143-
<expand macro="commercial_use"/>
143+
<expand macro="commercial_use_param"/>
144144
<conditional name="plot_conditional">
145145
<param name="plot_type" type="select" label="Flexynesis plot">
146146
<option value="dimred">Dimensionality reduction</option>
@@ -151,8 +151,8 @@ for class_label in classes:
151151
<option value="box_plot">Box plot</option>
152152
</param>
153153
<when value="dimred">
154-
<expand macro="plots">
155-
<expand macro="common_plot_input"/>
154+
<expand macro="plots_common_param">
155+
<expand macro="plots_common_input"/>
156156
<param argument="--embeddings" type="data" format="tabular,csv" label="Embeddings" help="Generated by flexynesis"/>
157157
<param argument="--label" type="data_column" data_ref="labels" label="Column in the labels file to use for coloring the points in the plot"/>
158158
<param name="method" type="select" label="Transformation method">
@@ -162,32 +162,32 @@ for class_label in classes:
162162
</expand>
163163
</when>
164164
<when value="scatter">
165-
<expand macro="plots">
166-
<expand macro="common_plot_input"/>
165+
<expand macro="plots_common_param">
166+
<expand macro="plots_common_input"/>
167167
<param name="true_label" type="data_column" data_ref="labels" label="Column name in the labels file to use for the true labels"/>
168168
<param name="predicted_label" type="data_column" data_ref="labels" label="Column name in the labels file to use for the predicted labels"/>
169169
</expand>
170170
</when>
171171
<when value="concordance_heatmap">
172-
<expand macro="plots">
173-
<expand macro="common_plot_input"/>
172+
<expand macro="plots_common_param">
173+
<expand macro="plots_common_input"/>
174174
<param name="true_label" type="data_column" data_ref="labels" label="Column name in the labels file to use for the true labels"/>
175175
<param name="predicted_label" type="data_column" data_ref="labels" label="Column name in the labels file to use for the predicted labels"/>
176176
</expand>
177177
</when>
178178
<when value="pr_curve">
179-
<expand macro="plots">
180-
<expand macro="common_plot_input"/>
179+
<expand macro="plots_common_param">
180+
<expand macro="plots_common_input"/>
181181
</expand>
182182
</when>
183183
<when value="roc_curve">
184-
<expand macro="plots">
185-
<expand macro="common_plot_input"/>
184+
<expand macro="plots_common_param">
185+
<expand macro="plots_common_input"/>
186186
</expand>
187187
</when>
188188
<when value="box_plot">
189-
<expand macro="plots">
190-
<expand macro="common_plot_input"/>
189+
<expand macro="plots_common_param">
190+
<expand macro="plots_common_input"/>
191191
</expand>
192192
</when>
193193
</conditional>

tools/flexynesis/flexynesis_utils.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ with open(output_path, 'w') as f:
136136
]]></configfile>
137137
</configfiles>
138138
<inputs>
139-
<expand macro="commercial_use"/>
139+
<expand macro="commercial_use_param"/>
140140
<conditional name="utils_conditional">
141141
<param name="util" type="select" label="Flexynesis utils">
142142
<option value="louvain_clustering">Louvain Clustering</option>
@@ -148,23 +148,23 @@ with open(output_path, 'w') as f:
148148
</param>
149149
<when value="louvain_clustering">
150150
<param argument="--X" type="data" format="tabular,csv" label="Matrix" help="Input matrix, (samples, features)"/>
151-
<expand macro="common_plot_input"/>
151+
<expand macro="plots_common_input"/>
152152
<param argument="--threshold" type="float" min="0" optional="true" label="Distance threshold to create an edge between two nodes"/>
153153
<param argument="--k" type="integer" min="0" optional="true" label="Number of nearest neighbors to connect for each node"/>
154154
</when>
155155
<when value="get_optimal_clusters">
156156
<param argument="--X" type="data" format="tabular,csv" label="Matrix" help="Input matrix, (samples, features)"/>
157-
<expand macro="common_plot_input"/>
157+
<expand macro="plots_common_input"/>
158158
<param argument="--min_k" type="integer" min="0" value="2" optional="false" label="Minimum number of clusters to try"/>
159159
<param argument="--max_k" type="integer" min="0" value="10" optional="false" label="Maximum number of clusters to try"/>
160160
</when>
161161
<when value="k_means_clustering">
162162
<param argument="--X" type="data" format="tabular,csv" label="Matrix" help="Input matrix, (samples, features)"/>
163-
<expand macro="common_plot_input"/>
163+
<expand macro="plots_common_input"/>
164164
<param argument="--k" type="integer" min="0" optional="true" label="The number of clusters to form"/>
165165
</when>
166166
<when value="compute_ami_ari">
167-
<expand macro="common_plot_input"/>
167+
<expand macro="plots_common_input"/>
168168
<param name="true_label" type="data_column" data_ref="labels" label="Column name in the labels file to use for the true labels"/>
169169
<param name="predicted_label" type="data_column" data_ref="labels" label="Column name in the labels file to use for the predicted labels"/>
170170
</when>

0 commit comments

Comments
 (0)