diff gem_knockout.xml @ 0:1cea77c3c471 draft default tip

planemo upload for repository https://github.com/AlmaasLab/elixir-galaxy-tools-systemsbiology commit 3f7bec1264a86e1488ee1315dbac0f44675f5171
author iuc
date Fri, 13 Dec 2024 21:33:47 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gem_knockout.xml	Fri Dec 13 21:33:47 2024 +0000
@@ -0,0 +1,128 @@
+<tool id="gem_knockout" name="Gene knockout analysis" version="@VERSION@" profile="@PROFILE@">
+    <description>
+        on a GEM
+    </description>
+    <macros>
+        <import>gem_macros.xml</import>
+    </macros>
+    <expand macro="requirements"/>
+    <expand macro="version_command_cobra"/>
+    <command>
+        python '$__tool_directory__/gem_knockout.py'
+        --cb_model_location '${cb_model_location}'
+        --output '${output}'
+        --knockout_type '${knockout_type}'
+        #if $gene_knockouts:
+            --gene_knockouts '${gene_knockouts}'
+        #end if
+        #if $uptake_constraints_file:
+            --uptake_constraints_file '${uptake_constraints_file}'
+        #end if
+    </command>
+    <inputs>
+        <expand macro="input_model"/>
+        <param name="knockout_type" type="select" label="Type of knockout analysis">
+            <option value="single">Single gene knockouts</option>
+            <option value="double">Double gene knockouts</option>
+        </param>
+        <param name="gene_knockouts" type="text" optional="true" label="Specific genes to knockout (comma-separated)" help="Leave empty to analyze all genes">
+            <validator type="regex" message="Genes must be comma-separated, alphanumeric, and underscore characters only">^([a-zA-Z0-9_]+,?)+$</validator>
+        </param>
+        <expand macro="input_uptake_constraints"/>
+    </inputs>
+    <outputs>
+        <expand macro="output"/>
+    </outputs>
+    <tests>
+        <!-- Test 1: Single gene knockout analysis -->
+        <test>
+            <param name="cb_model_location" value="textbook_model_cobrapy.xml"/>
+            <param name="knockout_type" value="single"/>
+            <output name="output" file="expected_single_knockout.csv"/>
+        </test>
+        <!-- Test 2: Single gene knockout analysis with specific genes -->
+        <test>
+            <param name="cb_model_location" value="textbook_model_cobrapy.xml"/>
+            <param name="knockout_type" value="single"/>
+            <param name="gene_knockouts" value="b0351,b2296"/>
+            <output name="output">
+                <assert_contents>
+                    <has_line line="reaction_id;ko_gene_id_1;ko_gene_id_2;reaction;wildtype_flux;knockout_flux"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- Test 3: Double gene knockout analysis -->
+        <test>
+            <param name="cb_model_location" value="textbook_model_cobrapy.xml"/>
+            <param name="knockout_type" value="double"/>
+            <param name="gene_knockouts" value="b0351,b2296,b1849"/>
+            <output name="output">
+                <assert_contents>
+                    <has_line line="reaction_id;ko_gene_id_1;ko_gene_id_2;reaction;wildtype_flux;knockout_flux"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- Test 4: Single gene knockout analysis with uptake constraints -->
+        <test>
+            <param name="cb_model_location" value="textbook_model_cobrapy.xml"/>
+            <param name="knockout_type" value="single"/>
+            <param name="uptake_constraints_file" value="textbook_model_cobrapy_exchange.csv"/>
+            <output name="output">
+                <assert_contents>
+                    <has_line line="reaction_id;ko_gene_id_1;ko_gene_id_2;reaction;wildtype_flux;knockout_flux"/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- Test 5: Double gene knockout analysis with invalid model file -->
+        <test expect_failure="true">
+            <param name="cb_model_location" value="invalid_format.txt"/>
+            <assert_stderr>
+                <has_text text="The model could not be read"/>
+            </assert_stderr>
+        </test>
+        <!-- Test 5: Double gene knockout analysis with invalid gene names -->
+        <test expect_failure="true">
+            <param name="cb_model_location" value="textbook_model_cobrapy.xml"/>
+            <param name="knockout_type" value="double"/>
+            <param name="gene_knockouts" value="abc,123"/>
+            <assert_stderr>
+                <has_text text="One or more of the genes to knockout are not present in the model"/>
+            </assert_stderr>
+        </test>
+    </tests>
+    <help><![CDATA[
+        Gene Knockout Analysis
+
+        This tool performs single or double gene knockout analysis on a Genome-scale Metabolic Model (GEM) using Flux Balance Analysis (FBA).
+
+        Input Parameters
+
+        **Model File**: A GEM in SBML format (.xml) that will be analyzed.
+
+        **Knockout Type**: Choose between:
+        - Single gene knockouts: Analyze the effect of removing one gene at a time
+        - Double gene knockouts: Analyze the effect of removing pairs of genes
+
+        **Genes to Knockout** (optional): Specify particular genes to analyze. If left empty, all genes in the model will be analyzed.
+
+        **Uptake Constraints File** (optional): A CSV file specifying constraints for exchange reactions.
+
+        Output
+        
+        The tool generates a CSV file containing:
+        - Reaction IDs
+        - Knocked out gene(s)
+        - Reaction formulas
+        - Wildtype flux values
+        - Knockout flux values
+
+        Common Issues
+        
+        - Ensure your model is well-formatted
+        - Verify that specified genes exist in the model
+        - Large models may require significant computation time, especially for double knockouts
+    ]]></help>
+    <citations>
+        <expand macro="citation_cobrapy"/>
+    </citations>
+</tool>