Skip to content

Commit

Permalink
Polypolish update dependencies (galaxyproject#5710)
Browse files Browse the repository at this point in the history
* update samtool dependency 1.13 > 1.19

* update version suffix and add thread option to samtools
  • Loading branch information
pimarin authored Jan 11, 2024
1 parent 1a763e3 commit 2a8a85c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 8 additions & 3 deletions tools/polypolish/macro.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@

<macros>
<token name="@TOOL_VERSION@">0.5.0</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@VERSION_SUFFIX@">2</token>
<token name="@PROFILE@">21.05</token>
<token name="@THREADS@">\${GALAXY_SLOTS:-7}</token>

<token name="@THREADS@"><![CDATA[
##compute the number of ADDITIONAL threads to be used by samtools (-@)
addthreads=\${GALAXY_SLOTS:-1} && (( addthreads-- )) &&
]]></token>

<xml name="version_command">
<version_command><![CDATA[polypolish -V]]></version_command>
</xml>
Expand All @@ -15,7 +20,7 @@
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">polypolish</requirement>
<requirement type="package" version="1.13">samtools</requirement>
<requirement type="package" version="1.19">samtools</requirement>
</requirements>
</xml>
<xml name="citations">
Expand Down
12 changes: 6 additions & 6 deletions tools/polypolish/polypolish.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
======================================*#
#if $input.sam_data_type.sam_selector == 'single'
#if $input.sam_data_type.single_sam.is_of_type("unsorted.bam")
samtools view -h $input.sam_data_type.single_sam > input_sam &&
samtools view -@ \$addthreads -h $input.sam_data_type.single_sam > input_sam &&
#elif $input.sam_data_type.single_sam.ext == 'sam'
ln -s $input.sam_data_type.single_sam input_sam &&
#else
Expand All @@ -27,14 +27,14 @@
======================================*#
#elif $input.sam_data_type.sam_selector == 'paired'
#if $input.sam_data_type.R1_sam.is_of_type("unsorted.bam")
samtools view -h $input.sam_data_type.R1_sam > sample_R1.sam &&
samtools view -@ \$addthreads -h $input.sam_data_type.R1_sam > sample_R1.sam &&
#elif $input.sam_data_type.R1_sam.ext == 'sam'
ln -s '$input.sam_data_type.R1_sam' sample_R1.sam &&
#else
echo "${input.sam_data_type.single_sam} not a sam/bam file"
#end if
#if $input.sam_data_type.R2_sam.is_of_type("unsorted.bam")
samtools view -h $input.sam_data_type.R2_sam > sample_R2.sam &&
samtools view -@ \$addthreads -h $input.sam_data_type.R2_sam > sample_R2.sam &&
#elif $input.sam_data_type.R2_sam.ext == 'sam'
ln -s '$input.sam_data_type.R2_sam' sample_R2.sam &&
#else
Expand All @@ -58,7 +58,7 @@
mkdir single_collection &&
#for $value, $single_sam in enumerate($input.sam_data_type.single_collection):
#if $single_sam.is_of_type("unsorted.bam")
samtools view -h $single_sam > 'single_collection/$(single_sam.element_identifier).sam' &&
samtools view -@ \$addthreads -h $single_sam > 'single_collection/$(single_sam.element_identifier).sam' &&
#elif $single_sam.ext == 'sam'
ln -s $single_sam 'single_collection/$(single_sam.element_identifier).$(single_sam.ext)' &&
#else
Expand All @@ -73,12 +73,12 @@
mkdir paired_collection &&
#for $value, $paired_sam in enumerate($input.sam_data_type.paired_collection):
#if $paired_sam.forward.is_of_type("unsorted.bam")
samtools view -h $paired_sam.forward > 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' &&
samtools view -@ \$addthreads -h $paired_sam.forward > 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' &&
#else
ln -s '$paired_sam.forward' 'paired_collection/forward_input$(value)$(paired_sam.forward.element_identifier).sam' &&
#end if
#if $paired_sam.reverse.is_of_type("unsorted.bam")
samtools view -h $paired_sam.reverse > 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' &&
samtools view -@ \$addthreads -h $paired_sam.reverse > 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' &&
#else
ln -s '$paired_sam.reverse' 'paired_collection/reverse_input$(value)$(paired_sam.reverse.element_identifier).sam' &&
#end if
Expand Down

0 comments on commit 2a8a85c

Please sign in to comment.