Skip to content

Commit

Permalink
Fix bbduk, bbmerge bbmap for non-unique names (galaxyproject#5966)
Browse files Browse the repository at this point in the history
The name attribute is not guaranteed to be unique, we can just use
forward / reverse as symlink targets. This is also simpler.
  • Loading branch information
mvdbeek authored Apr 24, 2024
1 parent bced16a commit 8f659e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 23 deletions.
9 changes: 3 additions & 6 deletions tools/bbtools/bbduk.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
#import os
#import re
#if str($input_type_cond.input_type) in ['single', 'pair']:
#set read1 = $input_type_cond.read1
Expand All @@ -25,17 +24,15 @@
#end if
#else:
#set read1 = $input_type_cond.reads_collection['forward']
#set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.name))
## bbduk uses the file extension to determine the input format.
#set ext = $read1_identifier + '.fastq'
#set ext = '.fastq'
#if $read1.ext.endswith('.gz'):
#set ext = $ext + '.gz'
#end if
#set read1_file = $read1_identifier + $ext
#set read1_file = 'forward' + $ext
ln -s '${read1}' '${read1_file}' &&
#set read2 = $input_type_cond.reads_collection['reverse']
#set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.name))
#set read2_file = $read2_identifier + $ext
#set read2_file = 'reverse' + $ext
ln -s '${read2}' '${read2_file}' &&
#end if
Expand Down
11 changes: 3 additions & 8 deletions tools/bbtools/bbmap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<expand macro="edam_ontology"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
#import os
#import re
#if str($ref_source_cond.ref_source) == 'cached'
#set ref = str($ref_source_cond.reference.fields.path)
#else:
Expand All @@ -31,17 +28,15 @@
#end if
#else:
#set read1 = $input_type_cond.reads_collection['forward']
#set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
## bbmap uses the file extension to determine the input format.
#set ext = $read1_identifier + '.fastq'
#set ext = '.fastq'
#if $read1.ext.endswith('.gz'):
#set ext = $ext + '.gz'
#end if
#set read1_file = $read1_identifier + $ext
#set read1_file = 'forward' + $ext
ln -s '${read1}' '${read1_file}' &&
#set read2 = $input_type_cond.reads_collection['reverse']
#set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
#set read2_file = $read2_identifier + $ext
#set read2_file = 'reverse' + $ext
ln -s '${read2}' '${read2_file}' &&
#end if
Expand Down
11 changes: 3 additions & 8 deletions tools/bbtools/bbmerge.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<expand macro="edam_ontology"/>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
#import os
#import re
#if str($input_type_cond.input_type) in ['single', 'pair']:
#set read1 = $input_type_cond.read1
## bbmerge uses the file extension to determine the input format.
Expand All @@ -25,17 +22,15 @@
#end if
#else:
#set read1 = $input_type_cond.reads_collection['forward']
#set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
## bbmap uses the file extension to determine the input format.
#set ext = $read1_identifier + '.fastq'
#set ext = '.fastq'
#if $read1.ext.endswith('.gz'):
#set ext = $ext + '.gz'
#end if
#set read1_file = $read1_identifier + $ext
#set read1_file = 'forward' + $ext
ln -s '${read1}' '${read1_file}' &&
#set read2 = $input_type_cond.reads_collection['reverse']
#set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
#set read2_file = $read2_identifier + $ext
#set read2_file = 'reverse' + $ext
ln -s '${read2}' '${read2_file}' &&
#end if
Expand Down
2 changes: 1 addition & 1 deletion tools/bbtools/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">39.06</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@VERSION_SUFFIX@">2</token>
<token name="@PROFILE@">22.01</token>
<xml name="edam_ontology">
<edam_topics>
Expand Down

0 comments on commit 8f659e3

Please sign in to comment.