comparison msi_filtering.xml @ 2:22db5eb94e50 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_filtering commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
author galaxyp
date Mon, 28 May 2018 12:36:24 -0400
parents 98c101b19f3c
children d51c3c814d57
comparison
equal deleted inserted replaced
1:98c101b19f3c 2:22db5eb94e50
1 <tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.7.0.1"> 1 <tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.0">
2 <description>tool for filtering mass spectrometry imaging data</description> 2 <description>tool for filtering mass spectrometry imaging data</description>
3 <requirements> 3 <requirements>
4 <requirement type="package" version="1.7.0">bioconductor-cardinal</requirement> 4 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
5 <requirement type="package" version="2.2.1">r-gridextra</requirement> 5 <requirement type="package" version="2.2.1">r-gridextra</requirement>
6 </requirements> 6 </requirements>
7 <command detect_errors="exit_code"> 7 <command detect_errors="exit_code">
8 <![CDATA[ 8 <![CDATA[
9 9
10 #if $infile.ext == 'imzml' 10 #if $infile.ext == 'imzml'
11 cp '${infile.extra_files_path}/imzml' infile.imzML && 11 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
12 cp '${infile.extra_files_path}/ibd' infile.ibd && 12 ln -s '${infile.extra_files_path}/ibd' infile.ibd &&
13 #elif $infile.ext == 'analyze75' 13 #elif $infile.ext == 'analyze75'
14 cp '${infile.extra_files_path}/hdr' infile.hdr && 14 ln -s '${infile.extra_files_path}/hdr' infile.hdr &&
15 cp '${infile.extra_files_path}/img' infile.img && 15 ln -s '${infile.extra_files_path}/img' infile.img &&
16 cp '${infile.extra_files_path}/t2m' infile.t2m && 16 ln -s '${infile.extra_files_path}/t2m' infile.t2m &&
17 #else 17 #else
18 ln -s $infile infile.RData && 18 ln -s $infile infile.RData &&
19 #end if 19 #end if
20 cat '${MSI_subsetting}' && 20 cat '${MSI_subsetting}' &&
21 echo ${MSI_subsetting} && 21 echo ${MSI_subsetting} &&
25 </command> 25 </command>
26 <configfiles> 26 <configfiles>
27 <configfile name="MSI_subsetting"><![CDATA[ 27 <configfile name="MSI_subsetting"><![CDATA[
28 28
29 29
30 ################################# load libraries and read file ######################### 30 ################################# load libraries and read file #################
31 31
32 32
33 library(Cardinal) 33 library(Cardinal)
34 library(gridExtra) 34 library(gridExtra)
35 35
36 ## Read MALDI Imaging dataset
37
38 #if $infile.ext == 'imzml' 36 #if $infile.ext == 'imzml'
39 msidata = readMSIData('infile.imzML') 37 msidata = readImzML('infile')
40 #elif $infile.ext == 'analyze75' 38 #elif $infile.ext == 'analyze75'
41 msidata = readMSIData('infile.hdr') 39 msidata = readAnalyze('infile')
42 #else 40 #else
43 load('infile.RData') 41 load('infile.RData')
44 #end if 42 #end if
45 43
46 ###################################### inputfile properties in numbers ###################### 44 ##################################### QC: inputfile properties in numbers ######
47 45
48 #if $outputs.outputs_select == "quality_control": 46 #if $outputs.outputs_select == "quality_control":
49 ## Number of features (mz) 47 ## Number of features (mz)
50 maxfeatures = length(features(msidata)) 48 maxfeatures = length(features(msidata))
51 ## Range mz 49 ## Range mz
73 ## Store features for QC plot 71 ## Store features for QC plot
74 featuresinfile = mz(msidata) 72 featuresinfile = mz(msidata)
75 #end if 73 #end if
76 74
77 75
78 ###################################### filtering of pixels ###################### 76 ###################################### Filtering of pixels #####################
77
78 ### Pixels in the one column format "x=,y="
79 79
80 #if str($pixels_cond.pixel_filtering) == "single_column": 80 #if str($pixels_cond.pixel_filtering) == "single_column":
81 print("single column") 81 print("single column")
82 82
83 #if $pixels_cond.single_pixels:
84 input_list = read.delim("$pixels_cond.single_pixels", header = FALSE, stringsAsFactors = FALSE) 83 input_list = read.delim("$pixels_cond.single_pixels", header = FALSE, stringsAsFactors = FALSE)
85 numberpixels = length(input_list[,$pixels_cond.pixel_column]) 84 numberpixels = length(input_list[,$pixels_cond.pixel_column])
86 valid_entries = input_list[,$pixels_cond.pixel_column] %in% names(pixels(msidata)) 85 valid_entries = input_list[,$pixels_cond.pixel_column] %in% names(pixels(msidata))
87 validpixels = sum(valid_entries) 86 validpixels = sum(valid_entries)
88 87
89 if (validpixels != 0) 88 if (validpixels != 0)
90 { 89 {
91 pixelsofinterest = pixels(msidata)[names(pixels(msidata)) %in% input_list[valid_entries,$pixels_cond.pixel_column]] 90 pixelsofinterest = pixels(msidata)[names(pixels(msidata)) %in% input_list[valid_entries,$pixels_cond.pixel_column]]
92 msidata = msidata[,pixelsofinterest] 91 msidata = msidata[,pixelsofinterest]
93 }else{ 92 }else{
93 msidata = msidata[,0]
94 validpixels=0 94 validpixels=0
95 } 95 }
96 96
97 #else 97
98 validpixels=0 98 ### Pixels in two columns format: x and y in different columns
99 numberpixels = 0
100 #end if
101 99
102 #elif str($pixels_cond.pixel_filtering) == "two_columns": 100 #elif str($pixels_cond.pixel_filtering) == "two_columns":
103 print("two columns") 101 print("two columns")
104
105 #if $pixels_cond.two_columns_pixel:
106 102
107 input_list = read.delim("$pixels_cond.two_columns_pixel", header = FALSE, 103 input_list = read.delim("$pixels_cond.two_columns_pixel", header = FALSE,
108 stringsAsFactors = FALSE) 104 stringsAsFactors = FALSE)
109 numberpixels = length(input_list[,$pixels_cond.pixel_column_x]) 105 numberpixels = length(input_list[,$pixels_cond.pixel_column_x])
110 106
130 msidata = msidata[,pixelsofinterest] 126 msidata = msidata[,pixelsofinterest]
131 }else{ 127 }else{
132 validpixels=0 128 validpixels=0
133 } 129 }
134 130
135 131
136 #else 132 ### Pixels wihin x and y minima and maxima are kept:
137 validpixels=0
138 numberpixels = 0
139 #end if
140 133
141 #elif str($pixels_cond.pixel_filtering) == "pixel_range": 134 #elif str($pixels_cond.pixel_filtering) == "pixel_range":
142 print("pixel range") 135 print("pixel range")
143 136
144 numberpixels = "range" 137 numberpixels = "range"
145 validpixels = "range" 138 validpixels = "range"
146 139
147 if (sum(coord(msidata)\$x <= $pixels_cond.max_x_range & coord(msidata)\$x >= $pixels_cond.min_x_range) > 0) 140 ## only filter pixels if at least one pixel will be left
141
142 if (sum(coord(msidata)\$x <= $pixels_cond.max_x_range & coord(msidata)\$x >= $pixels_cond.min_x_range) > 0 & sum(coord(msidata)\$y <= $pixels_cond.max_y_range & coord(msidata)\$y >= $pixels_cond.min_y_range) > 0)
148 { 143 {
149 msidata = msidata[, coord(msidata)\$x <= $pixels_cond.max_x_range & coord(msidata)\$x >= $pixels_cond.min_x_range] 144 msidata = msidata[, coord(msidata)\$x <= $pixels_cond.max_x_range & coord(msidata)\$x >= $pixels_cond.min_x_range]
150 }
151
152 if (sum(coord(msidata)\$y <= $pixels_cond.max_y_range & coord(msidata)\$y >= $pixels_cond.min_y_range) > 0)
153 {
154 msidata = msidata[, coord(msidata)\$y <= $pixels_cond.max_y_range & coord(msidata)\$y >= $pixels_cond.min_y_range] 145 msidata = msidata[, coord(msidata)\$y <= $pixels_cond.max_y_range & coord(msidata)\$y >= $pixels_cond.min_y_range]
146 }else{
147 msidata = msidata[,0]
148 print("no valid pixel found")
155 } 149 }
156 150
157 151
158 152
159 #elif str($pixels_cond.pixel_filtering) == "none": 153 #elif str($pixels_cond.pixel_filtering) == "none":
165 159
166 160
167 161
168 ###################################### filtering of features ###################### 162 ###################################### filtering of features ######################
169 163
164 ### Tabular file contains mz either as numbers or in the format mz=800.01
165
170 #if str($features_cond.features_filtering) == "features_list": 166 #if str($features_cond.features_filtering) == "features_list":
171
172 print("feature list") 167 print("feature list")
173 168
174 input_features = read.delim("$inputfeatures", header = FALSE, stringsAsFactors = FALSE) 169 input_features = read.delim("$inputfeatures", header = FALSE, stringsAsFactors = FALSE)
175 170
176 startingrow = $features_cond.feature_header+1 171 startingrow = $features_cond.feature_header+1
177 extracted_features = input_features[startingrow:nrow(input_features),$features_cond.feature_column] 172 extracted_features = input_features[startingrow:nrow(input_features),$features_cond.feature_column]
178 numberfeatures = length(extracted_features) 173 numberfeatures = length(extracted_features)
179 174
180
181 if (grepl("m/z = ", input_features[startingrow,$features_cond.feature_column])==FALSE) 175 if (grepl("m/z = ", input_features[startingrow,$features_cond.feature_column])==FALSE)
182 176
183 { print("no m/z = in data") 177 ### if input is in numeric format
178 {
184 179
185 if (class(extracted_features) == "numeric") 180 if (class(extracted_features) == "numeric")
186 { 181 {
187 charactervector = rep("m/z = ", numberfeatures) 182 charactervector = rep("m/z = ", numberfeatures)
188 mz_added = paste0(charactervector, round(extracted_features,digits=2)) 183 mz_added = paste0(charactervector, round(extracted_features,digits=2))
189 validfeatures = mz_added %in% names(features(msidata)) 184 validfeatures = mz_added %in% names(features(msidata))
190 featuresofinterest = features(msidata)[names(features(msidata)) %in% mz_added[validfeatures]] 185 featuresofinterest = features(msidata)[names(features(msidata)) %in% mz_added[validfeatures]]
186 validmz = sum(validfeatures)
191 }else{ 187 }else{
192 validfeatures = 0 188 validmz = 0
193 featuresofinterest = features(msidata) 189 featuresofinterest = 0
194 } 190 }
191
192 ### if input is already in character format (m/z = 800.01)
193
195 }else{ 194 }else{
196 validfeatures = extracted_features %in% names(features(msidata)) 195 validfeatures = extracted_features %in% names(features(msidata))
197 featuresofinterest = features(msidata)[names(features(msidata)) %in% extracted_features[validfeatures]] 196 featuresofinterest = features(msidata)[names(features(msidata)) %in% extracted_features[validfeatures]]
197 validmz = sum(validfeatures)
198 } 198 }
199 199
200 ### filter msidata for valid features
200 msidata = msidata[featuresofinterest,] 201 msidata = msidata[featuresofinterest,]
201 202
202 203
204 ### Only features within a given minimum and maximum value are kept:
203 205
204 #elif str($features_cond.features_filtering) == "features_range": 206 #elif str($features_cond.features_filtering) == "features_range":
205
206 print("feature range") 207 print("feature range")
207 208
208 numberfeatures = "range" 209 numberfeatures = "range"
209 validfeatures = NA 210 validmz = "range"
210 211
211 if (sum(mz(msidata) >= $features_cond.min_mz & mz(msidata) <= $features_cond.max_mz)> 0) 212 if (sum(mz(msidata) >= $features_cond.min_mz & mz(msidata) <= $features_cond.max_mz)> 0)
212 { 213 {
213 msidata = msidata[mz(msidata) >= $features_cond.min_mz & mz(msidata) <= $features_cond.max_mz,] 214 msidata = msidata[mz(msidata) >= $features_cond.min_mz & mz(msidata) <= $features_cond.max_mz,]
215 }else{
216 msidata = msidata[0,]
217 print("no valid mz range")
214 } 218 }
215 219
216 220
217 #elif str($features_cond.features_filtering) == "none": 221 #elif str($features_cond.features_filtering) == "none":
218 222
219 print("no feature filtering") 223 print("no feature filtering")
220 validfeatures = 0 224 validmz = 0
221 numberfeatures = 0 225 numberfeatures = 0
222 #end if 226 #end if
223 227
224 228
225 229
226 # save msidata as Rfile 230 # save msidata as Rfile
227 save(msidata, file="$msidata_filtered") 231 save(msidata, file="$msidata_filtered")
228 232
229 ###################################### outputfile properties in numbers ###################### 233 ###################################### outputfile properties in numbers ########
230 234
231 #if $outputs.outputs_select == "quality_control": 235 #if $outputs.outputs_select == "quality_control":
232 236
233 ## Number of features (mz) 237 ## Number of features (mz)
234 maxfeatures2 = length(features(msidata)) 238 maxfeatures2 = length(features(msidata))
285 paste0(minimumy2, " - ", maximumy2), 289 paste0(minimumy2, " - ", maximumy2),
286 paste0(percpeaks2, " %"), 290 paste0(percpeaks2, " %"),
287 paste0(medint2), 291 paste0(medint2),
288 paste0(NumemptyTIC2), 292 paste0(NumemptyTIC2),
289 paste0("valid pixels: ", validpixels), 293 paste0("valid pixels: ", validpixels),
290 paste0("valid mz: ", sum(validfeatures))) 294 paste0("valid mz: ", validmz))
291 295
292 296
293 property_df = data.frame(properties, before, filtered) 297 property_df = data.frame(properties, before, filtered)
294 298
295 299
296 300
297 ######################################## PDF QC ############################################# 301 ######################################## PDF QC ################################
298 302
299 pdf("filtertool_QC.pdf", fonts = "Times", pointsize = 12) 303 pdf("filtertool_QC.pdf", fonts = "Times", pointsize = 12)
300 plot(0,type='n',axes=FALSE,ann=FALSE) 304 plot(0,type='n',axes=FALSE,ann=FALSE)
301 305
302 title(main=paste0("Qualitycontrol of filtering tool for file: \n\n", "$infile.display_name")) 306 title(main=paste0("Qualitycontrol of filtering tool for file: \n\n", "$infile.display_name"))
320 lines(mz(msidata),rep(0.9, length(mz(msidata))), col="green", type="p") 324 lines(mz(msidata),rep(0.9, length(mz(msidata))), col="green", type="p")
321 legend("top", horiz=TRUE, 325 legend("top", horiz=TRUE,
322 legend = c("before", "filtered"), 326 legend = c("before", "filtered"),
323 fill = c("red", "green")) 327 fill = c("red", "green"))
324 328
325
326
327
328 }else{ 329 }else{
329 print("file has no features or pixels left") 330 print("file has no features or pixels left")
330 } 331 }
331 332
332 dev.off() 333 dev.off()
333 334
334 #end if 335 #end if
335 336
336 ######################################## intensity matrix ################################## 337 ######################################## intensity matrix ######################
337 338
338 #if $output_matrix: 339 #if $output_matrix:
339 340
340 if (length(features(msidata))> 0 & length(pixels(msidata)) > 0) 341 if (length(features(msidata))> 0 & length(pixels(msidata)) > 0)
341 { 342 {
356 </configfiles> 357 </configfiles>
357 <inputs> 358 <inputs>
358 <param name="infile" type="data" format="imzml, rdata, analyze75" 359 <param name="infile" type="data" format="imzml, rdata, analyze75"
359 label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" 360 label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
360 help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> 361 help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
361
362 <conditional name="pixels_cond"> 362 <conditional name="pixels_cond">
363 <param name="pixel_filtering" type="select" label="Select pixel filtering option"> 363 <param name="pixel_filtering" type="select" label="Select pixel filtering option">
364 <option value="none" selected="True">none</option> 364 <option value="none" selected="True">none</option>
365 <option value="single_column">tabular file with single column (x = 1, y = 1)</option> 365 <option value="single_column">tabular file with single column (x = 1, y = 1)</option>
366 <option value="two_columns">tabular file with separate columns for x and y values</option> 366 <option value="two_columns">tabular file with separate columns for x and y values</option>
383 <param name="max_x_range" type="integer" value="100" label="Maximum value for x"/> 383 <param name="max_x_range" type="integer" value="100" label="Maximum value for x"/>
384 <param name="min_y_range" type="integer" value="0" label="Minimum value for y"/> 384 <param name="min_y_range" type="integer" value="0" label="Minimum value for y"/>
385 <param name="max_y_range" type="integer" value="100" label="Maximum value for y"/> 385 <param name="max_y_range" type="integer" value="100" label="Maximum value for y"/>
386 </when> 386 </when>
387 </conditional> 387 </conditional>
388
389 <conditional name="features_cond"> 388 <conditional name="features_cond">
390 <param name="features_filtering" type="select" label="Select feature filtering option"> 389 <param name="features_filtering" type="select" label="Select feature filtering option">
391 <option value="none" selected="True">none</option> 390 <option value="none" selected="True">none</option>
392 <option value="features_list">tabular file with features (data type: 800.12 or m/z = 800.12)</option> 391 <option value="features_list">tabular file with features (data type: 800.12 or m/z = 800.12)</option>
393 <option value="features_range">range of features</option> 392 <option value="features_range">range of features</option>
394 </param> 393 </param>
395
396 <when value="none"/> 394 <when value="none"/>
397 <when value="features_list"> 395 <when value="features_list">
398 <param name="inputfeatures" type="data" format="tabular" label="Features for filtering of MSI data" help="tabular file with masses of interest either as numbers (800.05) or in the form m/z = 800.05"/> 396 <param name="inputfeatures" type="data" format="tabular" label="Features for filtering of MSI data" help="tabular file with masses of interest either as numbers (800.05) or in the form m/z = 800.05"/>
399 <param name="feature_column" data_ref="inputfeatures" label="Column with features" type="data_column"/> 397 <param name="feature_column" data_ref="inputfeatures" label="Column with features" type="data_column"/>
400 <param name="feature_header" label="Number of header lines to skip" value="0" type="integer"/> 398 <param name="feature_header" label="Number of header lines to skip" value="0" type="integer"/>
401 </when> 399 </when>
402 <when value="features_range"> 400 <when value="features_range">
403 <param name="min_mz" type="integer" value="1" label="Minimum value for mz (in Dalton)"/> 401 <param name="min_mz" type="float" value="1" label="Minimum value for mz (in Dalton)"/>
404 <param name="max_mz" type="integer" value="100" label="Maximum value for mz (in Dalton)"/> 402 <param name="max_mz" type="float" value="100" label="Maximum value for mz (in Dalton)"/>
405 </when> 403 </when>
406 </conditional> 404 </conditional>
407
408 <conditional name="outputs"> 405 <conditional name="outputs">
409 <param name="outputs_select" type="select" label="Quality control output"> 406 <param name="outputs_select" type="select" label="Quality control output">
410 <option value="quality_control" selected="True">yes</option> 407 <option value="quality_control" selected="True">yes</option>
411 <option value="no_quality_control">no</option> 408 <option value="no_quality_control">no</option>
412 </param> 409 </param>
421 <outputs> 418 <outputs>
422 <data format="rdata" name="msidata_filtered" label="${tool.name} ${on_string}"/> 419 <data format="rdata" name="msidata_filtered" label="${tool.name} ${on_string}"/>
423 <data format="pdf" name="filtering_qc" from_work_dir="filtertool_QC.pdf" label = "QC ${tool.name} ${on_string}"> 420 <data format="pdf" name="filtering_qc" from_work_dir="filtertool_QC.pdf" label = "QC ${tool.name} ${on_string}">
424 <filter>outputs["outputs_select"] == "quality_control"</filter> 421 <filter>outputs["outputs_select"] == "quality_control"</filter>
425 </data> 422 </data>
426 <data format="tabular" name="matrixasoutput" label="Matrix ${tool.name} on ${on_string}"> 423 <data format="tabular" name="matrixasoutput" label="Matrix ${tool.name} ${on_string}">
427 <filter>output_matrix</filter> 424 <filter>output_matrix</filter>
428 </data> 425 </data>
429 </outputs> 426 </outputs>
430
431 <tests> 427 <tests>
432 <test expect_num_outputs="2"> 428 <test expect_num_outputs="2">
433 <param name="infile" value="" ftype="imzml"> 429 <param name="infile" value="" ftype="imzml">
434 <composite_data value="Example_Continuous.imzML"/> 430 <composite_data value="Example_Continuous.imzML"/>
435 <composite_data value="Example_Continuous.ibd"/> 431 <composite_data value="Example_Continuous.ibd"/>
451 <param name="infile" value="" ftype="imzml"> 447 <param name="infile" value="" ftype="imzml">
452 <composite_data value="Example_Continuous.imzML"/> 448 <composite_data value="Example_Continuous.imzML"/>
453 <composite_data value="Example_Continuous.ibd"/> 449 <composite_data value="Example_Continuous.ibd"/>
454 </param> 450 </param>
455 <param name="pixel_filtering" value="pixel_range"/> 451 <param name="pixel_filtering" value="pixel_range"/>
456 <param name="min_x_range" value="0"/> 452 <param name="min_x_range" value="10"/>
457 <param name="max_x_range" value="10"/> 453 <param name="max_x_range" value="20"/>
458 <param name="min_y_range" value="2"/> 454 <param name="min_y_range" value="2"/>
459 <param name="max_y_range" value="2"/> 455 <param name="max_y_range" value="2"/>
460 <param name="outputs_select" value="quality_control"/> 456 <param name="outputs_select" value="quality_control"/>
461 <param name="inputmz" value="328.9"/> 457 <param name="inputmz" value="328.9"/>
462 <param name="plusminus_dalton" value="0.25"/> 458 <param name="plusminus_dalton" value="0.25"/>
467 <param name="infile" value="" ftype="imzml"> 463 <param name="infile" value="" ftype="imzml">
468 <composite_data value="Example_Continuous.imzML"/> 464 <composite_data value="Example_Continuous.imzML"/>
469 <composite_data value="Example_Continuous.ibd"/> 465 <composite_data value="Example_Continuous.ibd"/>
470 </param> 466 </param>
471 <param name="pixel_filtering" value="pixel_range"/> 467 <param name="pixel_filtering" value="pixel_range"/>
472 <param name="min_x_range" value="0"/> 468 <param name="min_x_range" value="1"/>
473 <param name="max_x_range" value="10"/> 469 <param name="max_x_range" value="20"/>
474 <param name="min_y_range" value="2"/> 470 <param name="min_y_range" value="2"/>
475 <param name="max_y_range" value="2"/> 471 <param name="max_y_range" value="2"/>
476 <param name="features_filtering" value="features_range"/> 472 <param name="features_filtering" value="features_range"/>
477 <param name="min_mz" value="200" /> 473 <param name="min_mz" value="0" />
478 <param name="max_mz" value="500"/> 474 <param name="max_mz" value="500"/>
479 <param name="outputs_select" value="quality_control"/> 475 <param name="outputs_select" value="quality_control"/>
480 <param name="inputmz" value="328.9"/> 476 <param name="inputmz" value="328.9"/>
481 <param name="plusminus_dalton" value="0.25"/> 477 <param name="plusminus_dalton" value="0.25"/>
482 <param name="output_matrix" value="True"/> 478 <param name="output_matrix" value="True"/>
512 <param name="min_x_range" value="0"/> 508 <param name="min_x_range" value="0"/>
513 <param name="max_x_range" value="10"/> 509 <param name="max_x_range" value="10"/>
514 <param name="min_y_range" value="2"/> 510 <param name="min_y_range" value="2"/>
515 <param name="max_y_range" value="20"/> 511 <param name="max_y_range" value="20"/>
516 <param name="features_filtering" value="features_range"/> 512 <param name="features_filtering" value="features_range"/>
517 <param name="min_mz" value="1" /> 513 <param name="min_mz" value="500" />
518 <param name="max_mz" value="150"/> 514 <param name="max_mz" value="700"/>
519 <param name="outputs_select" value="quality_control"/> 515 <param name="outputs_select" value="quality_control"/>
520 <param name="inputmz" value="328.9"/> 516 <param name="inputmz" value="328.9"/>
521 <param name="plusminus_dalton" value="0.25"/> 517 <param name="plusminus_dalton" value="0.25"/>
522 <output name="filtering_qc" file="imzml_filtered5.pdf" compare="sim_size" delta="20000"/> 518 <output name="filtering_qc" file="imzml_filtered5.pdf" compare="sim_size" delta="20000"/>
523 <output name="msidata_filtered" file="imzml_filtered5.RData" compare="sim_size" /> 519 <output name="msidata_filtered" file="imzml_filtered5.RData" compare="sim_size" />
534 <param name="features_filtering" value="features_list"/> 530 <param name="features_filtering" value="features_list"/>
535 <param name="inputfeatures" ftype="tabular" value = "featuresofinterest2.tabular"/> 531 <param name="inputfeatures" ftype="tabular" value = "featuresofinterest2.tabular"/>
536 <param name="feature_column" value="1"/> 532 <param name="feature_column" value="1"/>
537 <conditional name="outputs"> 533 <conditional name="outputs">
538 <param name="outputs_select" value="quality_control"/> 534 <param name="outputs_select" value="quality_control"/>
539 <param name="inputmz" value="702"/> 535 <param name="inputmz" value="1200"/>
540 <param name="plusminus_dalton" value="0.25"/> 536 <param name="plusminus_dalton" value="0.25"/>
541 </conditional> 537 </conditional>
542 <param name="output_matrix" value="True"/> 538 <param name="output_matrix" value="True"/>
543 <output name="filtering_qc" file="analyze_filtered.pdf" compare="sim_size" delta="20000"/> 539 <output name="filtering_qc" file="analyze_filtered.pdf" compare="sim_size" delta="20000"/>
544 <output name="msidata_filtered" file="analyze_filtered.RData" compare="sim_size" /> 540 <output name="msidata_filtered" file="analyze_filtered.RData" compare="sim_size" />
550 <composite_data value="Analyze75.img"/> 546 <composite_data value="Analyze75.img"/>
551 <composite_data value="Analyze75.t2m"/> 547 <composite_data value="Analyze75.t2m"/>
552 </param> 548 </param>
553 <conditional name="outputs"> 549 <conditional name="outputs">
554 <param name="outputs_select" value="quality_control"/> 550 <param name="outputs_select" value="quality_control"/>
555 <param name="inputmz" value="702"/> 551 <param name="inputmz" value="1200"/>
556 <param name="plusminus_dalton" value="0.25"/> 552 <param name="plusminus_dalton" value="0.25"/>
557 </conditional> 553 </conditional>
558 <output name="filtering_qc" file="analyze75_filtered2.pdf" compare="sim_size" delta="20000"/> 554 <output name="filtering_qc" file="analyze75_filtered2.pdf" compare="sim_size" delta="20000"/>
559 <output name="msidata_filtered" file="analyze_originaloutput2.RData" compare="sim_size" /> 555 <output name="msidata_filtered" file="analyze_filteredoutside.RData" compare="sim_size" />
560 </test> 556 </test>
561 <test expect_num_outputs="2"> 557 <test expect_num_outputs="2">
562 <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/> 558 <param name="infile" value="preprocessed.RData" ftype="rdata"/>
563 <conditional name="outputs"> 559 <conditional name="outputs">
564 <param name="outputs_select" value="no_quality_control"/> 560 <param name="outputs_select" value="no_quality_control"/>
565 </conditional> 561 </conditional>
566 <param name="output_matrix" value="True"/> 562 <param name="output_matrix" value="True"/>
567 <output name="matrixasoutput" file="rdata_matrix.tabular"/> 563 <output name="matrixasoutput" file="rdata_matrix.tabular"/>
569 </test> 565 </test>
570 </tests> 566 </tests>
571 <help> 567 <help>
572 <![CDATA[ 568 <![CDATA[
573 569
574 This tool can filter three types of mass-spectrometry imaging files (see below) for pixels and features of interest. This can be used to keep only pixels in a regions of interest. 570 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. `More information on Cardinal <http://cardinalmsi.org//>`_
575 For filtering at least one valid pixel/feature is needed otherwise no filtering will be performed. It is recommended to use the filtering tool only for feature masses which have been extracted from the same dataset. If you have feature masses from dataset A and you want to use them to filter dataset B, first find the corresponding (closest) features in dataset B by using the tool "Join two files on column allowing a small difference". Afterwards use the corresponding feature masses from dataset B to filter dataset B. 571
572 This tool provides provides options to filter (subset) pixels and masses of mass-spectrometry imaging data.
576 573
577 Input data: 3 types of input data can be used: 574 Input data: 3 types of input data can be used:
578 575
579 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <http://ms-imaging.org/wp/introduction/>`_ 576 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
580 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function) 577 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
581 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData) 578 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData)
582 579
583 The output of this tool is a subsetted Cardinal "MSImageSet" with the variable name "msidata" saved as .RData. 580 Options:
581
582 - pixel filtering: can use a tabular file containing x and y coordinates or by defining a range for x and y by hand
583 - mass filtering: can use a tabular file containing masses of interest or by defining a range for the mass values
584
585 Output:
586
587 - imzML file filtered for pixels and/or masses
588 - optional: pdf with heatmap showing the pixels that are left after filtering and plot of masses before and after filtering
589 - optional: intensity matrix as tabular file (intensities for masses in rows and pixel in columns)
590
591 Tip:
592
593 - It is recommended to use the filtering tool only for masses which have been extracted from the same dataset. If you have masses from dataset A and you want to use them to filter dataset B, first find the corresponding (closest) features in dataset B by using the tool "Join two files on column allowing a small difference". Afterwards use the corresponding feature masses from dataset A to filter dataset B.
594
595
584 ]]> 596 ]]>
585 </help> 597 </help>
586 <citations> 598 <citations>
587 <citation type="doi">10.1093/bioinformatics/btv146</citation> 599 <citation type="doi">10.1093/bioinformatics/btv146</citation>
588 </citations> 600 </citations>