diff mz_images.xml @ 13:a2b57ea6666e draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 39bd480e8813fa7a96b640150365577a69885d17-dirty"
author galaxyp
date Sun, 29 Nov 2020 23:23:01 +0000
parents a95a82eb4d50
children 5629069fca8f
line wrap: on
line diff
--- a/mz_images.xml	Wed Oct 21 22:58:11 2020 +0000
+++ b/mz_images.xml	Sun Nov 29 23:23:01 2020 +0000
@@ -1,4 +1,4 @@
-<tool id="cardinal_mz_images" name="MSI mz images" version="@VERSION@.1">
+<tool id="cardinal_mz_images" name="MSI mz images" version="@VERSION@.2">
     <description>
         mass spectrometry imaging m/z heatmaps
     </description>
@@ -62,12 +62,19 @@
 
 ### only plot images when file has features and pixels: 
 par(mar=c(0,0,0,0), oma=c(0,0,0,1))## margin for image legend
+
+#if str($light_mode) == "white":
+    lightmode()
+#else
+    darkmode()
+#end if
+
 if (ncol(msidata)>0 & nrow(msidata) >0){
     if (length(inputmz) != 0){
         for (mass in 1:length(inputmz)){
 
                 print(image(msidata, mz=inputmz[mass],plusminus = $plusminus_dalton, normalize.image="$normalize_image", contrast.enhance = "$image_contrast", 
-                smooth.image = "$image_smoothing", colorkey=$colorkey, colorscale=$colorscale, ylim= c(maximumy,minimumy)))
+                smooth.image = "$image_smoothing", colorkey=$colorkey, colorscale=$colorscale, alpha.power=$alpha_power, ylim= c(maximumy,minimumy)))
                 title(inputnames[mass], adj = 0.5, line = 1)}
 
 
@@ -81,7 +88,12 @@
 
             svg(file="svg_pixel_output.svg", width=maximumx, height=maximumy)
             par(mar=c(0,0,0,0), oma=c(0,0,0,0))## no margin for svg
-            print(image(msidata, mz = inputmz[1],strip=FALSE, plusminus = $plusminus_dalton, colorscale=$colorscale, colorkey = FALSE,axes=FALSE, xlab=NA, ylab=NA,contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", normalize.image="$normalize_image"))
+	    #if str($light_mode) == "white":
+	        lightmode()
+	    #else
+	        darkmode()
+	    #end if
+            print(image(msidata, mz = inputmz[1],strip=FALSE, plusminus = $plusminus_dalton,colorscale=$colorscale, colorkey = FALSE,axes=FALSE, xlab=NA, ylab=NA,contrast.enhance = "$image_contrast", smooth.image = "$image_smoothing", alpha.power=$alpha_power, normalize.image="$normalize_image"))
             dev.off()
         #end if
 
@@ -90,15 +102,14 @@
 
         #set $color_string = ','.join(['"%s"' % $color.feature_color for $color in $overlay_cond.colours])
         colourvector = c($color_string)
-            par(mar=c(0,0,0,0), oma=c(0,0,0,1))## margin for image legend
             print(image(msidata, mz=inputmz, 
                   plusminus = $plusminus_dalton,
-                  col=colourvector,
+                  col=colourvector, 
                   contrast.enhance = "$image_contrast", 
                   normalize.image="$normalize_image", 
                   smooth.image = "$image_smoothing",
                   superpose=TRUE, main="overlay of all m/z", 
-                  key=FALSE, 
+                  key=FALSE, alpha.power=$alpha_power,
                   ylim= c(maximumy,minimumy)))
 
              legend("$overlay_cond.legend_position",
@@ -121,7 +132,7 @@
         <expand macro="pdf_filename"/>
         <expand macro="reading_2_column_mz_tabular"/>
 
-        <param name="plusminus_dalton" value="0.25" type="float" label="m/z range" help="average of the m/z window will be computed"/>
+        <param name="plusminus_dalton" value="0.25" type="float" label="plusminus m/" help="m/z range to add on either side of the given m/z to create a window in which the mean of all intensities will be computed"/>
         <param name="image_contrast" type="select" label="Contrast enhancement" help="The 'histogram' equalization method flatterns the distribution of intensities. The hotspot 'suppression' method uses thresholding to reduce the intensities of hotspots">
             <option value="none" selected="True">none</option>
             <option value="suppression">suppression</option>
@@ -138,6 +149,11 @@
             <option value="plasma">plasma</option>
             <option value="inferno">inferno</option>
         </param>
+        <param name="light_mode" type="select" display="radio" label="Image Background">
+            <option value="white" selected="True">white</option>
+            <option value="black">black</option>
+        </param>
+        <param name="alpha_power" type="float" value="1" label="Alpha power" help="Opacity scaling factor (1 is linear)"/>
         <param name="colorkey" type="boolean" checked="True" truevalue="TRUE" falsevalue="FALSE" label="Display colorkey in plot"/>
         <param name="normalize_image" type="boolean" truevalue="linear" falsevalue="none" label="Linear normalization of image"/>
         <param name="svg_pixelimage" type="boolean" label="Export first valid m/z from tabular file as SVG"/>
@@ -233,6 +249,7 @@
             <param name="calibrant_file" value="inputpeptides.tabular" ftype="tabular"/>
             <param name="mz_column" value="1"/>
             <param name="name_column" value="2"/>
+            <param name="light_mode" value="black"/>
             <conditional name="overlay_cond">
                 <param name="overlay_selection" value="yes_overlay"/>
                 <repeat name="colours">