diff maldi_quant_preprocessing.xml @ 4:82b1de5c142b draft default tip

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/MALDIquant commit f1e1cd260ef2884d0ba12e2b614df3c72d0934dc
author galaxyp
date Sat, 04 Mar 2023 19:13:31 +0000
parents aa81463e21ea
children
line wrap: on
line diff
--- a/maldi_quant_preprocessing.xml	Fri Feb 15 10:13:30 2019 -0500
+++ b/maldi_quant_preprocessing.xml	Sat Mar 04 19:13:31 2023 +0000
@@ -1,4 +1,4 @@
-<tool id="maldi_quant_preprocessing" name="MALDIquant preprocessing" version="@VERSION@.3">
+<tool id="maldi_quant_preprocessing" name="MALDIquant preprocessing" version="@VERSION@.0">
     <description>
         Preprocessing of mass-spectrometry imaging data
     </description>
@@ -19,8 +19,6 @@
             du infile.hdr &&
             du infile.img &&
             du -s -B1 infile.hdr &&
-        #else
-            ln -s $infile infile.RData &&
         #end if
         Rscript "${maldi_quant_preprocessing}" &&
 
@@ -59,22 +57,6 @@
         ## Import analyze7.5 file
         maldi_data = importAnalyze( 'infile.hdr' )
         coordinates_info = cbind(coordinates(maldi_data)[,1:2], c(1:length(maldi_data)))
-    #else
-        loadRData <- function(fileName){
-        ##loads an RData file, and returns it
-        load(fileName)
-        get(ls()[ls() != "fileName"])
-        }
-        msidata = loadRData('infile.RData')
-        ## save coordinates
-        cardinal_coordinates = as.matrix(Cardinal::coord(msidata)[,1:2])
-        ## save mz values
-        cardinal_mzs = Cardinal::mz(msidata)
-        ## create MALDIquant MassSpectrum object, order of pixels in iData is same as in coord(msidata):
-        maldi_data = list()
-        for(number_spectra in 1:ncol(msidata)){
-        maldi_data[[number_spectra]] = MALDIquant::createMassSpectrum(mass = cardinal_mzs, intensity = iData(msidata)[,number_spectra])
-        }
     #end if
 
 #end if
@@ -344,10 +326,6 @@
             if (length(findEmptyMassObjects(maldi_data))>0)
 
                 {
-                    #if $infile.ext == 'rdata'
-                        cardinal_coordinates = cardinal_coordinates[-findEmptyMassObjects(maldi_data),,drop=FALSE] ## remove coordinates of empty spectra for Cardinal RData input
-                    #end if
-
                     maldi_data = removeEmptyMassObjects(maldi_data)
             }
         #end if
@@ -386,11 +364,7 @@
 
 ## export imzML file
 if (length(maldi_data)>0){
-    #if $infile.ext == 'rdata'
-        MALDIquantForeign::exportImzMl(maldi_data, file="out.imzMl", processed=$export_processed, coordinates=cardinal_coordinates)
-    #else
         MALDIquantForeign::exportImzMl(maldi_data, file="out.imzMl", processed=$export_processed)
-    #end if
 
 }else{"All spectra are empty, outputfiles will be empty,too."}
 
@@ -398,7 +372,7 @@
         </configfile>
     </configfiles>
     <inputs>
-        <param name="infile" type="data" format="imzml,rdata,analyze75" label="MSI data" help="Input file as imzML (composite upload), or Cardinal MSImageSet saved as RData (regular upload). The file must be in profile mode, not centroided."/>
+        <param name="infile" type="data" format="imzml,analyze75" label="MSI data" help="Input file as imzML (composite upload). The file must be in profile mode, not centroided."/>
         <conditional name="restriction_conditional">
             <param name="restriction" type="select" label="Use only spectra of interest" help="This option only works for imzML files">
                 <option value="no_restriction" selected="True">No, calculate on entire file</option>
@@ -529,7 +503,7 @@
                     <param name="snr" type="integer" value="2" label="Signal-to-noise-ratio"/>
                     <param name="allow_nomatch" type="boolean" label="Allow no matches" help="Don't throw an error when less than 2 reference m/z were found in a spectrum" truevalue="TRUE" falsevalue="FALSE"/>
                     <param name="empty_nomatch" type="boolean" label="Empty no matches" help="If TRUE the intensity values of MassSpectrum or MassPeaks objects with missing (NA) warping functions are set to zero" truevalue="TRUE" falsevalue="FALSE"/>
-                    <param name="remove_empty" type="boolean" label="Remove empty spectra" truevalue="TRUE" falsevalue="FALSE" help="For Cardinal RData files this step can only be performed if pixel annotations were provided"/>
+                    <param name="remove_empty" type="boolean" label="Remove empty spectra" truevalue="TRUE" falsevalue="FALSE"/>
 
                     <conditional name="reference_for_alignment">
                         <param name="align_ref" type="select" label="Reference" help="If given, samples will be aligned to reference, use internal calibrants to perform m/z calibration">
@@ -579,33 +553,12 @@
                 <param name="baseline_method" value ="TopHat"/>
             </conditional>
             <output name="outfile_imzml" ftype="imzml" file="preprocessing1.imzml.txt" lines_diff="4">
-                <extra_files type="file" file="outfile1.imzml" name="imzml" lines_diff="6"/>
+                <extra_files type="file" file="outfile1.imzml" name="imzml" lines_diff="8"/>
                 <extra_files type="file" file="outfile1.ibd" name="ibd" compare="sim_size"/>
             </output>
             <output name="plots" file="Preprocessing1_QC.pdf" compare="sim_size"/>
         </test>
         <test>
-            <param name="infile" value="msidata_1.RData" ftype="rdata"/>
-            <conditional name="methods_conditional">
-                <param name="method" value="Align"/>
-                <param name="warping_method" value="lowess"/>
-                <param name="halfWindowSize" value="5"/>
-                <param name="tolerance" value="0.001"/>
-                <param name="allow_nomatch" value="TRUE"/>
-                <param name="remove_empty" value="TRUE"/>
-                <param name="empty_nomatch" value="TRUE"/>
-                <conditional name="reference_for_alignment">
-                    <param name="align_ref" value="yes_reference"/>
-                    <param name="reference_file" value="inputpeptides.tabular" ftype="tabular"/>
-                </conditional>
-            </conditional>
-            <output name="outfile_imzml" ftype="imzml" file="preprocessing2.imzml.txt" lines_diff="4">
-                <extra_files type="file" file="outfile2.imzml" name="imzml" lines_diff="6"/>
-                <extra_files type="file" file="outfile2.ibd" name="ibd" compare="sim_size"/>
-            </output>
-            <output name="plots" file="Preprocessing2_QC.pdf" compare="sim_size"/>
-        </test>
-        <test>
             <param name="infile" value="" ftype="imzml">
                 <composite_data value="Example_Continuous.imzML"/>
                 <composite_data value="Example_Continuous.ibd"/>
@@ -615,7 +568,7 @@
                 <param name="calibrate_method" value="median"/>
             </conditional>
             <output name="outfile_imzml" ftype="imzml" file="preprocessing3.imzml.txt" lines_diff="4">
-                <extra_files type="file" file="outfile3.imzml" name="imzml" lines_diff="6"/>
+                <extra_files type="file" file="outfile3.imzml" name="imzml" lines_diff="8"/>
                 <extra_files type="file" file="outfile3.ibd" name="ibd" compare="sim_size"/>
             </output>
             <output name="plots" file="Preprocessing3_QC.pdf" compare="sim_size"/>
@@ -631,8 +584,7 @@
 
 - MSI data: 2 types of input data can be used:
 
-    - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
-    - Cardinal "MSImageSet" data saved as .RData
+    - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/imzml/>`_
 
 - Optional: Tabular file with pixel coordinates to restrict reading of imzML files to coordinates of interest. Tabular files with any header name or no header at all are supported.