# HG changeset patch # User galaxyp # Date 1519910718 18000 # Node ID 845fee459824209d2f7d7df99a3343bb74edf546 # Parent 385e8a4accd99002bc45ca9cd3a16aec6c7bca77 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_ion_images commit edbf2a6cb50fb04d0db56a7557a64e3bb7a0806a diff -r 385e8a4accd9 -r 845fee459824 msi_ion_images.xml --- a/msi_ion_images.xml Mon Nov 27 13:49:35 2017 -0500 +++ b/msi_ion_images.xml Thu Mar 01 08:25:18 2018 -0500 @@ -1,4 +1,4 @@ - + mass spectrometry imaging heatmaps @@ -36,24 +36,13 @@ ## Read MALDI Imaging dataset #if $infile.ext == 'imzml' - msidata <- readMSIData('infile.imzML') + msidata = readMSIData('infile.imzML') #elif $infile.ext == 'analyze75' - msidata <- readMSIData('infile.hdr') + msidata = readMSIData('infile.hdr') #else load('infile.RData') #end if -#if $massfile: - ### Read tabular file with peptide masses for plots and heatmap images: - input_list = read.delim("$massfile", header = FALSE, na.strings=c("","NA", "#NUM!", "#ZAHL!"), stringsAsFactors = FALSE) - if (ncol(input_list) == 1) - { - input_list = cbind(input_list, input_list) - } -#else - input_list = data.frame(0, 0) -#end if -colnames(input_list)[1:2] = c("mz", "name") ###################################### file properties in numbers ###################### @@ -115,12 +104,32 @@ peakpickinginfo=processinginfo@peakPicking } -### calculate how many input masses are valid: -inputmasses = input_list[input_list[,1]>minmz & input_list[,1]minmz & input_list[,1]0) +percentpixels = round(countpixels/pixelcount*100, digits=1) +valuesdataframe = cbind(inputmz, cbind(countpixels, percentpixels)) + + +write.table(valuesdataframe, file="$pixel_count", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\t") + +colnames(input_list)[1:2] = c("mz", "name") properties = c("Number of mz features", "Range of mz values [Da]", "Number of pixels", @@ -136,7 +145,7 @@ "Baseline reduction", "Peak picking", "Centroided", - paste0("# valid masses in ", "$filename")) + paste0("# valid masses in ", "$massfile.display_name")) values = c(paste0(maxfeatures), paste0(minmz, " - ", maxmz), @@ -157,6 +166,9 @@ property_df = data.frame(properties, values) + + + ######################################## PDF ############################################# ########################################################################################## ########################################################################################## @@ -176,15 +188,19 @@ if (npeaks > 0) { + if (length(inputmz) != 0) { + for (mass in 1:length(inputmz)) { - print(image(msidata, mz=inputmz[mass], strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), - lattice=TRUE, ylim = c(maximumy+1,minimumy-1), plusminus = $plusminusinDalton, contrast.enhance = "histogram", - main= paste0(mass, ") ", inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminusinDalton, " Da)"))) + + + print(image(msidata, mz=inputmz[mass], strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), + lattice=TRUE, ylim = c(maximumy+1,minimumy-1), plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", + main= paste0(mass, ") ", inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)"))) } - } else {print("The input masses were outside the mass range")} + } else {print("The input masses were invalid")} dev.off() @@ -198,12 +214,23 @@ - - + + + + + + + + + + + + @@ -211,9 +238,10 @@ - - + + + @@ -223,37 +251,48 @@ - - + + + - - + + - - + + `_ - Analyze7.5 (upload hdr, img and t2m file via the "composite" function) - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData) -The output of this tool contains heatmaps for every ion mass of interest as pdf. +tabular file with masses: +- tab separated file (.tabular), datatype in Galaxy must be tabular (if Galaxy auto-detection was wrong, datatype can be changed by pressing the pen button) +- no empty fields or letters are allowed (tool crashes with empty fields and a single letter prohibits generation of images) +- separate point numbers by point (a single number with comma prohibits generation of images) + +Trouble shooting: +- no heatmaps are plotted when tabular file contains letters or point numbers with commas or when the input MSI file had no intensities > 0 +- contrast enhance functions need masses with intensities > 0 in about 1.5% of all pixels - tool crashes when contrast enhance is used on too few intensities + ]]> diff -r 385e8a4accd9 -r 845fee459824 test-data/Heatmaps_LM8_file16.pdf Binary file test-data/Heatmaps_LM8_file16.pdf has changed diff -r 385e8a4accd9 -r 845fee459824 test-data/Heatmaps_analyze75.pdf Binary file test-data/Heatmaps_analyze75.pdf has changed diff -r 385e8a4accd9 -r 845fee459824 test-data/Heatmaps_imzml.pdf Binary file test-data/Heatmaps_imzml.pdf has changed diff -r 385e8a4accd9 -r 845fee459824 test-data/Heatmaps_rdata.pdf Binary file test-data/Heatmaps_rdata.pdf has changed diff -r 385e8a4accd9 -r 845fee459824 test-data/inputpeptides.csv --- a/test-data/inputpeptides.csv Mon Nov 27 13:49:35 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -152 mass1 -328.9 mass2 -185.2 mass3 diff -r 385e8a4accd9 -r 845fee459824 test-data/inputpeptides.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/inputpeptides.tabular Thu Mar 01 08:25:18 2018 -0500 @@ -0,0 +1,3 @@ +152 mass1 +328.9 mass2 +185.2 mass3 diff -r 385e8a4accd9 -r 845fee459824 test-data/inputpeptides.txt --- a/test-data/inputpeptides.txt Mon Nov 27 13:49:35 2017 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -854.5 -1296.7 -2000.8 diff -r 385e8a4accd9 -r 845fee459824 test-data/inputpeptides2.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/inputpeptides2.tabular Thu Mar 01 08:25:18 2018 -0500 @@ -0,0 +1,3 @@ +854.5 +1296.7 +2000.8