view COBRAxy/ras_to_bounds.xml @ 78:3321ab15610c draft

Uploaded
author luca_milaz
date Sun, 13 Oct 2024 09:34:46 +0000
parents 7476467061db
children 9df36ff21790
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__
        --model_selector $cond_model.model_selector
        --cell_class $cell_class
        #if $cond_model.model_selector == 'Custom'
            --model $model
            --model_name $model.element_identifier
        #end if
        --medium_selector $cond_medium.medium_selector
        #if $cond_medium.medium_selector == 'Custom'
            --medium $medium
        #end if
        --ras_selector $cond_ras.ras_choice
        #if $cond_ras.ras_choice == "True"
        	--input_ras $cond_ras.input_ras
            #set $names = ""
            #for $input_temp in $cond_ras.input_ras:
                #set $names = $names + $input_temp.element_identifier + ","
            #end for
            --names $names
        #end if
        --out_log $log
        ]]>
    </command>
    <inputs>
        <conditional name="cond_model">
            <expand macro="options_ras_to_bounds_model"/>
            <when value="Custom">
                <param name="model" argument="--model" type="data" format="json, xml" label="Custom model" />
            </when>
        </conditional> 

        <conditional name="cond_ras">
			<param name="ras_choice" argument="--ras_choice" type="select" label="Do want to use RAS?">
                	<option value="True" selected="true">Yes</option>
                	<option value="False">No</option>
        	</param>
            <when value="True">
                <param name="input_ras" argument="--input_ras" multiple="true" type="data" format="tabular, csv, tsv" label="RAS matrix:" />
            </when>
        </conditional>  
        
        <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" />
            </when>
        </conditional> 

    </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>

    </outputs>

    <help>

    <![CDATA[

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

This tool generates the reactions bounds for a given metabolic model (JSON or XML format) both with and without the use of the Reaction Activity Scores (RAS) matrix generated by RAS generator.
Moreover, it enables to use custom/pre-defined growth mediums to constrain exchange reactions. For a custom medium, It is suggested to use the template file returned by the Custom Data Generator tool.
If the RAS matrix, generated by the RAS generator tool, is used, then a bounds file is generated for each cell. Otherwise, a single bounds file is returned.

Accepted files:
    - A model: JSON or XML file reporting reactions and rules contained in the model.   
    - RAS matrix: tab-separated RAS file as returned by RAS generator. Multiple RAS files 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.
    - Medium: tab-separated file containing lower and upper-bounds of medium reactions.

Example of custum growth medium file:


+------------+----------------+----------------+
| Reaction ID|   lower_bound  |   upper_bound  |  
+============+================+================+
| r1         |    0.123167    |    0.371355    | 
+------------+----------------+----------------+   
| r2         |    0.268765    |    0.765567    |  
+------------+----------------+----------------+   

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:
    - bounds: reporting the bounds of the model, or cells if RAS is used. Format: tab-separated.
    - Classes: a file containing the class of each cell (only if multiple RAS matrices were uploaded). The class name of a RAS matrix corresponds to its file name. Format: tab-separated.
    - a log file (.txt).
    ]]>
    </help>
    <expand macro="citations" />
</tool>