changeset 1:f3485a9e51a3 draft

Uploaded
author greg
date Wed, 22 Nov 2023 20:04:57 +0000
parents 6b0a13deae92
children 610251aac6ef
files cfsan_snp_pipeline_snp_matrix.xml macros.xml
diffstat 2 files changed, 11 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/cfsan_snp_pipeline_snp_matrix.xml	Fri Oct 13 20:26:32 2023 +0000
+++ b/cfsan_snp_pipeline_snp_matrix.xml	Wed Nov 22 20:04:57 2023 +0000
@@ -5,30 +5,23 @@
     </macros>
     <expand macro="requirements"/>
     <command detect_errors="exit_code"><![CDATA[
-python '$__tool_directory__/snp_wind.py' ./
-#if str($input_type_cond.input_type) == 'single':
-    -n '$input_fasta.element_identifier'
-    -f '$input_fasta'
+#if str($reference_cond.reference_source) == 'cached'
+    set reference = '$reference_cond.reference.fields.path'
 #else:
-    #for $fa in sorted($input_fasta_collection, key=lambda f: f.element_identifier)
-        -n '$fa.element_identifier'
-        -f '$fa'
-    #end for
+    set reference = '$reference_cond.reference'
 #end if
--p 'consensus.fasta' > ./file &&
+
+python '$__tool_directory__/snp_wind.py' ./ -p 'consensus.fasta'
+#for $fa in sorted($input_fasta_collection, key=lambda f: f.element_identifier):
+    -n '$fa.element_identifier' -f '$fa'
+#end for
+> ./file &&
 cfsan_snp_pipeline snp_matrix -o '$output_snp_matrix_fasta' ./file &&
 cfsan_snp_pipeline distance -p '$output_snp_pairwise_matrix_tsv' -m '$output_snp_distance_matrix_tsv' '$output_snp_matrix_fasta' &&
-cfsan_snp_pipeline snp_reference
--l '$input_merged_snp_sites'
--o '$output_snp_reference_fasta'
-#if str($reference_cond.reference_source) == 'cached'
-    '$reference_cond.reference.fields.path'
-#else:
-    '$reference_cond.reference'
-#end if
+cfsan_snp_pipeline snp_reference -l '$input_merged_snp_sites' -o '$output_snp_reference_fasta' '$reference'
     ]]></command>
     <inputs>
-        <expand macro="input_type_cond"/>
+        <param name="input_fasta_collection" type="data_collection" format="fasta" collection_type="list" label="Collection of fasta files"/>
         <expand macro="reference_cond"/>
         <param name="input_merged_snp_sites" type="data" format="tabular" label="Merged SNP sites tabular file"/>
     </inputs>
@@ -40,7 +33,6 @@
     </outputs>
     <tests>
         <test>
-            <param name="input_type" value="collection"/>
             <param name="input_fasta_collection">
                 <collection type="list">
                     <element name="sample1" value="input1.fasta"/>
--- a/macros.xml	Fri Oct 13 20:26:32 2023 +0000
+++ b/macros.xml	Wed Nov 22 20:04:57 2023 +0000
@@ -8,20 +8,6 @@
             <requirement type="package" version="3.6.8">python</requirement>
         </requirements>
     </xml>
-    <xml name="input_type_cond">
-        <conditional name="input_type_cond">
-            <param name="input_type" type="select" label="Choose the category for the files to be analyzed">
-                <option value="single" selected="true">Single files</option>
-                <option value="collection">Collection of files</option>
-            </param>
-            <when value="single">
-                <param name="input_fasta" type="data" format="fasta" label="FASTA file"/>
-            </when>
-            <when value="collection">
-                <param name="input_fasta_collection" type="data_collection" format="fasta" collection_type="list" label="Collection of fasta files"/>
-            </when>
-        </conditional>
-    </xml>
     <xml name="reference_cond">
         <conditional name="reference_cond">
             <param name="reference_source" type="select" label="Choose the source for the reference genome">