view custom_data_generator.xml @ 345:5725e5bcccf9 draft

Uploaded
author francesco_lapi
date Thu, 04 Sep 2025 22:10:56 +0000
parents eff58e727e4b
children
line wrap: on
line source

<tool id="CustomDataGenerator" name="Custom Data Generator" version="2.0.0">
    
    <macros>
        <import>marea_macros.xml</import>
    </macros>

	<requirements>
        <requirement type="package" version="1.24.4">numpy</requirement>
        <requirement type="package" version="2.0.3">pandas</requirement>
		<requirement type="package" version="0.29.0">cobra</requirement>
        <requirement type="package" version="5.2.2">lxml</requirement>
	</requirements>

    <command detect_errors="exit_code">
        <![CDATA[
      	python $__tool_directory__/custom_data_generator.py
        --medium_selector $cond_medium.medium_selector
        --output_format $output_format
        #if $cond_model.model_selector == 'Custom_model'
            --input $cond_model.input
            --name $cond_model.name
        #else
            --model $cond_model.model_selector
            --name $cond_model.model_selector
        #end if
        #if $cond_medium.medium_selector == 'Custom'
            --medium $cond_medium.medium
        #end if
        --out_log $log
        --out_data $out_data
        ]]>
    </command>
    <inputs>
        <!-- modello -->
        <conditional name="cond_model">
            <expand macro="options_model"/>
            <when value="Custom_model">
                <param name="input" argument="--input" type="data" format="json,xml" label="Custom model file:" />
                <param name="name" argument="--name" type="text" label="Model's name:" value="CustomModel" help="Default: CustomModel. Do not use spaces or special symbols." />
            </when>
        </conditional>

        <!-- formato output -->
        <param name="output_format" argument="--output_format" type="select" label="Output format:">
            <option value="tabular" selected="true">CSV (tabular)</option>
            <option value="xlsx">Excel (.xlsx)</option>
        </param>

        <!-- medium -->
        <conditional name="cond_medium">
            <expand macro="options_ras_to_bounds_medium"/>
            <when value="Custom">
                <param name="medium" argument="--medium" type="data" format="tabular,csv,tsv" label="Custom medium file:" />
            </when>
        </conditional> 
    </inputs>

    <outputs>
        <data name="log" format="txt" label="CustomDataGenerator - Log" />
        <data name="out_data" format="$output_format" label="${cond_model.model_selector}_data" />
    </outputs>

    <help>
    <![CDATA[
What it does
-------------

This tool generates four files containing reactions, rules, reaction bounds and medium composition respectively, starting from a custom model in JSON or XML format.
Reactions and rules can be used as inputs for the RAS and RPS generator tools.

Accepted files:
    - A model: JSON or XML file reporting reactions and rules contained in the model. Supported compressed formats: .zip, .gz and .bz2 - Filename must end with .json.zip (.xml.zip), .json.gz (.xml.gz) or .json.bz2 (.xml.bz2) for JSON (XML) files.   


Output:
-------------

The tool generates:
    - rules: reporting the rules for each reaction in the custom model given. Format: csv (tab separated).
    - reactions: reporting the reactions in the custom model given. Format: csv (tab separated).
    - reaction bounds: reporting the lower and upper bounds of each model reaction. Format: csv (tab separated).
    - medium composition: reporting the list of exchange/transport reactions. Format: csv (tab separated).
    - a log file (.txt).
    ]]>
    </help>
    <expand macro="citations" />
</tool>