diff ivar_trim.xml @ 22:6606a8c97889 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ivar/ commit 97f230215d53e71748c78cd21633d92143710b94
author iuc
date Wed, 06 Aug 2025 08:21:20 +0000
parents c9ef01b1cfba
children
line wrap: on
line diff
--- a/ivar_trim.xml	Thu Mar 13 09:02:49 2025 +0000
+++ b/ivar_trim.xml	Wed Aug 06 08:21:20 2025 +0000
@@ -1,32 +1,33 @@
-<tool id="ivar_trim" name="ivar trim" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
+<tool id="ivar_trim" name="ivar trim" version="@TOOL_VERSION@+galaxy1" profile="@PROFILE@">
     <description>Trim reads in aligned BAM</description>
     <macros>
         <import>macros.xml</import>
     </macros>
     <expand macro="xrefs"/>
-    <expand macro="requirements"/>
+    <expand macro="requirements">
+        <requirement type="package" version="0.1.0">viramp-hub</requirement>
+    </expand>
     <expand macro="version_command"/>
     <command detect_errors="exit_code"><![CDATA[
+        ## Prepare primer scheme and, if necessary, also amplicon info file
         #if $primer.source == 'history'
-            cp '$primer.input_bed' bed.bed &&
+            ln -s '$primer.input_bed' bed.bed &&
         #else
-            cp '$primer.cached_bed.fields.path' bed.bed &&
+            ln -s '$primer.cached_bed.fields.path' bed.bed &&
         #end if
-        python '$__tool_directory__/sanitize_bed.py' bed.bed &&
-        #if $amplicons.filter_by == 'yes' or $amplicons.filter_by == 'yes_compute'
-            #if $amplicons.filter_by == 'yes_compute':
-                python '$__tool_directory__/write_amplicon_info_file.py' bed.bed amplicon_info_raw.tsv &&
-            #else
-                ln -s '$amplicons.amplicon_info' amplicon_info_raw.tsv &&
-            #end if
-            python '$__tool_directory__/prepare_amplicon_info.py' bed.bed amplicon_info_raw.tsv amplicon_info.tsv &&
+        scheme-convert --to bed --bed-type ivar -o ivar.bed bed.bed &&
+        #if $amplicons.filter_by == 'yes_compute':
+            scheme-convert --to amplicon-info -r outer -o amplicon_info.tsv ivar.bed &&
+        #elif $amplicons.filter_by == 'yes':
+            ## just check the amplicon info file against the primer scheme and reduce it to its outer primers
+            scheme-convert -a '$amplicons.amplicon_info' --to amplicon-info -r outer -o amplicon_info.tsv ivar.bed &&
         #end if
         ln -s '$input_bam' sorted.bam &&
         ln -s '${input_bam.metadata.bam_index}' sorted.bam.bai &&
 
         ivar trim
         -i sorted.bam
-        -b bed.bed
+        -b ivar.bed
         #if $amplicons.filter_by == 'yes' or $amplicons.filter_by == 'yes_compute'
             -f amplicon_info.tsv
         #end if
@@ -113,7 +114,7 @@
         <test>
             <!-- Test with primer bed file that needs to be sanitized -->
             <param name="input_bam" value="covid19/PC00101P_sub.sorted.bam" />
-            <param name="input_bed" value="covid19/ARTIC-V1-bad.bed" />
+            <param name="input_bed" ftype="bed" value="covid19/ARTIC-V1-bad.bed" />
             <param name="inc_primers" value="true" />
             <conditional name="trimmed_length">
                 <param name="filter" value="custom" />
@@ -180,7 +181,7 @@
                 <param name="min_len" value="30" />
             </conditional>
             <assert_command>
-                <has_text text="write_amplicon_info_file" />
+                <has_text text="scheme-convert --to amplicon-info -r outer" />
             </assert_command>
             <output name="output_bam" file="sars-cov-2/sars_cov2_trimmed.bam" compare="sim_size" delta="100000"/>
         </test>