Mercurial > repos > recetox > waveica
comparison waveica.xml @ 10:821062fc5782 draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/waveica commit 2b8b1dcb2947c6503fd4f82904df708e4f88ea1d
| author | recetox |
|---|---|
| date | Fri, 04 Jul 2025 09:43:22 +0000 |
| parents | 6fc9f6dbcef5 |
| children |
comparison
equal
deleted
inserted
replaced
| 9:6fc9f6dbcef5 | 10:821062fc5782 |
|---|---|
| 1 <tool id="waveica" name="WaveICA" version="@TOOL_VERSION@+galaxy9" profile="23.0"> | 1 <tool id="waveica" name="WaveICA" version="@TOOL_VERSION@+galaxy10" profile="23.0"> |
| 2 <description>removal of batch effects for untargeted metabolomics data</description> | 2 <description>removal of batch effects for untargeted metabolomics data</description> |
| 3 <macros> | 3 <macros> |
| 4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
| 5 </macros> | 5 </macros> |
| 6 <expand macro="annotation"/> | 6 <expand macro="annotation"/> |
| 7 <expand macro="creator"/> | 7 <expand macro="creator"/> |
| 8 | 8 |
| 9 <requirements> | 9 <requirements> |
| 10 <requirement type="package" version="@TOOL_VERSION@">r-recetox-waveica</requirement> | 10 <requirement type="package" version="@TOOL_VERSION@">r-recetox-waveica</requirement> |
| 11 <requirement type="package" version="8.0.0">r-arrow</requirement> | 11 <requirement type="package" version="8.0.0">r-arrow</requirement> |
| 12 <requirement type="package" version="1.0.10">r-dplyr</requirement> | |
| 12 </requirements> | 13 </requirements> |
| 13 <command detect_errors="aggressive"><![CDATA[ | 14 <command detect_errors="aggressive"><![CDATA[ |
| 14 Rscript | 15 Rscript -e "source('${__tool_directory__}/waveica_wrapper.R'); |
| 15 -e 'source("${__tool_directory__}/waveica_wrapper.R")' | 16 normalized_data <- |
| 16 | 17 #if $batch_correction.mode == 'batchwise': |
| 17 #if $batch_correction.mode == "batchwise": | 18 waveica( |
| 18 -e 'normalized_data <- waveica( | 19 data_matrix_file = '$data_matrix', |
| 19 file = "$input_num.data", | 20 sample_metadata_file = '$sample_metadata', |
| 20 #if $input_num.input_choice == "2": | 21 ft_ext = '$data_matrix.ext', |
| 21 metadata = "$input_num.metadata", | 22 mt_ext = '$sample_metadata.ext', |
| 22 ext = "$input_num.data.ext,$input_num.metadata.ext", | 23 wavelet_filter = '$wf.wavelet_filter', |
| 23 transpose = $input_num.transpose_feature_table, | 24 wavelet_length = '$wf.wavelet_length', |
| 24 #else: | |
| 25 ext = "$input_num.data.ext", | |
| 26 #end if | |
| 27 wavelet_filter = "$wf.wavelet_filter", | |
| 28 wavelet_length = "$wf.wavelet_length", | |
| 29 k = $k, | 25 k = $k, |
| 30 t = $batch_correction.t, | 26 t = $batch_correction.t, |
| 31 t2 = $batch_correction.t2, | 27 t2 = $batch_correction.t2, |
| 32 alpha = $alpha, | 28 alpha = $alpha, |
| 33 exclude_blanks = $exclude_blanks | 29 exclude_blanks = $exclude_blanks, |
| 34 )' | 30 transpose = $transpose_feature_table |
| 35 #else if $batch_correction.mode == "single_batch": | 31 ) |
| 36 -e 'normalized_data <- waveica_singlebatch( | 32 #else: |
| 37 file = "$input_num.data", | 33 waveica_singlebatch( |
| 38 #if $input_num.input_choice == "2": | 34 data_matrix_file = '$data_matrix', |
| 39 metadata = "$input_num.metadata", | 35 sample_metadata_file = '$sample_metadata', |
| 40 ext = "$input_num.data.ext,$input_num.metadata.ext", | 36 ft_ext = '$data_matrix.ext', |
| 41 transpose = $input_num.transpose_feature_table, | 37 mt_ext = '$sample_metadata.ext', |
| 42 #else: | 38 wavelet_filter = '$wf.wavelet_filter', |
| 43 ext = "$input_num.data.ext", | 39 wavelet_length = '$wf.wavelet_length', |
| 44 #end if | |
| 45 wavelet_filter = "$wf.wavelet_filter", | |
| 46 wavelet_length = "$wf.wavelet_length", | |
| 47 k = $k, | 40 k = $k, |
| 48 alpha = $alpha, | 41 alpha = $alpha, |
| 49 cutoff = $batch_correction.cutoff, | 42 cutoff = $batch_correction.cutoff, |
| 50 exclude_blanks = $exclude_blanks | 43 exclude_blanks = $exclude_blanks |
| 51 )' | 44 transpose = $transpose_feature_table |
| 52 #end if | 45 ) |
| 53 | 46 #end if |
| 54 -e 'store_data(normalized_data, "$normalized_data", "$metadata", "$input_num.data.ext", $keep_two_output)' | 47 ;store_data(normalized_data, '$normalized_data', '$data_matrix.ext')" |
| 55 ]]></command> | 48 ]]></command> |
| 56 | 49 |
| 57 <inputs> | 50 <inputs> |
| 58 <conditional name="input_num"> | 51 <param name="data_matrix" type="data" label="Feature table" format="csv,tsv,tabular,parquet" help="Table of measured features for each sample."/> |
| 59 <param name="input_choice" type="select" label="Choose input files:"> | 52 <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." /> |
| 60 <option value="1" selected="true">1: intensity-by-feature table with metadata</option> | 53 <param name = "transpose_feature_table" label="Transpose feature table" type="boolean" checked="false" |
| 61 <option value="2">2: intensity-by-feature table and metadata table separately</option> | |
| 62 </param> | |
| 63 <when value="1"> | |
| 64 <expand macro="input_data"/> | |
| 65 </when> | |
| 66 <when value="2"> | |
| 67 <expand macro="input_data"/> | |
| 68 <param name="metadata" label="Input metadata" type="data" format="csv,tsv,tabular,parquet" help="" /> | |
| 69 <param name = "transpose_feature_table" label="Transpose feature table" type="boolean" checked="false" | |
| 70 truevalue="TRUE" falsevalue="FALSE" help="Swap sample names with feature names as column headers (to fit recetox-aplcms outputs)." /> | 54 truevalue="TRUE" falsevalue="FALSE" help="Swap sample names with feature names as column headers (to fit recetox-aplcms outputs)." /> |
| 71 </when> | |
| 72 </conditional> | |
| 73 <param type="integer" value="20" name="k" label="Number of components to decompose" help="maximal component that ICA decomposes"/> | 55 <param type="integer" value="20" name="k" label="Number of components to decompose" help="maximal component that ICA decomposes"/> |
| 74 <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"/> | 56 <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"/> |
| 75 <expand macro="wf"/> | 57 <expand macro="wf"/> |
| 76 <conditional name="batch_correction"> | 58 <conditional name="batch_correction"> |
| 77 <param name="mode" type="select" label="Batch correction mode" help="'multiple batches' takes into account | 59 <param name="mode" type="select" label="Batch correction mode" help="'multiple batches' takes into account |
| 87 <when value="single_batch"> | 69 <when value="single_batch"> |
| 88 <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"/> | 70 <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"/> |
| 89 </when> | 71 </when> |
| 90 </conditional> | 72 </conditional> |
| 91 <param name="exclude_blanks" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Remove blanks" help="Excludes blank samples from the output" /> | 73 <param name="exclude_blanks" type="boolean" checked="false" truevalue="TRUE" falsevalue="FALSE" label="Remove blanks" help="Excludes blank samples from the output" /> |
| 92 <expand macro="split_output"/> | |
| 93 </inputs> | 74 </inputs> |
| 94 | 75 |
| 95 <expand macro="outputs"/> | 76 <expand macro="outputs"/> |
| 96 | 77 |
| 97 <tests> | 78 <tests> |
| 98 <test expect_num_outputs="1"><!-- TEST 1 --> | 79 <test><!-- TEST 1: CSV input --> |
| 99 <conditional name="input_num"> | 80 <param name="data_matrix" value="data_matrix.csv" ftype="csv"/> |
| 100 <param name="data" value="input_data.csv" ftype="csv"/> | 81 <param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/> |
| 82 <param name="alpha" value="0"/> | |
| 83 <param name="k" value="20"/> | |
| 84 <conditional name="wf"> | |
| 85 <param name="wavelet_filter" value="d"/> | |
| 86 <param name="wavelet_length" value="2"/> | |
| 101 </conditional> | 87 </conditional> |
| 88 <conditional name="batch_correction"> | |
| 89 <param name="mode" value="batchwise"/> | |
| 90 <param name="t" value="0.05"/> | |
| 91 <param name="t2" value="0.05"/> | |
| 92 </conditional> | |
| 93 <output name="normalized_data" file="test1_output.csv" ftype="csv"/> | |
| 94 </test> | |
| 95 <test><!-- TEST 2: TSV input --> | |
| 96 <param name="data_matrix" value="data_matrix.tsv" ftype="tabular"/> | |
| 97 <param name="sample_metadata" value="sample_metadata.tsv" ftype="tabular"/> | |
| 102 <param name="alpha" value="0"/> | 98 <param name="alpha" value="0"/> |
| 103 <param name="k" value="20"/> | 99 <param name="k" value="20"/> |
| 104 <conditional name="wf"> | 100 <conditional name="wf"> |
| 105 <param name="wavelet_filter" value="d"/> | 101 <param name="wavelet_filter" value="d"/> |
| 106 <param name="wavelet_length" value="2"/> | 102 <param name="wavelet_length" value="2"/> |
| 110 <param name="t" value="0.05"/> | 106 <param name="t" value="0.05"/> |
| 111 <param name="t2" value="0.05"/> | 107 <param name="t2" value="0.05"/> |
| 112 </conditional> | 108 </conditional> |
| 113 <output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/> | 109 <output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/> |
| 114 </test> | 110 </test> |
| 115 <test expect_num_outputs="1"><!-- TEST 2 --> | 111 <test><!-- TEST 3: Parquet input --> |
| 116 <conditional name="input_num"> | 112 <param name="data_matrix" value="data_matrix.parquet" ftype="parquet"/> |
| 117 <param name="data" value="input_data.tsv" ftype="tsv"/> | 113 <param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/> |
| 118 </conditional> | |
| 119 <param name="alpha" value="0"/> | 114 <param name="alpha" value="0"/> |
| 120 <param name="k" value="20"/> | 115 <param name="k" value="20"/> |
| 121 <conditional name="wf"> | 116 <conditional name="wf"> |
| 122 <param name="wavelet_filter" value="d"/> | 117 <param name="wavelet_filter" value="d"/> |
| 123 <param name="wavelet_length" value="2"/> | 118 <param name="wavelet_length" value="2"/> |
| 125 <conditional name="batch_correction"> | 120 <conditional name="batch_correction"> |
| 126 <param name="mode" value="batchwise"/> | 121 <param name="mode" value="batchwise"/> |
| 127 <param name="t" value="0.05"/> | 122 <param name="t" value="0.05"/> |
| 128 <param name="t2" value="0.05"/> | 123 <param name="t2" value="0.05"/> |
| 129 </conditional> | 124 </conditional> |
| 130 <output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/> | 125 <output name="normalized_data" file="test3_output.parquet" compare="sim_size" delta="200" ftype="parquet"/> |
| 131 </test> | 126 </test> |
| 132 <test expect_num_outputs="1"><!-- TEST 3 --> | 127 <test expect_failure="true"><!-- TEST 4: NA data should fail --> |
| 133 <conditional name="input_num"> | 128 <param name="data_matrix" value="na_data.csv" ftype="csv"/> |
| 134 <param name="data" value="input_data.parquet" ftype="parquet"/> | 129 <param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/> |
| 135 </conditional> | |
| 136 <param name="k" value="20"/> | |
| 137 <param name="alpha" value="0"/> | |
| 138 <conditional name="wf"> | |
| 139 <param name="wavelet_filter" value="d"/> | |
| 140 <param name="wavelet_length" value="2"/> | |
| 141 </conditional> | |
| 142 <conditional name="batch_correction"> | |
| 143 <param name="mode" value="batchwise"/> | |
| 144 <param name="t" value="0.05"/> | |
| 145 <param name="t2" value="0.05"/> | |
| 146 </conditional> | |
| 147 <output name="normalized_data" file="normalized_data.parquet" ftype="parquet"/> | |
| 148 </test> | 130 </test> |
| 149 <test expect_num_outputs="1"><!-- TEST 4 --> | 131 <test expect_failure="true"><!-- TEST 5: Incomplete metadata should fail --> |
| 150 <conditional name="input_num"> | 132 <param name="data_matrix" value="data_matrix.csv" ftype="csv"/> |
| 151 <param name="input_choice" value="2"/> | 133 <param name="sample_metadata" value="incomplete_metadata_data.csv" ftype="csv"/> |
| 152 <param name="data" value="feature_table.csv" ftype="csv"/> | |
| 153 <param name="metadata" value="metadata.csv" ftype="csv"/> | |
| 154 </conditional> | |
| 155 <param name="alpha" value="0"/> | |
| 156 <param name="k" value="20"/> | |
| 157 <conditional name="wf"> | |
| 158 <param name="wavelet_filter" value="d"/> | |
| 159 <param name="wavelet_length" value="2"/> | |
| 160 </conditional> | |
| 161 <conditional name="batch_correction"> | |
| 162 <param name="mode" value="batchwise"/> | |
| 163 <param name="t" value="0.05"/> | |
| 164 <param name="t2" value="0.05"/> | |
| 165 </conditional> | |
| 166 <output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/> | |
| 167 </test> | 134 </test> |
| 168 <test expect_num_outputs="1"><!-- TEST 5 --> | 135 |
| 169 <conditional name="input_num"> | 136 <test><!-- TEST 6 --> |
| 170 <param name="input_choice" value="2"/> | 137 <param name="data_matrix" value="feature_table_transpose_version.parquet" ftype="parquet"/> |
| 171 <param name="data" value="feature_table.tsv" ftype="tabular"/> | 138 <param name="sample_metadata" value="sample_metadata.parquet" ftype="parquet"/> |
| 172 <param name="metadata" value="metadata.tsv" ftype="tabular"/> | 139 <param name="transpose_feature_table" value="TRUE"/> |
| 173 </conditional> | |
| 174 <output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/> | |
| 175 </test> | |
| 176 <test expect_num_outputs="1"><!-- TEST 6 --> | |
| 177 <conditional name="input_num"> | |
| 178 <param name="input_choice" value="2"/> | |
| 179 <param name="data" value="feature_table.parquet" ftype="parquet"/> | |
| 180 <param name="metadata" value="metadata.csv" ftype="csv"/> | |
| 181 </conditional> | |
| 182 <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200" ftype="parquet"/> | 140 <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200" ftype="parquet"/> |
| 183 </test> | 141 </test> |
| 184 <test expect_num_outputs="1"><!-- TEST 7 --> | 142 <test><!-- TEST 7 --> |
| 185 <conditional name="input_num"> | 143 <param name="data_matrix" value="feature_table_transpose_version.csv" ftype="csv"/> |
| 186 <param name="input_choice" value="2"/> | 144 <param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/> |
| 187 <param name="data" value="feature_table_transpose_version.parquet" ftype="parquet"/> | 145 <param name="transpose_feature_table" value="TRUE"/> |
| 188 <param name="metadata" value="metadata.parquet" ftype="parquet"/> | 146 <output name="normalized_data" file="normalized_data.csv" ftype="csv"/> |
| 189 <param name="transpose_feature_table" value="TRUE"/> | |
| 190 </conditional> | |
| 191 <output name="normalized_data" file="normalized_data.parquet" compare="sim_size" delta="200" ftype="parquet"/> | |
| 192 </test> | 147 </test> |
| 193 <test expect_num_outputs="1"><!-- TEST 8 --> | 148 <test><!-- TEST 8 --> |
| 194 <conditional name="input_num"> | 149 <param name="data_matrix" value="feature_table_transpose_version.parquet" ftype="parquet"/> |
| 195 <param name="input_choice" value="2"/> | 150 <param name="sample_metadata" value="sample_metadata.parquet" ftype="parquet"/> |
| 196 <param name="data" value="feature_table_transpose_version.csv" ftype="csv"/> | 151 <param name="transpose_feature_table" value="TRUE"/> |
| 197 <param name="metadata" value="metadata.csv" ftype="csv"/> | 152 <output name="normalized_data" file="test9_output1.parquet" ftype="parquet"/> |
| 198 <param name="transpose_feature_table" value="TRUE"/> | |
| 199 </conditional> | |
| 200 <output name="normalized_data" file="normalized_data.tsv" ftype="tabular"/> | |
| 201 </test> | 153 </test> |
| 202 <test expect_num_outputs="2"><!-- TEST 9 --> | 154 <test><!-- TEST 9 --> |
| 203 <conditional name="input_num"> | 155 <param name="data_matrix" value="feature_table_transpose_version.csv" ftype="csv"/> |
| 204 <param name="input_choice" value="2"/> | 156 <param name="sample_metadata" value="sample_metadata.csv" ftype="csv"/> |
| 205 <param name="data" value="feature_table_transpose_version.parquet" ftype="parquet"/> | 157 <param name="transpose_feature_table" value="TRUE"/> |
| 206 <param name="metadata" value="metadata.parquet" ftype="parquet"/> | 158 <output name="normalized_data" file="test10_output1.csv" ftype="csv"/> |
| 207 <param name="transpose_feature_table" value="TRUE"/> | |
| 208 </conditional> | |
| 209 <param name="keep_two_output" value="TRUE"/> | |
| 210 <output name="normalized_data" file="test9_output1.parquet" ftype="parquet"/> | |
| 211 <output name="metadata" file="test9_output2.parquet" ftype="parquet"/> | |
| 212 </test> | |
| 213 <test expect_num_outputs="2"><!-- TEST 10 --> | |
| 214 <conditional name="input_num"> | |
| 215 <param name="input_choice" value="2"/> | |
| 216 <param name="data" value="feature_table_transpose_version.csv" ftype="csv"/> | |
| 217 <param name="metadata" value="metadata.csv" ftype="csv"/> | |
| 218 <param name="transpose_feature_table" value="TRUE"/> | |
| 219 </conditional> | |
| 220 <param name="keep_two_output" value="TRUE"/> | |
| 221 <output name="normalized_data" file="test10_output1.tsv" ftype="tabular"/> | |
| 222 <output name="metadata" file="test10_output2.tsv" ftype="tabular"/> | |
| 223 </test> | |
| 224 <test expect_failure="true"><!-- TEST 11 --> | |
| 225 <conditional name="input_num"> | |
| 226 <param name="data" value="na_data.csv" ftype="csv"/> | |
| 227 </conditional> | |
| 228 </test> | |
| 229 <test expect_failure="true"><!-- TEST 12 --> | |
| 230 <conditional name="input_num"> | |
| 231 <param name="data" value="incomplete_metadata_data.csv" ftype="csv"/> | |
| 232 </conditional> | |
| 233 </test> | 159 </test> |
| 234 </tests> | 160 </tests> |
| 235 | 161 |
| 236 <help> | 162 <help> |
| 237 <