diff msi_preprocessing.xml @ 1:c4abf42419c2 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_preprocessing commit a8eebad4ad469908f64c25e1e2c705eb637e3cae
author galaxyp
date Fri, 24 Nov 2017 18:08:19 -0500
parents 74fcb3c95a53
children 50ba097d03e0
line wrap: on
line diff
--- a/msi_preprocessing.xml	Tue Oct 31 15:05:05 2017 -0400
+++ b/msi_preprocessing.xml	Fri Nov 24 18:08:19 2017 -0500
@@ -1,4 +1,4 @@
-<tool id="mass_spectrometry_imaging_preprocessing" name="MSI preprocessing" version="1.7.0">
+<tool id="mass_spectrometry_imaging_preprocessing" name="MSI preprocessing" version="1.7.0.1">
     <description>
         mass spectrometry imaging preprocessing
     </description>
@@ -35,6 +35,7 @@
     load('infile.RData')
 #end if
 
+
 maxpixel = length(pixels(msidata)) 
 pixelnumber = c(1:maxpixel)
 
@@ -64,6 +65,7 @@
             msidata <- smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, coef = $method.methods_conditional.methods_for_smoothing.coefficients_ma_filter)
         #end if
 
+
     #elif str( $method.methods_conditional.preprocessing_method) == 'Peak_picking':
         print('Peak_picking')
         ## Peakpicking
@@ -81,6 +83,8 @@
             msidata = peakPick(msidata, pixel=pixelnumber, window = $method.methods_conditional.window_picking, blocks = $method.methods_conditional.blocks_picking, method='$method.methods_conditional.methods_for_picking.picking_method', SNR=$method.methods_conditional.SNR_picking_method)
         #end if
 
+
+
     #elif str( $method.methods_conditional.preprocessing_method ) == 'Peak_alignment':
         print('Peak_alignment')
         ## Peakalignment
@@ -100,22 +104,31 @@
     #end if
 #end for
 
+
 ## save as as (.RData)
 save(msidata, file="$msidata_preprocessed")
 
-## save as intensity matrix (.csv)
-csvmatrix = spectra(msidata)
-rownames(csvmatrix) = mz(msidata)
-newmatrix = rbind(pixels(msidata), csvmatrix)
-write.csv(newmatrix[2:nrow(newmatrix),], file="$preprocessed_intensity_matrix")
+if (length(features(msidata))> 0)
+{
+
+## save as intensity matrix
+spectramatrix = spectra(msidata)
+rownames(spectramatrix) = mz(msidata)
+newmatrix = rbind(pixels(msidata), spectramatrix)
+write.table(newmatrix[2:nrow(newmatrix),], file="$matrixasoutput", quote = FALSE, row.names = TRUE, col.names=NA, sep = "\t")
+
+}else{
+  print("file has no features left")
+write.table(matrix(rownames(coord(msidata)), ncol=ncol(msidata), nrow=1), file="$matrixasoutput", quote = FALSE, row.names = FALSE, col.names=FALSE, sep = "\t")
+}
+
 
     ]]></configfile>
     </configfiles>
     <inputs>
         <param name="infile" type="data" format="imzml,rdata,analyze75"
-               label="MSI rawdata as imzml or Cardinal MSImageSet saved as RData"
-               help="load imzml and ibd file by uploading composite datatype imzml"/>
-
+            label="MSI rawdata as imzml or Cardinal MSImageSet saved as RData"
+            help="load imzml and ibd file by uploading composite datatype imzml"/>
         <repeat name="methods" title="Preprocessing" min="1" max="50">
             <conditional name="methods_conditional">
                 <param name="preprocessing_method" type="select" label="Select the preprocessing methods you want to apply">
@@ -210,14 +223,14 @@
         </repeat>
     </inputs>
     <outputs>
-        <data format="rdata" name="msidata_preprocessed" label="Preprocessed_output"/>
-        <data format="csv" name="preprocessed_intensity_matrix" label="preprocessed intensity matrix" />
+        <data format="rdata" name="msidata_preprocessed" label="${tool.name} on $infile.display_name"/>
+        <data format="tabular" name="matrixasoutput" label="${tool.name} on $infile.display_name" />
     </outputs>
     <tests>
         <test>
             <param name="infile" value="" ftype="imzml">
-                <composite_data value="Example_Continuous.imzML" ftype="imzml"/>
-                <composite_data value="Example_Continuous.ibd" ftype="ibd"/>
+                <composite_data value="Example_Continuous.imzML"/>
+                <composite_data value="Example_Continuous.ibd"/>
             </param>
             <repeat name="methods">
                 <conditional name="methods_conditional">
@@ -226,9 +239,15 @@
             </repeat>
             <repeat name="methods">
                 <conditional name="methods_conditional">
+                    <param name="preprocessing_method" value="Baseline_reduction" />
+                    <param name="blocks_baseline" value="100" />
+                </conditional>
+            </repeat>
+            <repeat name="methods">
+                <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Smoothing" />
                     <conditional name="methods_for_smoothing">
-                        <param name="smoothing_method" value="sgolay" />
+                        <param name="smoothing_method" value="gaussian" />
                     </conditional>
                 </conditional>
             </repeat>
@@ -246,26 +265,26 @@
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Peak_alignment" />
                     <conditional name="methods_for_alignment">
-                        <param name="alignment_method" value="DP" />
+                        <param name="alignment_method" value="diff" />
                     </conditional>
                 </conditional>
             </repeat>
-            <repeat name="methods">
+            <!--repeat name="methods">
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Peak_filtering" />
                 </conditional>
-            </repeat>
+            </repeat-->
             <output name="msidata_preprocessed" file="preprocessing_results1.RData" compare="sim_size" />
-            <output name="preprocessed_intensity_matrix" file="preprocessing_results1.csv" />
+            <output name="matrixasoutput" file="preprocessing_results1.txt" />
         </test>
         <test>
-            <param name="infile" value="LM5_first68pixel.RData" ftype="rdata"/>
-            <repeat name="methods">
+            <param name="infile" value="example_continous.RData" ftype="rdata"/>
+            <!--repeat name="methods">
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Baseline_reduction" />
-                    <param name="blocks_baseline" value="50" />
+                    <param name="blocks_baseline" value="3" />
                 </conditional>
-            </repeat>
+            </repeat-->
             <repeat name="methods">
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Peak_picking" />
@@ -281,27 +300,25 @@
                 </conditional>
             </repeat>
             <output name="msidata_preprocessed" file="preprocessing_results2.RData" compare="sim_size" />
-            <output name="preprocessed_intensity_matrix" file="preprocessing_results2.csv" lines_diff="2"/>
+            <output name="matrixasoutput" file="preprocessing_results2.txt" lines_diff="2" />
         </test>
         <test>
             <param name="infile" value="" ftype="analyze75">
-                <composite_data value="Analyze75.hdr" ftype="hdr"/>
-                <composite_data value="Analyze75.img" ftype="img"/>
-                <composite_data value="Analyze75.t2m" ftype="t2m"/>
+                <composite_data value="Analyze75.hdr"/>
+                <composite_data value="Analyze75.img"/>
+                <composite_data value="Analyze75.t2m"/>
             </param>
             <repeat name="methods">
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Normalization" />
                 </conditional>
             </repeat>
-            <repeat name="methods">
+            <!--repeat name="methods">
                 <conditional name="methods_conditional">
-                    <param name="preprocessing_method" value="Smoothing" />
-                    <conditional name="methods_for_smoothing">
-                        <param name="smoothing_method" value="gaussian" />
-                    </conditional>
+                    <param name="preprocessing_method" value="Baseline_reduction" />
+                    <param name="blocks_baseline" value="50" />
                 </conditional>
-            </repeat>
+            </repeat-->
             <repeat name="methods">
                 <conditional name="methods_conditional">
                     <param name="preprocessing_method" value="Peak_picking" />
@@ -317,11 +334,12 @@
                 </conditional>
             </repeat>
             <output name="msidata_preprocessed" file="preprocessing_results3.RData" compare="sim_size" />
-            <output name="preprocessed_intensity_matrix" file="preprocessing_results3.csv" />
+            <output name="matrixasoutput" file="preprocessing_results3.txt" />
         </test>
+
     </tests>
     <help>
-    <![CDATA[
+        <![CDATA[
 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets.
 
 **Preprocessing steps:**