diff vcf2snvalignment.xml @ 0:7d66bf698382 draft

"planemo upload for repository https://github.com/phac-nml/snvphyl-galaxy commit 90a172f1fc12b9c4d73f4c924a8c0c5a559589d0"
author nml
date Tue, 27 Aug 2019 12:33:24 -0400
parents
children d2096d0c149e
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vcf2snvalignment.xml	Tue Aug 27 12:33:24 2019 -0400
@@ -0,0 +1,96 @@
+<tool id="vcf2snvalignment" name="VCF 2 snvalignment" version ="1.8.2">
+  <description>create a snv alignment from multiple merged VCF files</description>
+  <requirements>
+    <requirement type="package" version="1.8.2">snvphyl-tools</requirement>
+  </requirements>
+  <command detect_errors="exit_code"><![CDATA[
+
+
+        #for $f in $vcf_collection.keys#
+          #set $name = str($vcf_collection[$f]).split('/')[-1]
+          ln -f -s '$vcf_collection[$f]' &&
+
+          #if $vcf_collection[$f].metadata.bcf_index:
+	     ln -s '${$vcf_collection[$f].metadata.bcf_index}' ${name}.csi &&
+	  #else
+	     bcftools index $name &&
+	  #end if
+        #end for#
+
+        vcf2snv_alignment.pl
+
+        -r "$reference"
+        #if str($invalid) != 'None':
+              --invalid-pos "$invalid"
+        #end if
+        -f fasta
+        -f phylip
+        --numcpus \${GALAXY_SLOTS:-2}
+        --fasta "$ref_fasta"
+
+        #for $f in $vcf_collection.keys#
+          #set $path = str($vcf_collection[$f]).split('/')[-1]
+          --consolidate_vcf "$f=$path"
+        #end for#
+
+        #if $strain_list.select_list == "include":
+              --include '$strain_list.include'
+        #elif $strain_list.select_list == "exclude":
+              --exclude '$strain_list.exclude'
+        #end if
+
+        ##mark where the output files will be sent to, simply have to match them up later in the xml output section
+        -o 'snvalign'
+  ]]>
+  </command>
+  <inputs>
+    <param name="reference" type="text"  label="Reference Name" value='reference' />
+    <param name="ref_fasta" type="data"  label="Reference Fasta File" format="fasta"/>
+    <param name="invalid" type="data"  label="Invalid position file" format="gff,bed" optional="true"/>
+    <conditional name="strain_list">
+      <param name="select_list" type="select" label="Strain Selecting options">
+        <option value="all">Use all strains in collection</option>
+        <option value="include">Provide list of subset of strains to only include</option>
+        <option value="exclude">Provide list of subset of strains to exclude</option>
+      </param>
+      <when value="include">
+        <param name="include" type="data"  label="List of strains to be include" format="text" optional="false"/>
+      </when>
+      <when value="exclude">
+        <param name="exclude" type="data"  label="List of strains to be excluded" format="text" optional="false"/>
+      </when>
+      <when value="all"/>
+    </conditional>
+    <param name="vcf_collection" type="data_collection" label="Combined VCF Files" help="" optional="false" format="bcf,bcf_bgzip" collection_type="list" />
+  </inputs>
+  <outputs>
+    <data format="tabular" name="positions" from_work_dir="snvalign-positions.tsv" />
+    <data format="fasta" name="fasta" from_work_dir="snvalign.fasta"/>
+    <data format="phylip" name="phylip" from_work_dir="snvalign.phy" />
+    <data format="tabular" name="vcf2core" from_work_dir="snvalign-stats.csv" />
+  </outputs>
+  <tests>
+    <test>
+      <param name="reference" value="ref"/>
+      <param name="ref_fasta" value="reference.fasta"/>
+      <param name="vcf_collection">
+        <collection type="list">
+          <element name="v1" value="consolidate_vcf/v1.bcf.gz"/>
+          <element name="v2" value="consolidate_vcf/v2.bcf.gz"/>
+        </collection>
+      </param>
+      <output name="positions" file="expected_positions.tsv"/>
+      <output name="fasta" file="expected_fasta.fasta"/>
+      <output name="phylip" file="expected_phylip.phy"/>
+      <output name="vcf2core" file="expected_stats.csv"/>
+    </test>
+  </tests>
+
+  <help>
+  Produces an alignment of SNVs from the merged variant/non-variant calls produced from the "consolidate_vcfs" tool.
+  </help>
+
+  <citations>
+  </citations>
+
+</tool>