-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathwaveica.xml
More file actions
173 lines (165 loc) · 9.12 KB
/
Copy pathwaveica.xml
File metadata and controls
173 lines (165 loc) · 9.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<tool id="waveica" name="WaveICA" version="@TOOL_VERSION@+galaxy10" profile="23.0">
<description>removal of batch effects for untargeted metabolomics data</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="annotation"/>
<expand macro="creator"/>
<requirements>
<requirement type="package" version="@TOOL_VERSION@">r-recetox-waveica</requirement>
<requirement type="package" version="24.0.0">r-arrow</requirement>
<requirement type="package" version="1.2.1">r-dplyr</requirement>
</requirements>
<command detect_errors="aggressive"><![CDATA[
Rscript -e "source('${__tool_directory__}/waveica_wrapper.R');
normalized_data <-
#if $batch_correction.mode == 'batchwise':
waveica(
data_matrix_file = '$data_matrix',
sample_metadata_file = '$sample_metadata',
ft_ext = '$data_matrix.ext',
mt_ext = '$sample_metadata.ext',
wavelet_filter = '$wf.wavelet_filter',
wavelet_length = '$wf.wavelet_length',
k = $k,
t = $batch_correction.t,
t2 = $batch_correction.t2,
alpha = $alpha,
exclude_blanks = $exclude_blanks,
transpose = $transpose_feature_table
)
#else:
waveica_singlebatch(
data_matrix_file = '$data_matrix',
sample_metadata_file = '$sample_metadata',
ft_ext = '$data_matrix.ext',
mt_ext = '$sample_metadata.ext',
wavelet_filter = '$wf.wavelet_filter',
wavelet_length = '$wf.wavelet_length',
k = $k,
alpha = $alpha,
cutoff = $batch_correction.cutoff,
exclude_blanks = $exclude_blanks
transpose = $transpose_feature_table
)
#end if
;store_data(normalized_data, '$normalized_data', '$data_matrix.ext')"
]]></command>
<inputs>
<param name="data_matrix" type="data" label="Feature table" format="csv,tsv,tabular,parquet" help="Table of measured features for each sample."/>
<param name="sample_metadata" label="Input sample metadata" type="data" format="csv,tsv,tabular,parquet" help="Table with sample information (e.g., sample name, class, batch, injection order) for each sample." />
<param name = "transpose_feature_table" label="Transpose feature table" type="boolean" checked="false"
truevalue="TRUE" falsevalue="FALSE" help="Swap sample names with feature names as column headers (to fit recetox-aplcms outputs)." />
<param type="integer" value="20" name="k" label="Number of components to decompose" help="maximal component that ICA decomposes"/>
<param type="float" value="0" name="alpha" label="Alpha" help="trade-off value between the independence of samples (temporal ICA) and variables (spatial ICA), should be between 0 and 1"/>
<expand macro="wf"/>
<conditional name="batch_correction">
<param name="mode" type="select" label="Batch correction mode" help="'multiple batches' takes into account
inter- and intrabatch intensity drift; 'single batch' relies only on the injection order of the samples and
requires no batch information [2]">
<option value="batchwise" selected="true">Multiple batches</option>
<option value="single_batch">Single batch (or no batch information)</option>
</param>
<when value="batchwise">
<param type="float" value="0.05" name="t" label="Batch-association threshold" help="threshold to consider a component associate with the batch, should be between 0 and 1"/>
<param type="float" value="0.05" name="t2" label="Group-association threshold" help="threshold to consider a component associate with the group, should be between 0 and 1"/>
</when>
<when value="single_batch">
<param type="float" value="0" name="cutoff" label="Cutoff" help="threshold of the variation explained by the injection order for independent components, should be between 0 and 1"/>
</when>
</conditional>
<param name="exclude_blanks" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Remove blanks" help="Excludes blank samples from the output" />
</inputs>
<expand macro="outputs"/>
<tests>
<test><!-- TEST 1: CSV input -->
<param name="data_matrix" value="data_matrix.csv" ftype="csv"/>
<param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/>
<param name="alpha" value="0"/>
<param name="k" value="20"/>
<conditional name="wf">
<param name="wavelet_filter" value="d"/>
<param name="wavelet_length" value="2"/>
</conditional>
<conditional name="batch_correction">
<param name="mode" value="batchwise"/>
<param name="t" value="0.05"/>
<param name="t2" value="0.05"/>
</conditional>
<output name="normalized_data" file="test1_output.csv" ftype="csv"/>
</test>
<test><!-- TEST 2: TSV input -->
<param name="data_matrix" value="data_matrix.tsv" ftype="tabular"/>
<param name="sample_metadata" value="sample_metadata.tsv" ftype="tabular"/>
<param name="alpha" value="0"/>
<param name="k" value="20"/>
<conditional name="wf">
<param name="wavelet_filter" value="d"/>
<param name="wavelet_length" value="2"/>
</conditional>
<conditional name="batch_correction">
<param name="mode" value="batchwise"/>
<param name="t" value="0.05"/>
<param name="t2" value="0.05"/>
</conditional>
<output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/>
</test>
<test><!-- TEST 3: Parquet input -->
<param name="data_matrix" value="data_matrix.parquet" ftype="parquet"/>
<param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/>
<param name="alpha" value="0"/>
<param name="k" value="20"/>
<conditional name="wf">
<param name="wavelet_filter" value="d"/>
<param name="wavelet_length" value="2"/>
</conditional>
<conditional name="batch_correction">
<param name="mode" value="batchwise"/>
<param name="t" value="0.05"/>
<param name="t2" value="0.05"/>
</conditional>
<output name="normalized_data" file="test3_output.parquet" compare="sim_size" delta="200" ftype="parquet"/>
</test>
<test expect_failure="true"><!-- TEST 4: NA data should fail -->
<param name="data_matrix" value="na_data.csv" ftype="csv"/>
<param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/>
</test>
<test expect_failure="true"><!-- TEST 5: Incomplete metadata should fail -->
<param name="data_matrix" value="data_matrix.csv" ftype="csv"/>
<param name="sample_metadata" value="incomplete_metadata_data.csv" ftype="csv"/>
</test>
<test><!-- TEST 6 -->
<param name="data_matrix" value="feature_table_transpose_version.parquet" ftype="parquet"/>
<param name="sample_metadata" value="sample_metadata.parquet" ftype="parquet"/>
<param name="transpose_feature_table" value="TRUE"/>
<output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200" ftype="parquet"/>
</test>
<test><!-- TEST 7 -->
<param name="data_matrix" value="feature_table_transpose_version.csv" ftype="csv"/>
<param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/>
<param name="transpose_feature_table" value="TRUE"/>
<output name="normalized_data" file="normalized_data.csv" ftype="csv"/>
</test>
<test><!-- TEST 8 -->
<param name="data_matrix" value="feature_table_transpose_version.parquet" ftype="parquet"/>
<param name="sample_metadata" value="sample_metadata.parquet" ftype="parquet"/>
<param name="transpose_feature_table" value="TRUE"/>
<output name="normalized_data" file="test9_output1.parquet" ftype="parquet"/>
</test>
<test><!-- TEST 9 -->
<param name="data_matrix" value="feature_table_transpose_version.csv" ftype="csv"/>
<param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/>
<param name="transpose_feature_table" value="TRUE"/>
<output name="normalized_data" file="test10_output1.csv" ftype="csv"/>
</test>
</tests>
<help>
<![CDATA[
@HELP@
]]>
</help>
<citations>
<citation type="doi">10.1016/j.aca.2019.02.010</citation>
<citation type="doi">10.1007/s11306-021-01839-7</citation>
</citations>
</tool>