diff msi_ion_images.xml @ 2:b2ad54eabcca draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_ion_images commit ed7d3e6f1a09c78c8f71cc1bdc1a20249767f646
author galaxyp
date Sun, 11 Mar 2018 10:38:24 -0400
parents 845fee459824
children 616b98c235fb
line wrap: on
line diff
--- a/msi_ion_images.xml	Thu Mar 01 08:25:18 2018 -0500
+++ b/msi_ion_images.xml	Sun Mar 11 10:38:24 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="mass_spectrometry_imaging_ion_images" name="MSI ion images" version="1.7.0.1">
+<tool id="mass_spectrometry_imaging_ion_images" name="MSI ion images" version="1.7.0.2">
     <description>
         mass spectrometry imaging heatmaps
     </description>
@@ -104,25 +104,28 @@
   peakpickinginfo=processinginfo@peakPicking
 }
 
-#if $massfile:
-    ### Read tabular file with peptide masses for plots and heatmap images: 
-    input_list = read.delim("$massfile", header = FALSE, stringsAsFactors = FALSE)
-        if (ncol(input_list) == 1)
-        {
-            input_list = cbind(input_list, input_list)
-        }
-        ### calculate how many input masses are valid: 
-        inputmasses = input_list[input_list[,1]>minmz & input_list[,1]<maxmz,]
+
+### Read tabular file with peptide masses for heatmap images: 
+
+input_list = read.delim("$massfile", header = FALSE, stringsAsFactors = FALSE)
+    if (ncol(input_list) == 1)
+    {
+        input_list = cbind(input_list, input_list)
+    }
 
-        inputmz = inputmasses[,1]
-        inputnames = inputmasses[,2]
-#else
-    input_list = data.frame(0, 0)
-    inputmz = 0
-#end if
+    ### calculate how many input masses are valid: 
+    inputmasses = input_list[input_list[,1]>minmz & input_list[,1]<maxmz,]
+
+    inputmz = inputmasses[,1]
+    inputnames = inputmasses[,2]
 
+    if (nrow(input_list) == 1)
+    {
+    countpixels = sum(spectra(msidata)[features(msidata, mz = inputmz), ] >0)
+    }else {
+    countpixels = rowSums(spectra(msidata)[features(msidata, mz=inputmz),] >0)
+    }
 
-countpixels = rowSums(spectra(msidata)[features(msidata, mz=inputmz),]>0)
 percentpixels = round(countpixels/pixelcount*100, digits=1)
 valuesdataframe = cbind(inputmz, cbind(countpixels, percentpixels))
 
@@ -145,7 +148,7 @@
                "Baseline reduction",
                "Peak picking",
                "Centroided", 
-                paste0("# valid masses in ", "$massfile.display_name"))
+                paste0("# valid masses in \n", "$massfile.display_name"))
 
 values = c(paste0(maxfeatures), 
            paste0(minmz, " - ", maxmz), 
@@ -213,15 +216,15 @@
     <inputs>
         <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
             help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
-        <param name="filename" type="text" value="" label="Title" help="will appear in the quality report. If nothing given it will take the dataset name."/>
+        <param name="filename" type="text" value="" label="Title" help="will appear in the quality report. If nothing given it will take the dataset name"/>
         <param name="massfile" type="data" format="tabular" label="Text file with masses and names"
             help="first column mass (m/z), second column mass name, tab separated file"/>
-        <param name="image_contrast" type="select" label="Select a contrast enhancement function for the heatmap images." help="The 'histogram' equalization method flatterns the distribution of intensities. The hotspot 'suppression' method uses thresholding to reduce the intensities of hotspots">
+        <param name="image_contrast" type="select" label="Select a contrast enhancement function for the heatmap images" 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>
             <option value="histogram">histogram</option>
         </param>
-        <param name="image_smoothing" type="select" label="Select an image smoothing function for the heatmap images." help="The 'gaussian' smoothing method smooths images with a simple gaussian kernel. The 'adaptive' method uses bilateral filtering to preserve edges.">
+        <param name="image_smoothing" type="select" label="Select an image smoothing function for the heatmap images" help="The 'gaussian' smoothing method smooths images with a simple gaussian kernel. The 'adaptive' method uses bilateral filtering to preserve edges">
             <option value="none" selected="True">none</option>
             <option value="gaussian">gaussian</option>
             <option value="adaptive">adaptive</option>
@@ -243,8 +246,8 @@
             <param name="filename" value="Testfile_imzml"/>
             <param name="image_contrast" value="histogram"/>
             <output name="plots" file="Heatmaps_imzml.pdf" compare="sim_size" delta="20000"/>
+            <output name="pixel_count" file="tabular_imzml.tabular"/>
         </test>
-
         <test>
             <param name="infile" value="" ftype="analyze75">
                 <composite_data value="Analyze75.hdr"/>
@@ -256,6 +259,7 @@
             <param name="filename" value="Testfile_analyze75"/>
             <param name="image_smoothing" value="gaussian"/>
             <output name="plots" file="Heatmaps_analyze75.pdf" compare="sim_size" delta="20000"/>
+            <output name="pixel_count" file="tabular_analyze75.tabular"/>
         </test>
         <test>
             <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/>
@@ -263,6 +267,7 @@
             <param name="plusminus_dalton" value="0.1"/>
             <param name="filename" value="Testfile_rdata"/>
             <output name="plots" file="Heatmaps_rdata.pdf" compare="sim_size" delta="20000"/>
+            <output name="pixel_count" file="tabular_rdata.tabular"/>
         </test>
         <test>
             <param name="infile" value="LM8_file16.rdata" ftype="rdata"/>
@@ -270,6 +275,7 @@
             <param name="plusminus_dalton" value="0.1"/>
             <param name="filename" value="Testfile_rdata"/>
             <output name="plots" file="Heatmaps_LM8_file16.pdf" compare="sim_size" delta="20000"/>
+            <output name="pixel_count" file="tabular_LM8file16.tabular"/>
         </test>
     </tests>
     <help><![CDATA[
@@ -286,8 +292,9 @@
 
 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)
+- 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)
-- 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