view 2018_07_compression.xml @ 0:e93012d3bbf5 draft

Uploaded
author jcb-mpl
date Tue, 27 Apr 2021 14:06:30 +0000
parents
children 64c2025cd389
line wrap: on
line source

<tool id="2021_05_mz_1_k_compression" name="MS-centroid -> compression" version="0.0.1">
    <description> by a factor k  </description>


  <requirements>
    <requirement type="package" version="6.0.2">scilab</requirement>
  </requirements>


  <stdio>
    <exit_code range="1:" level="fatal" />
  </stdio>


  <command> <![CDATA[
    if [ -d $__root_dir__/packages/scilab-6.1.0 ]; then $__root_dir__/packages/scilab-6.1.0/bin/scilab-cli -nb -quit -f $* < ${script_file}; else scilab-cli -nb -quit -f $* < ${script_file}; fi
]]>
  </command>


   <configfiles>
    <configfile name="script_file">
        <![CDATA[ exec("$__tool_directory__/src/mz_1_out_of_k.sci",-1); ...
        exec("$__tool_directory__/src/mz_1_merge_by_k.sci",-1); ...
        lasterror(); ...
        k=${k}; ...
        option=${option}; ...
        load("${resbary_in}"); ... // the variable name must be resbary
        if option==1 then ...
            resbary_out=mz_1_out_of_k(resbary,k); ...
        else ...
            resbary_out=mz_1_merge_by_k(resbary,k); ...
        end; ...
        if ~isdef('resbary_out') then ...
           disp('resbary_out is not defined'); ...
        end; ...
        resbary=resbary_out; ...  // the variable name must be resbary
        save("${resbary_out}",'resbary'); ...
        if ~isempty(lasterror(%f)) then ...
        write(0,lasterror()); ...
        end; ]]>
    </configfile>
  </configfiles>


  <inputs>
    <param name="resbary_in"       format="mat"         type="data"      label="MS-centroid"  help="contains the fields .time et .mzdata"   />
    <param name="k"     value="1"  type="integer"     min="1"   max="100"   label="k"        help="a number of RTs"     />
  <param name="option"     value="2"  type="integer"     min="1"   max="2"   label="option"        help="1= 1 out of k RT; 2= mean of k RT"     />
</inputs>

  <outputs>
    <data name="resbary_out"   format="mat"     label="MS-compressed"  />
  </outputs>
  
  
  <tests>
  
    <test>
       <param name="resbary_in" value="VI2016_AC_4Areduit_1centroide.mat"/>
       <param name="k" value="3"/>
       <param name="option" value="1"/>
       <output name="resbary_out"   file="VI2016_AC_4Acentroide-1_k1outof3.mat" compare="sim_size" delta="1000" />
    </test>
    
    <test>
       <param name="resbary_in" value="VI2016_AC_4Areduit_1centroide.mat"/>
       <param name="k" value="3"/>
       <param name="option" value="2"/>
       <output name="resbary_out"   file="VI2016_AC_4Acentroide-1_k_3mean.mat" compare="sim_size" delta="1000" />
    </test>
    
    
    
  </tests>
  
  
  
<help>


**Authors**  Jean-Claude Boulet (INRAE).


---------------------------------------------------

============================
COMPRESSION OF A MS-CENTROID
============================


-----------
Description
-----------

This function reduces by a factor k the number of RTs and associated mass spectra. 


-----
Input
-----

**MS-centroid**

A centroid mass spectrum, at the HDF5-scilab format. 

**k**

The compression factor. 

**option**

- 1: selects one out of k RTs and associated ms.

- 2: merges by k the RTs and associated ms 


-------
Outputs
-------

**MS-compressed**

A MS-centroid similar to the input, but with k times less RTs and ms. 

</help>


<citations>

</citations>


</tool>