comparison msi_ion_images.xml @ 8:6cd561bbb7ee draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_ion_images commit 620a469e20836b921b6c0147421c8a4268b66ebd
author galaxyp
date Wed, 15 Aug 2018 05:40:16 -0400
parents db0cf8eb4395
children 3aac627bd3ee
comparison
equal deleted inserted replaced
7:db0cf8eb4395 8:6cd561bbb7ee
1 <tool id="mass_spectrometry_imaging_ion_images" name="MSI ion images" version="1.10.0.3"> 1 <tool id="mass_spectrometry_imaging_ion_images" name="MSI ion images" version="1.10.0.4">
2 <description> 2 <description>
3 mass spectrometry imaging m/z heatmaps 3 mass spectrometry imaging m/z heatmaps
4 </description> 4 </description>
5 <requirements> 5 <requirements>
6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement> 6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
176 176
177 ### only plot images when file has peaks and valid input m/z: 177 ### only plot images when file has peaks and valid input m/z:
178 178
179 if (npeaks > 0){ 179 if (npeaks > 0){
180 if (length(inputmz) != 0){ 180 if (length(inputmz) != 0){
181 for (mass in 1:length(inputmz)){ 181 for (mass in 1:length(inputmz)){
182 182
183 ###standard image 183 ###standard image
184 184
185 #if str($image_cond.image_type) == "standard_image": 185 #if str($image_cond.image_type) == "standard_image":
186 print("standard image") 186 print("standard image")
187 187
188 print(image(msidata, mz=inputmz[mass],plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", 188 print(image(msidata, mz=inputmz[mass],plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast",
189 smooth.image = "$image_smoothing", strip=$strip, colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy), 189 smooth.image = "$image_smoothing", strip=$strip, colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy),
190 main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} 190 main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))}
191 191
192 192
193 ###lattice image 193 ###lattice image
194 194
195 #elif str($image_cond.image_type) == "lattice_image": 195 #elif str($image_cond.image_type) == "lattice_image":
196 print("lattice image") 196 print("lattice image")
197 197
198 #if str($strip) =="TRUE": 198 #if str($strip) =="TRUE":
199 199
200 print(image(msidata, mz=inputmz[mass], strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), 200 print(image(msidata, mz=inputmz[mass], strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)),
201 lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", 201 lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing",
202 colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy), 202 colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy),
203 main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} 203 main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))}
204 204
205 #elif str($strip) =="FALSE": 205 #elif str($strip) =="FALSE":
206 206
207 print(image(msidata, mz=inputmz[mass], strip = $strip, 207 print(image(msidata, mz=inputmz[mass], strip = $strip,
208 lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", 208 lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing",
209 colorkey=$colorkey, 209 colorkey=$colorkey,
210 main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} 210 main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))}
211 211
212 #end if 212 #end if
213 213
214 #end if 214 #end if
215
216 ## optional svg output with original coordinates
217 #if str($svg_cond.svg_pixelimage) == "yes_svg":
218 print("svg pixel image")
219
220 svg(file="svg_pixel_output.svg")
221 par(mar=c(0,0,0,0))
222 image(msidata, mz = inputmz[1],strip=FALSE, ylim=c(maximumy, minimumy), plusminus = $plusminus_dalton,colorkey = FALSE,axes=FALSE, xlab=NA, ylab=NA,contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing")
223 dev.off()
224 #end if
215 225
216 } else {print("The input m/z were invalid")} 226 } else {print("The input m/z were invalid")}
217 dev.off() 227 dev.off()
218 }else{ 228 }else{
219 print("inputfile has no intensities > 0") 229 print("inputfile has no intensities > 0")
220 dev.off() 230 dev.off()
221 } 231 }
232
233
222 ]]></configfile> 234 ]]></configfile>
223 </configfiles> 235 </configfiles>
224 <inputs> 236 <inputs>
225 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" 237 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
226 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> 238 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
260 <option value="lattice_image">lattice</option> 272 <option value="lattice_image">lattice</option>
261 </param> 273 </param>
262 <when value="standard_image"/> 274 <when value="standard_image"/>
263 <when value="lattice_image"/> 275 <when value="lattice_image"/>
264 </conditional> 276 </conditional>
277 <conditional name="svg_cond">
278 <param name="svg_pixelimage" type="select" label="Do you want to export a heatmap with the original coordinates as svg image, the first valid m/z from tabular file is used">
279 <option value="no_svg" selected="True">No svg image export</option>
280 <option value="yes_svg">Export svg image</option>
281 </param>
282 <when value="no_svg"/>
283 <when value="yes_svg"/>
284 </conditional>
265 </inputs> 285 </inputs>
266 <outputs> 286 <outputs>
267 <data format="pdf" name="plots" from_work_dir="heatmaps.pdf" label = "$infile.display_name heatmaps"/> 287 <data format="pdf" name="plots" from_work_dir="heatmaps.pdf" label = "$infile.display_name heatmaps"/>
288 <data format="svg" name="svg_output" from_work_dir="svg_pixel_output.svg" label="$infile.display_name svg">
289 <filter>svg_cond['svg_pixelimage'] == 'yes_svg'</filter>
290 </data>
268 </outputs> 291 </outputs>
269 <tests> 292 <tests>
270 <test> 293 <test>
271 <param name="infile" value="" ftype="imzml"> 294 <param name="infile" value="" ftype="imzml">
272 <composite_data value="Example_Continuous.imzML"/> 295 <composite_data value="Example_Continuous.imzML"/>
291 <param name="plusminus_dalton" value="0.5"/> 314 <param name="plusminus_dalton" value="0.5"/>
292 <param name="filename" value="Testfile_analyze75"/> 315 <param name="filename" value="Testfile_analyze75"/>
293 <param name="image_smoothing" value="gaussian"/> 316 <param name="image_smoothing" value="gaussian"/>
294 <param name="strip" value="False"/> 317 <param name="strip" value="False"/>
295 <param name="colorkey" value="True"/> 318 <param name="colorkey" value="True"/>
319 <conditional name="svg_cond">
320 <param name="svg_pixelimage" value="yes_svg"/>
321 </conditional>
296 <output name="plots" file="Heatmaps_analyze75.pdf" compare="sim_size" delta="20000"/> 322 <output name="plots" file="Heatmaps_analyze75.pdf" compare="sim_size" delta="20000"/>
323 <output name="svg_output" file="analyze75.svg" compare="sim_size" delta="20000"/>
297 </test> 324 </test>
298 <test> 325 <test>
299 <param name="infile" value="preprocessed.rdata" ftype="rdata"/> 326 <param name="infile" value="preprocessed.rdata" ftype="rdata"/>
300 <param name="massfile" value="inputpeptides.tabular" ftype="tabular"/> 327 <param name="massfile" value="inputpeptides.tabular" ftype="tabular"/>
301 <param name="plusminus_dalton" value="0.5"/> 328 <param name="plusminus_dalton" value="0.5"/>
337 - no empty fields or letters are allowed in the first column 364 - no empty fields or letters are allowed in the first column
338 365
339 Output: 366 Output:
340 367
341 - Pdf with the heatmap images 368 - Pdf with the heatmap images
369 - optional svg file of a mass-spectrometry imaging m/z heatmap
342 370
343 Troubleshooting: 371 Troubleshooting:
344 372
345 - no heatmaps are plotted when tabular file doesn't fulfill the criteria described above 373 - no heatmaps are plotted when tabular file doesn't fulfill the criteria described above
346 - no heatmaps are plotted when the input mass spectrometry imaging file has no intensities > 0 374 - no heatmaps are plotted when the input mass spectrometry imaging file has no intensities > 0