changeset 3:e0734e88a104 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vardict commit 80e3742f499e8efabad1fe7627201466d0bdd190"
author iuc
date Thu, 27 Jan 2022 15:19:23 +0000
parents d262577e04b0
children
files macros.xml split.py vardict.xml
diffstat 3 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/macros.xml	Tue Nov 16 19:05:56 2021 +0000
+++ b/macros.xml	Thu Jan 27 15:19:23 2022 +0000
@@ -1,5 +1,5 @@
 <macros>
-    <token name="@VERSION_SUFFIX@">0</token>
+    <token name="@VERSION_SUFFIX@">1</token>
     <token name="@TOOL_VERSION@">1.8.3</token>
     <xml name="ref_select">
         <conditional name="reference_source">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/split.py	Thu Jan 27 15:19:23 2022 +0000
@@ -0,0 +1,16 @@
+import sys
+
+
+fai = sys.argv[1]
+chunk_size = int(sys.argv[2])
+overlap = int(sys.argv[3])  # Base pairs
+with open(fai, 'r') as infile:
+    for line in infile:
+        name = line.split('\t')[0]
+        stop = int(line.split('\t')[1])
+        start = 1
+        while start < stop:
+            start = max(1, start - overlap)
+            print('\t'.join([name, str(start),
+                             str(min(start + chunk_size, stop))]))
+            start += chunk_size
--- a/vardict.xml	Tue Nov 16 19:05:56 2021 +0000
+++ b/vardict.xml	Thu Jan 27 15:19:23 2022 +0000
@@ -4,6 +4,7 @@
         <import>macros.xml</import>
     </macros>
     <requirements>
+        <requirement type="package" version="3.10.2">python</requirement>
         <requirement type="package" version="@TOOL_VERSION@">vardict-java</requirement>
         <requirement type="package" version="5.1.0">gawk</requirement>
         <requirement type="package" version="1.14">samtools</requirement>
@@ -32,7 +33,7 @@
         #else
             ln -s ./ref.fa.fai ./chromosomes.fa.fai &&
         #end if
-        awk 'BEGIN {FS=OFS="\t"} {print $1, "1", $2}' ./chromosomes.fa.fai > ./regions.bed &&
+        python '$__tool_directory__/split.py' ./chromosomes.fa.fai "\${VARDICT_CHUNKSIZE:-1000000}" "\${VARDICT_OVERLAP:-150}" > ./regions.bed &&
 
         vardict-java
         #if $select_mode.mode == "paired"
@@ -128,6 +129,7 @@
                 <param name="reference_source_selector" value="history"/>
                 <param name="ref_file" ftype="fasta" value="genome.fasta" />
             </conditional>
+
             <output name="all_variants" compare="re_match_multiline" file="all_variants_paired.vcf" />
             <output name="passed_variants" compare="re_match_multiline" file="passed_variants_paired.vcf" />
         </test>
@@ -141,6 +143,7 @@
                 <param name="reference_source_selector" value="cached"/>
                 <param name="ref_file" value="test_buildid"/>
             </conditional>
+
             <output name="all_variants" compare="re_match_multiline" file="all_variants_paired.vcf" />
             <output name="passed_variants" compare="re_match_multiline" file="passed_variants_paired.vcf" />
         </test>