Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/spades/biosyntheticspades.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ spades.py --bio
<!-- #1 single, interlaced, fastq.gz, default parameters -->
<test expect_num_outputs="4">
<conditional name="singlePaired">
<param name="sPaired" value="paired_interlaced"/>
<param name="sPaired" value="interlaced_collection"/>
<param name="input1" value="ecoli_1K.fastq.gz"/>
</conditional>
<output name="out_b">
Expand Down
187 changes: 171 additions & 16 deletions tools/spades/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,18 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
#return $ext
#end def

#if $singlePaired.sPaired == "single" or $singlePaired.sPaired == "paired_interlaced"
#if $singlePaired.sPaired == "single"
mkdir -p reads1 &&
#set file_paths1 = []
#for $input_file in $singlePaired.input1
#set ext = $fix_ext($input_file.ext)
#set fname = re.sub('[^\w\-_.]', '_', $input_file.element_identifier) + '.' + $ext
#set file_path = 'reads1/' + $fname
Comment on lines +64 to +66
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could imagine that having this implemented as a function would be beneficial.

ln -s '$input_file' '$file_path' &&
$file_paths1.append($file_path)
#end for

#else if $singlePaired.sPaired == "single_collection"
mkdir -p reads1 &&
#set file_paths1 = []
#for $input_file in $singlePaired.input1
Expand All @@ -67,7 +78,40 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
ln -s '$input_file' '$file_path' &&
$file_paths1.append($file_path)
#end for

#else if $singlePaired.sPaired == "interlaced"
mkdir -p reads1 &&
#set file_paths1 = []
#set ext = $fix_ext($singlePaired.input_interlaced.ext)
#set file_path = 'reads1/interlaced.' + $ext
ln -s '$singlePaired.input_interlaced' '$file_path' &&
$file_paths1.append($file_path)

#else if $singlePaired.sPaired == "interlaced_collection"
mkdir -p reads1 &&
#set file_paths1 = []
#for $input_file in $singlePaired.input1
#set ext = $fix_ext($input_file.ext)
#set fname = re.sub('[^\w\-_.]', '_', $input_file.element_identifier) + '.' + $ext
#set file_path = 'reads1/' + $fname
ln -s '$input_file' '$file_path' &&
$file_paths1.append($file_path)
#end for

#else if $singlePaired.sPaired == "paired"
mkdir -p paired_reads1 &&
#set fw_reads1 = []
#set rv_reads1 = []
#set ext = $fix_ext($singlePaired.input.forward.ext)
#set file_path_fw = 'paired_reads1/forward.' + $ext
ln -s '$singlePaired.input.forward' '$file_path_fw' &&
$fw_reads1.append($file_path_fw)
#set file_path_rv = 'paired_reads1/reverse.' + $ext
ln -s '$singlePaired.input.reverse' '$file_path_rv' &&
$rv_reads1.append($file_path_rv)

#else
## paired_collection
mkdir -p paired_reads1 &&
#set fw_reads1 = []
#set rv_reads1 = []
Expand All @@ -84,7 +128,26 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
]]></token>

<token name="@PREPROCESS_INPUT_FILES_ADDITIONAL@"><![CDATA[
#if $additional_reads.singlePaired.sPaired == "single" or $additional_reads.singlePaired.sPaired == "paired_interlaced"
#if $additional_reads.singlePaired.sPaired == "single"
mkdir -p reads2 &&
#set file_paths2 = []
#for $input_file in $additional_reads.singlePaired.input1
#set ext = $fix_ext($input_file.ext)
#set fname = re.sub('[^\w\-_.]', '_', $input_file.element_identifier) + '.' + $ext
#set file_path = 'reads2/' + $fname
ln -s '$input_file' '$file_path' &&
$file_paths2.append($file_path)
#end for

#else if $additional_reads.singlePaired.sPaired == "interlaced"
mkdir -p reads2 &&
#set file_paths2 = []
#set ext = $fix_ext($additional_reads.singlePaired.input_interlaced.ext)
#set file_path = 'reads2/interlaced.' + $ext
ln -s '$additional_reads.singlePaired.input_interlaced' '$file_path' &&
$file_paths2.append($file_path)

#else if $additional_reads.singlePaired.sPaired == "interlaced_collection"
mkdir -p reads2 &&
#set file_paths2 = []
#for $input_file in $additional_reads.singlePaired.input1
Expand All @@ -94,7 +157,21 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
ln -s '$input_file' '$file_path' &&
$file_paths2.append($file_path)
#end for

#else if $additional_reads.singlePaired.sPaired == "paired"
mkdir -p paired_reads2 &&
#set fw_reads2 = []
#set rv_reads2 = []
#set ext = $fix_ext($additional_reads.singlePaired.input.forward.ext)
#set file_path_fw = 'paired_reads2/forward.' + $ext
ln -s '$additional_reads.singlePaired.input.forward' '$file_path_fw' &&
$fw_reads2.append($file_path_fw)
#set file_path_rv = 'paired_reads2/reverse.' + $ext
ln -s '$additional_reads.singlePaired.input.reverse' '$file_path_rv' &&
$rv_reads2.append($file_path_rv)

#else
## paired_collection
mkdir -p paired_reads2 &&
#set fw_reads2 = []
#set rv_reads2 = []
Expand Down Expand Up @@ -123,12 +200,30 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
#for $read in $file_paths1
--s $library '${read}'
#end for
#else if $singlePaired.sPaired == "paired_interlaced"

#else if $singlePaired.sPaired == "interlaced"
#for $read in $file_paths1
--${singlePaired.type_paired}-12 $library '${read}'
--${singlePaired.type_paired}-or $library $singlePaired.orientation
#end for

#else if $singlePaired.sPaired == "interlaced_collection"
#for $read in $file_paths1
--${singlePaired.type_paired}-12 $library '${read}'
--${singlePaired.type_paired}-or $library $singlePaired.orientation
#end for

#else if $singlePaired.sPaired == "paired"
#for $read in $fw_reads1
--${singlePaired.type_paired}-1 $library '${read}'
#end for
#for $read in $rv_reads1
--${singlePaired.type_paired}-2 $library '${read}'
--${singlePaired.type_paired}-or $library $singlePaired.orientation
#end for

#else
## paired_collection
#for $read in $fw_reads1
--${singlePaired.type_paired}-1 $library '${read}'
#end for
Expand All @@ -139,19 +234,21 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
#end if
]]></token>


<token name="@INPUT_READS_ADDITIONAL@"><![CDATA[
@LIBRARY_NUMBER@
#if $additional_reads.singlePaired.sPaired == "single"
#for $read in $file_paths2
--s $library '${read}'
#end for
#else if $additional_reads.singlePaired.sPaired == "paired_interlaced"

#else if $additional_reads.singlePaired.sPaired == "interlaced" or $additional_reads.singlePaired.sPaired == "interlaced_collection"
#for $read in $file_paths2
--${additional_reads.singlePaired.type_paired}-12 $library '${read}'
--${additional_reads.singlePaired.type_paired}-or $library $additional_reads.singlePaired.orientation
#end for

#else
## paired + paired_collection
#for $read in $fw_reads2
--${additional_reads.singlePaired.type_paired}-1 $library '${read}'
#end for
Expand Down Expand Up @@ -349,19 +446,47 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&

<xml name="input_files_all" token_format="" token_label="" token_help="It assumes that all samples belong to the same library. If you want to use samples from two different libraries, include the second library as additional set of short-reads.">
<conditional name="singlePaired">
<param name="sPaired" type="select" label="Single-end or paired-end short-reads" help="@HELP@">
<option value="single">Single-end</option>
<option value="paired_interlaced">Paired-end: interlaced reads</option>
<option value="paired_collection" selected="true">Paired-end: list of dataset pairs</option>
<param name="sPaired" type="select" label="Input format for reads" help="@HELP@">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This macro could reuse input_files_paired

<option value="single">Single-end (individual assembly)</option>
<option value="paired">Paired-end: forward + reverse (individual assembly)</option>
<option value="interlaced">Paired-end: interlaced reads (individual assembly)</option>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we drop interlaced? I have never seen an interlaced dataset in my life.

<option value="single_collection">Single-end (co-assembly)</option>
<option value="interlaced_collection">Paired-end: interlaced reads (co-assembly)</option>
<option value="paired_collection" selected="true">Paired-end: list of dataset pairs (co-assembly)</option>
</param>

<!-- single-end individual -->
<when value="single">
<param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@"/>
<param format="@FORMAT@" name="input_single" type="data" label="@LABEL@: single-end"/>
</when>
<when value="paired_interlaced">
<param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: interlaced"/>

<!-- paired individual -->
<when value="paired">
<param format="@FORMAT@" name="input" type="data_collection" collection_type="paired" label="@LABEL@: paired reads"/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>

<!-- interlaced individual -->
<when value="interlaced">
<param format="@FORMAT@" name="input_interlaced" type="data" label="@LABEL@: interlaced reads"/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>

<!-- single-end collection -->
<when value="single_collection">
<param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: single-end"/>
</when>

<!-- interlaced collection -->
<when value="interlaced_collection">
<param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: interlaced"/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>

<!-- paired collection -->
<when value="paired_collection">
<param format="@FORMAT@" name="input" type="data_collection" collection_type="list:paired" label="@LABEL@: collection"/>
<expand macro="type_paired"/>
Expand All @@ -373,20 +498,50 @@ export OMP_THREAD_LIMIT=\${GALAXY_SLOTS:-4} &&
<xml name="input_files_paired" tokens="format,label" token_help="It assumes that all samples belong to the same library. If you want to use samples from two different libraries, include the second library as additional set of short-reads.">
<conditional name="singlePaired">
<param name="sPaired" type="select" label="Pair-end reads input format" help="@HELP@">
<option value="paired_interlaced">Paired-end: interlaced reads</option>
<option value="paired_collection" selected="true">Paired-end: list of dataset pairs</option>
<option value="paired">Paired-end: forward + reverse (individual assembly)</option>
<option value="interlaced">Paired-end: interlaced reads (individual assembly)</option>
<option value="interlaced_collection">Paired-end: interlaced reads (co-assembly)</option>
<option value="paired_collection" selected="true">Paired-end: list of dataset pairs (co-assembly)</option>
</param>
<when value="paired_interlaced">
<param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: interlaced"/>

<!-- single paired -->
<when value="paired">
<param name="input"
type="data_collection"
collection_type="paired"
format="@FORMAT@"
label="@LABEL@: paired reads"
help="Provide one paired dataset with forward (R1) and reverse (R2) reads."/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>

<!-- single interlaced -->
<when value="interlaced">
<param name="input_interlaced"
type="data"
format="@FORMAT@"
label="@LABEL@: interlaced reads"
help="Provide a single file with interleaved forward and reverse reads."/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>

<!-- multiple interlaced -->
<when value="interlaced_collection">
<param format="@FORMAT@" name="input1" type="data" multiple="true" label="@LABEL@: interlaced"/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>

<!-- collection -->
<when value="paired_collection">
<param format="@FORMAT@" name="input" type="data_collection" collection_type="list:paired" label="@LABEL@: collection"/>
<expand macro="type_paired"/>
<expand macro="orientation"/>
</when>
</conditional>

<param name="library_number" type="select" label="The samples belong to the same library" help="If the reads have been generated from the same sample, it means that they belong to the same library.">
<option value="true" selected="true">True</option>
<option value="false">False</option>
Expand Down
4 changes: 2 additions & 2 deletions tools/spades/metaspades.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ metaspades.py
<!-- #1 single, interlaced, fastq.gz, default parameters -->
<test expect_num_outputs="4">
<conditional name="singlePaired">
<param name="sPaired" value="paired_interlaced"/>
<param name="sPaired" value="interlaced_collection"/>
<param name="input1" value="ecoli_1K.fastq.gz"/>
</conditional>
<output name="out_ag">
Expand Down Expand Up @@ -141,7 +141,7 @@ metaspades.py
<!-- #3 only corrected reads are created as an output -->
<test expect_num_outputs="2">
<conditional name="singlePaired">
<param name="sPaired" value="paired_interlaced"/>
<param name="sPaired" value="interlaced_collection"/>
<param name="input1" value="ecoli_1K.fastq.gz"/>
</conditional>
<param name="optional_output" value="cr,l"/>
Expand Down
2 changes: 1 addition & 1 deletion tools/spades/plasmidspades.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ plasmidspades.py
<test expect_num_outputs="1">
<param name="operation_mode" value="--only-assembler"/>
<conditional name="singlePaired">
<param name="sPaired" value="paired_interlaced"/>
<param name="sPaired" value="interlaced_collection"/>
<param name="input1" value="ecoli_1K.fastq.gz"/>
</conditional>
<conditional name="additional_reads">
Expand Down
2 changes: 1 addition & 1 deletion tools/spades/rnaspades.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ rnaspades.py
<!-- #1 -->
<test expect_num_outputs="1">
<conditional name="singlePaired">
<param name="sPaired" value="paired_interlaced"/>
<param name="sPaired" value="interlaced_collection"/>
<param name="input1" value="ecoli_1K.fastq.gz"/>
</conditional>
<output name="out_tr">
Expand Down
2 changes: 1 addition & 1 deletion tools/spades/rnaviralspades.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spades.py --rnaviral
<!-- #1 single, interlaced, fastq.gz, default parameters -->
<test expect_num_outputs="4">
<conditional name="singlePaired">
<param name="sPaired" value="paired_interlaced"/>
<param name="sPaired" value="interlaced_collection"/>
<param name="input1" value="ecoli_1K.fastq.gz"/>
</conditional>
<output name="out_ag">
Expand Down
Loading
Loading