changeset 2:912a3a3dc082 draft

"planemo upload for repository https://github.com/public-health-bioinformatics/galaxy_tools/blob/master/tools/screen_abricate_report commit 2ec76aac2fcf466fc16091bfff8b7cb83fd92467"
author public-health-bioinformatics
date Thu, 19 Dec 2019 20:31:11 -0500
parents 4f963b583186
children 2262e531c50b
files screen_abricate_report.xml
diffstat 1 files changed, 46 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/screen_abricate_report.xml	Tue Nov 12 21:44:45 2019 -0500
+++ b/screen_abricate_report.xml	Thu Dec 19 20:31:11 2019 -0500
@@ -1,35 +1,72 @@
-<tool id="screen_abricate_report" name="Screen Abricate Report" version="0.1.0">
+<tool id="screen_abricate_report" name="Screen Abricate Report" version="0.2.0">
     <description>Screens an abricate report for genes of interest</description>
     <requirements>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
         '${__tool_directory__}/screen_abricate_report.py'
              '${abricate_report}'
-             --screening_file '${screening_file.fields.path}'
+             #if str( $screening_file_source.screening_file_source_selector ) == "tool_data_table":
+               #set $input_screening_file = str( $screening_file_source.screening_file.fields.path )
+             #else:
+               #set $input_screening_file = str( $screening_file_source.screening_file )
+             #end if
+             --screening_file '${input_screening_file}'
              --screened_report '${screened_report}'
-             --gene_detection_status '${gene_detection_status}'
+             --gene_detection_status '${gene_detection_status}' &&
+             cp '${input_screening_file}' '${output_screening_file}'
     ]]></command>
     <inputs>
+        <conditional name="screening_file_source">
+            <param name="screening_file_source_selector" type="select" label="Select a gene screening file from your history or use one from a tool data table?"
+                   help="Screening files must be stored in the 'abricate_report_screening_files' tool data table">
+                <option value="tool_data_table">From tool data table</option>
+                <option value="history">From history</option>
+            </param>
+            <when value="tool_data_table">
+                <param name="screening_file" type="select" format="tabular">
+	            <options from_data_table="abricate_report_screening_files">
+	                <validator type="no_options" message="No abricate report screening files are available" />
+                    </options>
+	        </param>
+            </when>
+            <when value="history">
+                <param name="screening_file" type="data" format="tabular" label="Gene screening file" help="A two-column tab-delimited file with gene names and regular expressions" />
+            </when>
+        </conditional>
         <param name="abricate_report" type="data" format="tabular" />
-        <param name="screening_file" type="select" format="tabular">
-	    <options from_data_table="abricate_report_screening_files">
-	        <validator type="no_options" message="No abricate report screening files are available" />
-            </options>
-	</param>
     </inputs>
     <outputs>
         <data name="screened_report" format="tabular" label="Screened Abricate Report" />
         <data name="gene_detection_status" format="tabular" label="Gene Detection Status" />
+        <data name="output_screening_file" format="tabular" />
     </outputs>
     <tests>
         <test>
-            <param name="screening_file" value="test_entry"/>
+            <param name="screening_file_source.screening_file_source_selector" value="tool_data_table" />
+            <param name="screening_file_source.screening_file" value="test_entry"/>
+            <param name="abricate_report" value="SAMN13042171_abricate_report.tsv"/>
+	    <output name="screened_report" file="SAMN13042171_abricate_report_screened.tsv" ftype="tabular"/>
+	    <output name="gene_detection_status" file="SAMN13042171_gene_detection_status.tsv" ftype="tabular"/>
+        </test>
+        <test>
+            <param name="screening_file_source.screening_file_source_selector" value="history" />
+            <param name="screening_file_source.screening_file" value="screening_file.tsv"/>
             <param name="abricate_report" value="SAMN13042171_abricate_report.tsv"/>
 	    <output name="screened_report" file="SAMN13042171_abricate_report_screened.tsv" ftype="tabular"/>
 	    <output name="gene_detection_status" file="SAMN13042171_gene_detection_status.tsv" ftype="tabular"/>
         </test>
     </tests>
     <help><![CDATA[
+    This tool is used to filter (ie. 'screen') an abricate report to only include 
+    specific genes of interest. 
+
+    A list of genes is supplied in a 'screening file', which is a two-column .tsv 
+    with headers 'gene_name' and 'regex'. The first column gives the name of the 
+    gene of interest, and the second column is a regular expression that can be used 
+    to identify examples of that gene in the 'GENE' column of the abricate report.
+
+    For example, one might use the regex 'KPC\-{d+}' to identify all alleles of the 
+    KPC gene (KPC-2, KPC-3, KPC-4, ..., KPC-10, ...)
     ]]></help>
     <citations>
     </citations>