# HG changeset patch # User galaxyp # Date 1527525245 14400 # Node ID 729a8bf3ffa9aa10f09654a9828e50da9c6c75f7 # Parent e045a8d295eb6db12d7c64e030df87615cb06730 planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_ion_images commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0 diff -r e045a8d295eb -r 729a8bf3ffa9 msi_ion_images.xml --- a/msi_ion_images.xml Mon Apr 23 17:16:47 2018 -0400 +++ b/msi_ion_images.xml Mon May 28 12:34:05 2018 -0400 @@ -1,22 +1,21 @@ - + mass spectrometry imaging heatmaps - bioconductor-cardinal + bioconductor-cardinal r-gridextra - r-kernsmooth r-lattice minmz & input_list[,1]minmz & input_list[,1]0) - }else { + percentpixels = round(countpixels/pixelcount*100, digits=1) + valuesdataframe = cbind(inputmz, cbind(countpixels, percentpixels)) + write.table(valuesdataframe, file="$pixel_count", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t") +}else if (length(inputmz) >1) { countpixels = rowSums(spectra(msidata)[features(msidata, mz=inputmz),] >0) - } + percentpixels = round(countpixels/pixelcount*100, digits=1) + valuesdataframe = cbind(inputmz, cbind(countpixels, percentpixels)) + write.table(valuesdataframe, file="$pixel_count", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t") +}else{ + valuesdataframe = data.frame(0,0) + write.table(valuesdataframe, file="$pixel_count", quote = FALSE, row.names = FALSE, col.names=TRUE, sep = "\t") +} -percentpixels = round(countpixels/pixelcount*100, digits=1) -valuesdataframe = cbind(inputmz, cbind(countpixels, percentpixels)) - +############################ summarize file properties in numbers ############## -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", @@ -170,43 +175,35 @@ property_df = data.frame(properties, values) - - -######################################## PDF ############################################# -########################################################################################## -########################################################################################## - +############################## PDF ############################################# pdf("heatmaps.pdf", fonts = "Times", pointsize = 12) plot(0,type='n',axes=FALSE,ann=FALSE) #if not $filename: #set $filename = $infile.display_name #end if -title(main=paste("Quality control of MSI data\n\n", "Filename:", "$filename")) +title(main=paste("\nHeatmap images\n\n", "Filename:\n", "$filename")) ############################# I) numbers #################################### -############################################################################# grid.table(property_df, rows= NULL) +############################# II) images #################################### + +### only plot images when file has peaks and valid input mz: + 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 = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", + lattice=TRUE, 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 invalid")} - dev.off() - }else{ print("inputfile has no intensities > 0") dev.off() @@ -217,7 +214,7 @@ - @@ -262,17 +259,17 @@ - + - + - + - + @@ -280,26 +277,35 @@ `_ + +This tool uses the Cardinal image function to plot the intensity distribution of interesting masses of mass-spectrometry imaging data. Input data: 3 types of mass-spectrometry imaging data can be used: -- imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format `_ +- imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format `_ - Analyze7.5 (upload hdr, img and t2m file via the "composite" function) - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData) -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) +Tabular file with masses: + +- tab separated file (.tabular), datatype in Galaxy must be tabular otherwise file will not appear in selection window (if Galaxy auto-detection was wrong, datatype can be changed by pressing button with the pen (edit attributes)) - first column must contain masses (separate point numbers by point, not comma) - optionally a second column with names for the masses can be provided -- no empty fields or letters are allowed (tool crashes with empty fields and a single letter prohibits generation of images) +- no empty fields or letters are allowed in the first column + +Output: -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 +- Pdf with the heatmap images +- Tabular with masses that were in the mass range and their occurence over all pixels (absolute and in %) +Troubleshooting: + +- no heatmaps are plotted when tabular file doesn't fulfill the criteria described above +- no heatmaps are plotted when the input mass spectrometry imaging file has no intensities > 0 +- out of thetabular file only masses with > 1.5-2% pixel coverage can be used with the contrast enhance and image smoothing functions, as both crash when a mass has not enough intensity values ]]> diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Analyze75.hdr Binary file test-data/Analyze75.hdr has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Analyze75.img Binary file test-data/Analyze75.img has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Analyze75.t2m Binary file test-data/Analyze75.t2m has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Heatmaps_LM8_file16.pdf Binary file test-data/Heatmaps_LM8_file16.pdf has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Heatmaps_analyze75.pdf Binary file test-data/Heatmaps_analyze75.pdf has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Heatmaps_imzml.pdf Binary file test-data/Heatmaps_imzml.pdf has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/Heatmaps_rdata.pdf Binary file test-data/Heatmaps_rdata.pdf has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/LM8_file16.rdata Binary file test-data/LM8_file16.rdata has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/empty_spectra.rdata Binary file test-data/empty_spectra.rdata has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/inputpeptides2.tabular --- a/test-data/inputpeptides2.tabular Mon Apr 23 17:16:47 2018 -0400 +++ b/test-data/inputpeptides2.tabular Mon May 28 12:34:05 2018 -0400 @@ -1,1 +1,4 @@ 854.5 +1111.1 +1296.7 +1305.1 diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/preprocessed.rdata Binary file test-data/preprocessed.rdata has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/preprocessing_results1.RData Binary file test-data/preprocessing_results1.RData has changed diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/tabular_LM8file16.tabular --- a/test-data/tabular_LM8file16.tabular Mon Apr 23 17:16:47 2018 -0400 +++ b/test-data/tabular_LM8file16.tabular Mon May 28 12:34:05 2018 -0400 @@ -1,2 +1,2 @@ - inputmz countpixels percentpixels -1 854.5 0 0 +inputmz countpixels percentpixels +1111.1 0 0 diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/tabular_analyze75.tabular --- a/test-data/tabular_analyze75.tabular Mon Apr 23 17:16:47 2018 -0400 +++ b/test-data/tabular_analyze75.tabular Mon May 28 12:34:05 2018 -0400 @@ -1,2 +1,3 @@ - inputmz countpixels percentpixels -1 854.5 2 22.2 +inputmz countpixels percentpixels +1296.7 9 100 +1305.1 9 100 diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/tabular_imzml.tabular --- a/test-data/tabular_imzml.tabular Mon Apr 23 17:16:47 2018 -0400 +++ b/test-data/tabular_imzml.tabular Mon May 28 12:34:05 2018 -0400 @@ -1,4 +1,4 @@ - inputmz countpixels percentpixels -1 152 9 100 -2 328.9 9 100 -3 185.2 6 66.7 +inputmz countpixels percentpixels +152 9 100 +328.9 9 100 +185.2 6 66.7 diff -r e045a8d295eb -r 729a8bf3ffa9 test-data/tabular_rdata.tabular --- a/test-data/tabular_rdata.tabular Mon Apr 23 17:16:47 2018 -0400 +++ b/test-data/tabular_rdata.tabular Mon May 28 12:34:05 2018 -0400 @@ -1,4 +1,2 @@ - inputmz countpixels percentpixels -1 152 9 100 -2 328.9 9 100 -3 185.2 6 66.7 +inputmz countpixels percentpixels +328.9 9 100