Mercurial > repos > galaxyp > msi_filtering
comparison msi_filtering.xml @ 4:bf61fc662615 draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_filtering commit 37da74ed68228b16efbdbde776e7c38cc06eb5d5
author | galaxyp |
---|---|
date | Tue, 19 Jun 2018 18:07:17 -0400 |
parents | d51c3c814d57 |
children | 3d5ac78fb2b0 |
comparison
equal
deleted
inserted
replaced
3:d51c3c814d57 | 4:bf61fc662615 |
---|---|
1 <tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.1"> | 1 <tool id="mass_spectrometry_imaging_filtering" name="MSI filtering" version="1.10.0.2"> |
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.10.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> |
32 | 32 |
33 library(Cardinal) | 33 library(Cardinal) |
34 library(gridExtra) | 34 library(gridExtra) |
35 | 35 |
36 #if $infile.ext == 'imzml' | 36 #if $infile.ext == 'imzml' |
37 msidata = readImzML('infile') | 37 msidata <- readImzML('infile', mass.accuracy=$accuracy, units.accuracy = "$units") |
38 #elif $infile.ext == 'analyze75' | 38 #elif $infile.ext == 'analyze75' |
39 msidata = readAnalyze('infile') | 39 msidata = readAnalyze('infile') |
40 #else | 40 #else |
41 load('infile.RData') | 41 load('infile.RData') |
42 #end if | 42 #end if |
282 NumemptyTIC2 = sum(TICs2 == 0) | 282 NumemptyTIC2 = sum(TICs2 == 0) |
283 ## median TIC | 283 ## median TIC |
284 medint2 = round(median(TICs2), digits=2) | 284 medint2 = round(median(TICs2), digits=2) |
285 | 285 |
286 properties = c("Number of m/z features", | 286 properties = c("Number of m/z features", |
287 "Range of m/z values [Da]", | 287 "Range of m/z values", |
288 "Number of pixels", | 288 "Number of pixels", |
289 "Range of x coordinates", | 289 "Range of x coordinates", |
290 "Range of y coordinates", | 290 "Range of y coordinates", |
291 "Intensities > 0", | 291 "Intensities > 0", |
292 "Median TIC per pixel", | 292 "Median TIC per pixel", |
328 ### heatmap image as visual pixel control | 328 ### heatmap image as visual pixel control |
329 if (length(features(msidata))> 0 & length(pixels(msidata)) > 0){ | 329 if (length(features(msidata))> 0 & length(pixels(msidata)) > 0){ |
330 image(msidata, mz=$outputs.inputmz, plusminus = $outputs.plusminus_dalton, contrast.enhance = "none", | 330 image(msidata, mz=$outputs.inputmz, plusminus = $outputs.plusminus_dalton, contrast.enhance = "none", |
331 main= paste0($outputs.inputmz," ± ", $outputs.plusminus_dalton, " Da"), ylim = c(maximumy2+0.2*maximumy2,minimumy2-0.2*minimumy2)) | 331 main= paste0($outputs.inputmz," ± ", $outputs.plusminus_dalton, " Da"), ylim = c(maximumy2+0.2*maximumy2,minimumy2-0.2*minimumy2)) |
332 | 332 |
333 ### control features which are left | 333 ### control features which are removed |
334 plot(featuresinfile, rep(1,length(featuresinfile)), yaxt="n", ylab=NA, xlab="m/z values", col="red", ylim=c(0.8, 1.1), main="Distribution of m/z values") | 334 hist(mz(msidata), xlab="m/z", main="Kept m/z values") |
335 lines(mz(msidata),rep(0.9, length(mz(msidata))), col="green", type="p") | 335 #if str($features_cond.features_filtering) == "none": |
336 legend("top", horiz=TRUE, legend = c("before", "filtered"), fill = c("red", "green")) | 336 print("no difference histogram as no m/z filtering took place") |
337 #else: | |
338 hist(setdiff(featuresinfile, mz(msidata)), xlab="m/z", main="Removed m/z values") | |
339 #end if | |
337 }else{ | 340 }else{ |
338 print("file has no features or pixels left")} | 341 print("file has no features or pixels left")} |
339 | 342 |
340 dev.off() | 343 dev.off() |
341 | 344 |
360 </configfiles> | 363 </configfiles> |
361 <inputs> | 364 <inputs> |
362 <param name="infile" type="data" format="imzml,rdata,analyze75" | 365 <param name="infile" type="data" format="imzml,rdata,analyze75" |
363 label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" | 366 label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" |
364 help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> | 367 help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> |
368 <param name="accuracy" type="float" value="50" label="Only for processed imzML files: enter mass accuracy to which the m/z values will be binned" help="This should be set to the native accuracy of the mass spectrometer, if known"/> | |
369 <param name="units" display="radio" type="select" label="Only for processed imzML files: unit of the mass accuracy" help="either m/z or ppm"> | |
370 <option value="mz" >mz</option> | |
371 <option value="ppm" selected="True" >ppm</option> | |
372 </param> | |
365 <conditional name="pixels_cond"> | 373 <conditional name="pixels_cond"> |
366 <param name="pixel_filtering" type="select" label="Select pixel filtering option"> | 374 <param name="pixel_filtering" type="select" label="Select pixel filtering option"> |
367 <option value="none" selected="True">none</option> | 375 <option value="none" selected="True">none</option> |
368 <option value="single_column">tabular file with single column (x = 1, y = 1)</option> | 376 <option value="single_column">tabular file with single column (x = 1, y = 1)</option> |
369 <option value="two_columns">tabular file with separate columns for x and y values</option> | 377 <option value="two_columns">tabular file with separate columns for x and y values</option> |
601 | 609 |
602 | 610 |
603 Output: | 611 Output: |
604 | 612 |
605 - imzML file filtered for pixels and/or m/z | 613 - imzML file filtered for pixels and/or m/z |
606 - optional: pdf with heatmap showing the pixels that are left after filtering and plot of m/z before and after filtering | 614 - optional: pdf with heatmap showing the pixels that are left after filtering and histograms of kept and removed m/z |
607 - optional: intensity matrix as tabular file (intensities for m/z in rows and pixel in columns) | 615 - optional: intensity matrix as tabular file (intensities for m/z in rows and pixel in columns) |
608 | 616 |
609 | 617 |
610 Tip: | 618 Tip: |
611 | 619 |