view erecord_file.xml @ 2:9e8f5f220917 draft

planemo upload for repository https://forgemia.inra.fr/nathalie.rousse/erecord-deploy/-/tree/main/galaxy-tools/erecord_file commit 2bd91617d46a1c454a7a167113cc605bdd1b3ff2-dirty
author siwaa
date Thu, 15 Feb 2024 14:44:47 +0000
parents 9f7e56f56079
children
line wrap: on
line source

<tool id="erecord_file" name="erecord_file" version="1.0.0">

  <description>erecord returning .json + maybe .zip or .xls</description>

  <requirements>

    <!-- singularity -->
    <container type="singularity">oras://registry.forgemia.inra.fr/nathalie.rousse/erecord-deploy/rep_recordb:9d6ea1defd50dd63fe036a7545a9ea527572192e</container>

    <!-- image locale -->
    <!-- container type="singularity">/home/nrousse/workspace_git/SIWAA_regroup/erecord-deploy/containers/_fab_SIMG/rep_recordb.simg</container-->

  </requirements>

  <command detect_errors="aggressive">
    <![CDATA[
    . /PYVENV/bin/activate;

    echo "action_name VAUT $request_condition.action_name";
    #if $request_condition.action_name == 'post_vpz_experiment':
        /bin/bash -c "python3 $__tool_directory__/main_file.py -action ${request_condition.action_name} -data ${input_json} -datafolder ${datafolder} -experimentfile ${experimentfile}";
    #elif $request_condition.action_name == 'post_vpz_report':
        /bin/bash -c "python3 $__tool_directory__/main_file.py -action ${request_condition.action_name} -data ${input_json} -datafolder ${datafolder}";
    #elif $request_condition.action_name == 'post_vpz_output':
        /bin/bash -c "python3 $__tool_directory__/main_file.py -action ${request_condition.action_name} -data ${input_json} -datafolder ${datafolder}";
    #elif $request_condition.action_name == 'post_vpz_inout':
        /bin/bash -c "python3 $__tool_directory__/main_file.py -action ${request_condition.action_name} -data ${input_json} -datafolder ${datafolder}";
    #else:
        /bin/bash -c "python3 $__tool_directory__/main_file.py -action ${request_condition.action_name} -data ${input_json}";
    #end if

    cp WS/OUT/output.json ${output_json};

    #if $request_condition.action_name == 'get_vpz_experiment':
        touch WS/OUT/experiment.xls;
        cp WS/OUT/experiment.xls ${experiment};
    #elif $request_condition.action_name == 'post_vpz_experiment':
        touch WS/OUT/experiment.xls;
        cp WS/OUT/experiment.xls ${experiment};
    #elif $request_condition.action_name == 'get_vpz_report_conditions':
        touch WS/OUT/conditions.xls;
        cp WS/OUT/conditions.xls ${conditions};
    #elif $request_condition.action_name == 'post_vpz_report_conditions':
        touch WS/OUT/conditions.xls;
        cp WS/OUT/conditions.xls ${conditions};
    #elif $request_condition.action_name == 'get_vpz_report':
        touch WS/OUT/report.zip;
        cp WS/OUT/report.zip ${report};
    #elif $request_condition.action_name == 'post_vpz_report':
        touch WS/OUT/report.zip;
        cp WS/OUT/report.zip ${report};
    #end if

    ]]>
  </command>

  <inputs>

    <param name="input_json" optional="true" type="data" format="json"
           label="Input json file"/>

    <conditional name="request_condition">

      <param name="action_name" type="select" label="Select action">
          <option value="help" selected="true">help</option>
          <option value="get_pkg_list">get_pkg_list</option>
          <option value="get_pkg_vpz_list">get_pkg_vpz_list</option>
          <option value="get_pkg_data_list">get_pkg_data_list</option>
          <option value="get_vpz_input">get_vpz_input</option>
          <option value="post_vpz_input">post_vpz_input</option>
          <option value="get_vpz_output">get_vpz_output</option>
          <option value="post_vpz_output">post_vpz_output</option>
          <option value="get_vpz_inout">get_vpz_inout</option>
          <option value="post_vpz_inout">post_vpz_inout</option>
          <option value="get_vpz_experiment">get_vpz_experiment</option>
          <option value="post_vpz_experiment">post_vpz_experiment</option>
          <option value="get_vpz_report">get_vpz_report</option>
          <option value="post_vpz_report">post_vpz_report</option>
          <option value="get_vpz_report_conditions">get_vpz_report_conditions</option>
          <option value="post_vpz_report_conditions">post_vpz_report_conditions</option>
      </param>

      <when value="post_vpz_experiment">
            
          <param name="experimentfile" type="data" format="csv,xls"
                 label="Add a experiment xls (csv) file"
                 help="experimentfile from gest_vpz_experiment + modifications"/>
          <param name="datafolder" optional="true" type="data" format="zip"
                 label="Add a datafolder zip file"
                 help="Precisions sur forme du dossier..."/>
      </when>

      <when value="post_vpz_report">
          <param name="datafolder" optional="true" type="data" format="zip"
                 label="Add a datafolder zip file"
                 help="Precisions sur forme du dossier..."/>
      </when>
      <when value="post_vpz_output">
          <param name="datafolder" optional="true" type="data" format="zip"
                 label="Add a datafolder zip file"
                 help="Precisions sur forme du dossier..."/>
      </when>
      <when value="post_vpz_inout">
          <param name="datafolder" optional="true" type="data" format="zip"
                 label="Add a datafolder zip file"
                 help="Precisions sur forme du dossier..."/>
      </when>

      <when value="get_vpz_experiment" />
      <when value="get_vpz_report_conditions" />
      <when value="post_vpz_report_conditions"/>
      <when value="get_vpz_report" />
      <when value="get_vpz_input" />
      <when value="post_vpz_input" />
      <when value="get_vpz_output" />
      <when value="get_vpz_inout" />
      <when value="get_pkg_list" />
      <when value="get_pkg_vpz_list" />
      <when value="get_pkg_data_list" />
      <when value="help" />

    </conditional>

  </inputs>

  <outputs>

    <data name="output_json" format="json" label="output_json"/>

    <data name="experiment" format="xls" label="experiment">
        <filter>request_condition['action_name'] == 'get_vpz_experiment' or request_condition['action_name'] == 'post_vpz_experiment'</filter>
    </data>

    <data name="conditions" format="xls" label="conditions.xls file">
        <filter>request_condition['action_name'] == 'get_vpz_report_conditions' or request_condition['action_name'] == 'post_vpz_report_conditions'</filter>
    </data>

    <data name="report" format="zip" label="report">
        <filter>request_condition['action_name'] == 'get_vpz_report' or request_condition['action_name'] == 'post_vpz_report'</filter>
    </data>

  </outputs>

  <tests>
  </tests>

  <help><![CDATA[

erecord_file.xml

================

Actions:

-------

- 'help'
- 'get_pkg_list' 'get_pkg_vpz_list' 'get_pkg_data_list'
- 'get_vpz_input' 'post_vpz_input'
- 'get_vpz_output' 'post_vpz_output'
- 'get_vpz_inout' 'post_vpz_inout'
- 'get_vpz_experiment' 'post_vpz_experiment'
- 'get_vpz_report_conditions' 'post_vpz_report_conditions'
- 'get_vpz_report' 'post_vpz_report'

Code:

----

- main_file.py

Inputs:

-------

- action value (mandatory)

- data json file (optional) (json file, param type="data")
  An action value that would be into data would be ignored

- experiment.xls (only in 'post_vpz_experiment' case)

- datafolder (optional) (only in cases : 
  'post_vpz_experiment', 'post_vpz_report', 'post_vpz_output', 'post_vpz_inout')

Outputs:

--------

- data json file 

- 1 other file (xls or zip) :
  - if 'action' == get_vpz_experiment, post_vpz_experiment :
    experiment.xls file
  - if 'action' == get_vpz_report_conditions, post_vpz_report_conditions :
    conditions.xls file
  - if 'action' == get_vpz_report, post_vpz_report :
    report.zip file

Credits:

--------

-  Author: Nathalie Rousse nathalie.rousse@inrae.fr
-  Copyright: INRAE

  ]]>
  </help>

</tool>