view COBRAxy/ras_to_bounds.xml @ 530:352c51a39e23 draft

Uploaded
author francesco_lapi
date Wed, 22 Oct 2025 12:18:07 +0000
parents 97eea560a10f
children fd53d42348bd
line wrap: on
line source

<tool id="MaREA RAS to bounds" name="RAStoBounds" 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>
        <requirement type="package" version="1.4.2">joblib</requirement>
	</requirements>

    <command detect_errors="exit_code">
        <![CDATA[
      	python $__tool_directory__/ras_to_bounds.py
        --tool_dir $__tool_directory__
        --cell_class $cell_class
        --model_upload $model_upload
        #set $names = ""
        --input_ras "${",".join(map(str, $input_ras))}"
        #for $input_temp in $input_ras:
            #set $names = $names + $input_temp.element_identifier + ","
        #end for

        --save_models $save_models
        --save_models_path saved_models/
        --name "$names"
        --out_log $log
        ]]>
    </command>
    <inputs>

        <param name="model_upload" argument="--model_upload" type="data" format="csv,tsv,tabular" multiple="false"
                label="Model tabular file:" help="Upload a CSV/TSV file containing information generated by the Model Initialization tool." />

        <param name="input_ras" argument="--input_ras" multiple="true" type="data" format="tabular, csv, tsv" label="RAS matrix:" />


        <param name="save_models" argument="--save_models" type="select" label="Save models with applied bounds?">
            <option value="False" selected="true">No</option>
            <option value="True">Yes</option>
        </param>

    </inputs>

    <outputs>
        <data format="txt" name="log" label="RAStoBounds- Log" />
        <data format="tabular" name="cell_class" label="RAStoBounds - Cells class" />
        <collection name="ras_to_bounds" type="list" label="Ras to Bounds">
            <discover_datasets name = "collection" pattern="__name_and_ext__" directory="ras_to_bounds"/>
        </collection>
        <collection name="saved_models" type="list" label="Saved Models (Tabular Format)">
            <filter>save_models == "True"</filter>
            <discover_datasets name = "saved_models_collection" pattern="__name_and_ext__" directory="saved_models"/>
        </collection>
    </outputs>

    <help>

    <![CDATA[

What it does
-------------

This tool generates the reaction bounds for a given tabular model created by the Metabolic Model Setting Tool and the Reaction Activity Scores (RAS) matrix generated by the RAS Generator.


Accepted files:
    - A tabular model: tab-separated file containing information about a metabolic model.
    - RAS matrix: tab-separated RAS file as returned by RAS generator. Multiple RAS files having different file name can be uploaded too (e.g. one RAS matrix for normal cells and one for cancer cells). Note that if multiple RAs matrices are uploaded, the bounds are normalzed across all cells.

	
Example for multiple RAS matrices:
    - cancer.csv and normal.csv generated by RAS generator tool (the two class names are 'cancer' and 'normal').
    - This tool returns one unique collection of bounds files for both cancer and normal cells (normalization is performed across all cells).
    - The association cell-class is reported in the 'cell_class' file that is useful to perform flux enrichment analysis based on class partenrship.

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

The tool generates:
    - A collection of tab files, one for each sample. Each file contains the lower and upper bounds computed from the RAS values and the FVA, used to perform flux sampling or optimization.
    - Classes: a file containing the class of each sample. The class name of a RAS matrix corresponds to its file name. Format: tab-separated.
    - a log file (.txt).
    ]]>
    </help>
    <expand macro="citations" />

</tool>