changeset 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
files test-data/consolidate_vcf/v1.bcf.gz test-data/consolidate_vcf/v2.bcf.gz test-data/expected_fasta.fasta test-data/expected_phylip.phy test-data/expected_positions.tsv test-data/expected_stats.csv test-data/reference.fasta vcf2snvalignment.xml
diffstat 8 files changed, 114 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file test-data/consolidate_vcf/v1.bcf.gz has changed
Binary file test-data/consolidate_vcf/v2.bcf.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/expected_fasta.fasta	Tue Aug 27 12:33:24 2019 -0400
@@ -0,0 +1,6 @@
+>ref
+T
+>v1
+A
+>v2
+C
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/expected_phylip.phy	Tue Aug 27 12:33:24 2019 -0400
@@ -0,0 +1,5 @@
+ 3 1
+      'ref'  T
+       'v1'  A
+       'v2'  C
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/expected_positions.tsv	Tue Aug 27 12:33:24 2019 -0400
@@ -0,0 +1,2 @@
+#Chromosome	Position	Status	Reference	v1	v2
+ref	2	valid	T	A	C
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/expected_stats.csv	Tue Aug 27 12:33:24 2019 -0400
@@ -0,0 +1,3 @@
+#Reference name	Total length	Total invalid and excluded positions	Total valid and included positions	Total valid and included positions in core genome	Percentage of valid and included positions in core genome	Percentage of all positions that are valid, included, and part of the core genome
+ref	4	N/A	4	4	100.00	100.00
+all	4	N/A	4	4	100.00	100.00
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/reference.fasta	Tue Aug 27 12:33:24 2019 -0400
@@ -0,0 +1,2 @@
+>ref
+atgc
--- /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>