diff consolidate_vcfs.xml @ 0:b42c82186e85 draft

"planemo upload for repository https://github.com/phac-nml/snvphyl-galaxy commit 90a172f1fc12b9c4d73f4c924a8c0c5a559589d0"
author nml
date Tue, 27 Aug 2019 12:30:25 -0400
parents
children 4c249c0aebad
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/consolidate_vcfs.xml	Tue Aug 27 12:30:25 2019 -0400
@@ -0,0 +1,115 @@
+<tool id="consolidate_vcfs" name="Consolidate VCFs" version ="1.8.2">
+  <description>combine freebayes and mpileup files for use by vcf2snvalignment</description>
+    <requirements>
+      <requirement type="package" version="1.8.2">snvphyl-tools</requirement>
+    </requirements>
+  <command detect_errors="exit_code"><![CDATA[
+
+        #set $name = str($freebayes).split('/')[-1]
+         ln -f -s $freebayes &&
+
+        #if $freebayes.metadata.bcf_index:
+          ln -s '${$freebayes.metadata.bcf_index}' ${name}.csi &&
+        #else
+	  bcftools index $name &&
+	#end if
+
+
+        #set $name = str($mpileup).split('/')[-1]
+         ln -f -s $mpileup &&
+
+        #if $mpileup.metadata.bcf_index:
+          ln -s '${$mpileup.metadata.bcf_index}' ${name}.csi &&
+        #else
+	  bcftools index $name &&
+	#end if
+
+        consolidate_vcfs.pl
+
+
+        -c "$coverage"
+      	--min-mean-mapping "$mean_mapping"
+      	--snv-abundance-ratio "$snv_abundance_ratio"
+
+        #set $path = str($freebayes).split('/')[-1]
+        --vcfsplit "$path"
+
+        #set $path = str($mpileup).split('/')[-1]
+        --mpileup "$path"
+
+        #set $path = str($path).split('/')[-1]
+        #if $filtered_density:
+          --filtered-density-out "$filtered_density"
+        #end if
+
+        #if $use_density_filter.select_list == "no":
+          --skip-density-filter
+        #else
+          #if $use_density_filter.window_size:
+            --window-size "$use_density_filter.window_size"
+          #end if
+          #if $use_density_filter.threshold:
+            --density-threshold "$use_density_filter.threshold"
+          #end if
+        #end if
+
+        ##mark where the output files will be sent to, simply have to match them up later in the xml output section
+        -o $bcf_combined
+  ]]>
+  </command>
+  <inputs>
+    <param name="coverage" type="integer" value="15" label="Minimum coverage"/>
+    <param name="mean_mapping" type="integer" value="30" label="Minimum mean mapping quality"/>
+    <param name="snv_abundance_ratio" type="text" value="0.75" optional="false" label="SNV abundance ratio"/>
+    <param name="freebayes" type="data" label="FreeBayes filtered BCF" help="" optional="false" format="bcf_bgzip,bcf" />
+    <param name="mpileup" type="data" label="Mpileup BCF" help="" optional="false" format="bcf_bgzip,bcf" />
+    <conditional name="use_density_filter">
+      <param name="select_list" type="select" label= "SNV density filtering">
+        <option value="yes">Apply</option>
+        <option value="no">Don't apply</option>
+      </param>
+      <when value="yes">
+        <param name="window_size" type="integer" label="Size of search window" format="" optional="false" value="100"/>
+        <param name="threshold"  type="integer" label="Density threshold cutoff" format="" optional="false" value="10"/>
+      </when>
+      <when value="no">
+      </when>
+    </conditional>
+  </inputs>
+  <outputs>
+    <data format="bcf_bgzip" name="bcf_combined"/>
+    <data format="txt" name="filtered_density" label="High density regions"/>
+  </outputs>
+  <tests>
+    <test>
+      <param name="coverage" value="5"/>
+      <param name="freebayes" value="freebayes/v1.bcf" />
+      <param name="mpileup" value="mpileup/v1.bcf" />
+      <param name="mean_mapping" value="30" />
+      <param name="snv_abundance_ratio" value="0.75" />
+      <param name="window_size" value="500" />
+      <param name="threshold" value="2" />
+      <output name="bcf_combined" file="v1.bcf.gz" compare="sim_size" delta="500"/>
+      <output name="filtered_density" file="expected_regions.txt"/>
+    </test>
+    <test>
+      <param name="coverage" value="5"/>
+      <param name="freebayes" value="freebayes/v2.bcf" />
+      <param name="mpileup" value="mpileup/v2.bcf" />
+      <param name="mean_mapping" value="30" />
+      <param name="snv_abundance_ratio" value="0.75" />
+      <param name="window_size" value="500" />
+      <param name="threshold" value="2" />
+      <output name="bcf_combined" file="v2.bcf.gz" compare="sim_size" delta="500"/>
+      <output name="filtered_density" file="expected_regions.txt"/>
+    </test>
+  </tests>
+
+  <help>
+  Merges variant and non-variant calls (in VCF format) produced from two independent base callers, FreeBayes, and SAMtools/BCFtools. Produces a merged set of high-quality variant and non-variant calls (in BCF format).  Optionally, produces a list of SNV-dense regions above the passed thresholds.
+  </help>
+
+  <citations>
+  </citations>
+
+</tool>