# HG changeset patch # User galaxyp # Date 1534326016 14400 # Node ID 6cd561bbb7ee7af86b7e9fb3744cf71180d9ecf1 # Parent db0cf8eb4395fb488dc55623b9008f81aa15b12c planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_ion_images commit 620a469e20836b921b6c0147421c8a4268b66ebd diff -r db0cf8eb4395 -r 6cd561bbb7ee msi_ion_images.xml --- a/msi_ion_images.xml Fri Jul 06 14:13:35 2018 -0400 +++ b/msi_ion_images.xml Wed Aug 15 05:40:16 2018 -0400 @@ -1,4 +1,4 @@ - + mass spectrometry imaging m/z heatmaps @@ -178,40 +178,50 @@ if (npeaks > 0){ if (length(inputmz) != 0){ - for (mass in 1:length(inputmz)){ + for (mass in 1:length(inputmz)){ -###standard image + ###standard image -#if str($image_cond.image_type) == "standard_image": - print("standard image") + #if str($image_cond.image_type) == "standard_image": + print("standard image") - print(image(msidata, mz=inputmz[mass],plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", - smooth.image = "$image_smoothing", strip=$strip, colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy), - main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} + print(image(msidata, mz=inputmz[mass],plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", + smooth.image = "$image_smoothing", strip=$strip, colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy), + main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} -###lattice image + ###lattice image + + #elif str($image_cond.image_type) == "lattice_image": + print("lattice image") + + #if str($strip) =="TRUE": -#elif str($image_cond.image_type) == "lattice_image": - print("lattice image") + print(image(msidata, mz=inputmz[mass], strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), + lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", + colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy), + main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} - #if str($strip) =="TRUE": + #elif str($strip) =="FALSE": - print(image(msidata, mz=inputmz[mass], strip = strip.custom(bg="lightgrey", par.strip.text=list(col="black", cex=.9)), - lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", - colorkey=$colorkey,ylim= c(maximumy+0.1*maximumy,minimumy-0.1*minimumy), - main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} + print(image(msidata, mz=inputmz[mass], strip = $strip, + lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", + colorkey=$colorkey, + main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} - #elif str($strip) =="FALSE": + #end if + + #end if - print(image(msidata, mz=inputmz[mass], strip = $strip, - lattice=TRUE, plusminus = $plusminus_dalton, contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", - colorkey=$colorkey, - main= paste0(inputnames[mass], " (", round(inputmz[mass], digits = 2)," ± ", $plusminus_dalton, " Da)")))} + ## optional svg output with original coordinates + #if str($svg_cond.svg_pixelimage) == "yes_svg": + print("svg pixel image") - #end if - -#end if + svg(file="svg_pixel_output.svg") + par(mar=c(0,0,0,0)) + 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") + dev.off() + #end if } else {print("The input m/z were invalid")} dev.off() @@ -219,6 +229,8 @@ print("inputfile has no intensities > 0") dev.off() } + + ]]> @@ -262,9 +274,20 @@ + + + + + + + + + + svg_cond['svg_pixelimage'] == 'yes_svg' + @@ -293,7 +316,11 @@ + + + + @@ -339,6 +366,7 @@ Output: - Pdf with the heatmap images +- optional svg file of a mass-spectrometry imaging m/z heatmap Troubleshooting: diff -r db0cf8eb4395 -r 6cd561bbb7ee test-data/Heatmaps_LM8_file16.pdf Binary file test-data/Heatmaps_LM8_file16.pdf has changed diff -r db0cf8eb4395 -r 6cd561bbb7ee test-data/Heatmaps_analyze75.pdf Binary file test-data/Heatmaps_analyze75.pdf has changed diff -r db0cf8eb4395 -r 6cd561bbb7ee test-data/Heatmaps_imzml.pdf Binary file test-data/Heatmaps_imzml.pdf has changed diff -r db0cf8eb4395 -r 6cd561bbb7ee test-data/Heatmaps_rdata.pdf Binary file test-data/Heatmaps_rdata.pdf has changed diff -r db0cf8eb4395 -r 6cd561bbb7ee test-data/analyze75.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/analyze75.svg Wed Aug 15 05:40:16 2018 -0400 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +