Mercurial > repos > devteam > bowtie2
diff bowtie2_wrapper.xml @ 18:121110a12cc9 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bowtie2 commit a887e11c533af3ed3734c26da2da33aa8acbbce9
author | iuc |
---|---|
date | Fri, 24 Nov 2017 07:44:07 -0500 |
parents | 66f992977578 |
children | 97d1923c8c4b |
line wrap: on
line diff
--- a/bowtie2_wrapper.xml Tue Nov 14 15:02:18 2017 -0500 +++ b/bowtie2_wrapper.xml Fri Nov 24 07:44:07 2017 -0500 @@ -1,324 +1,327 @@ -<tool id="bowtie2" name="Bowtie2" version="2.3.2.2" profile="17.01"> +<tool id="bowtie2" name="Bowtie2" version="2.3.3.1" profile="17.01"> <description>- map reads against reference genome</description> <macros> <import>bowtie2_macros.xml</import> </macros> <requirements> - <requirement type="package" version="2.3.2">bowtie2</requirement> - <requirement type="package" version="1.3.1">samtools</requirement> + <requirement type="package" version="2.3.3.1">bowtie2</requirement> + <requirement type="package" version="1.6">samtools</requirement> </requirements> <version_command>bowtie2 --version</version_command> <command detect_errors="exit_code"><![CDATA[ - ## prepare bowtie2 index - #set index_path = '' - #if str($reference_genome.source) == "history": - bowtie2-build --threads \${GALAXY_SLOTS:-4} '$reference_genome.own_file' genome && - ln -s -f '$reference_genome.own_file' genome.fa && - #set index_path = 'genome' - #else: - #set index_path = $reference_genome.index.fields.path - #end if +## prepare bowtie2 index +#set index_path = '' +#if str($reference_genome.source) == "history": + bowtie2-build --threads \${GALAXY_SLOTS:-4} '$reference_genome.own_file' genome && + ln -s -f '$reference_genome.own_file' genome.fa && + #set index_path = 'genome' +#else: + #set index_path = $reference_genome.index.fields.path +#end if - ## Link in the input files, so bowtie2 can tell their type +## Link in the input files, so bowtie2 can tell their type - #set compressed="False" - #set reads_are_fastq = True - #if str($library.type) == 'paired': - #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"): - #set read1 = "input_f.fastq.gz" - #set compressed = "GZ" - #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"): - #set read1 = "input_f.fastq.bz2" - #set compressed = "BZ2" - #else if $library.input_1.is_of_type('fasta'): - #set reads_are_fastq = False - #set read1 = "input_f.fasta" - #else: - #set read1 = "input_f.fastq" - #end if - ln -f -s '${library.input_1}' ${read1} && +#set compressed="False" +#set reads_are_fastq = True +#if str($library.type) == 'paired': + #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"): + #set read1 = "input_f.fastq.gz" + #set compressed = "GZ" + #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"): + #set read1 = "input_f.fastq.bz2" + #set compressed = "BZ2" + #else if $library.input_1.is_of_type('fasta'): + #set reads_are_fastq = False + #set read1 = "input_f.fasta" + #else: + #set read1 = "input_f.fastq" + #end if + ln -f -s '${library.input_1}' ${read1} && - #if $library.input_2.is_of_type("fastq.gz", "fastqsanger.gz"): - #set read2 = "input_r.fastq.gz" - #set compressed = "GZ" - #else if $library.input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"): - #set read2 = "input_r.fastq.bz2" - #set compressed = "BZ2" - #else if $library.input_2.is_of_type('fasta'): - #set read2 = "input_r.fasta" - #else: - #set read2 = "input_r.fastq" - #end if - ln -f -s '${library.input_2}' ${read2} && - #else if str($library.type) == 'paired_collection': - #if $library.input_1.forward.is_of_type("fastq.gz", "fastqsanger.gz"): - #set read1 = "input_f.fastq.gz" - #set compressed = "GZ" - #else if $library.input_1.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"): - #set read1 = "input_f.fastq.bz2" - #set compressed = "BZ2" - #else if $library.input_1.forward.is_of_type('fasta'): - #set reads_are_fastq = False - #set read1 = "input_f.fasta" - #else: - #set read1 = "input_f.fastq" - #end if - ln -s '${library.input_1.forward}' ${read1} && + #if $library.input_2.is_of_type("fastq.gz", "fastqsanger.gz"): + #set read2 = "input_r.fastq.gz" + #set compressed = "GZ" + #else if $library.input_2.is_of_type("fastq.bz2", "fastqsanger.bz2"): + #set read2 = "input_r.fastq.bz2" + #set compressed = "BZ2" + #else if $library.input_2.is_of_type('fasta'): + #set read2 = "input_r.fasta" + #else: + #set read2 = "input_r.fastq" + #end if + ln -f -s '${library.input_2}' ${read2} && +#else if str($library.type) == 'paired_collection': + #if $library.input_1.forward.is_of_type("fastq.gz", "fastqsanger.gz"): + #set read1 = "input_f.fastq.gz" + #set compressed = "GZ" + #else if $library.input_1.forward.is_of_type("fastq.bz2", "fastqsanger.bz2"): + #set read1 = "input_f.fastq.bz2" + #set compressed = "BZ2" + #else if $library.input_1.forward.is_of_type('fasta'): + #set reads_are_fastq = False + #set read1 = "input_f.fasta" + #else: + #set read1 = "input_f.fastq" + #end if + ln -s '${library.input_1.forward}' ${read1} && - #if $library.input_1.reverse.is_of_type("fastq.gz", "fastqsanger.gz"): - #set read2 = "input_r.fastq.gz" - #set compressed = "GZ" - #else if $library.input_1.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"): - #set read2 = "input_r.fastq.bz2" - #set compressed = "BZ2" - #else if $library.input_1.reverse.is_of_type("fasta"): - #set read2 = "input_r.fasta" - #else: - #set read2 = "input_r.fastq" - #end if - ln -s '${library.input_1.reverse}' ${read2} && + #if $library.input_1.reverse.is_of_type("fastq.gz", "fastqsanger.gz"): + #set read2 = "input_r.fastq.gz" + #set compressed = "GZ" + #else if $library.input_1.reverse.is_of_type("fastq.bz2", "fastqsanger.bz2"): + #set read2 = "input_r.fastq.bz2" + #set compressed = "BZ2" + #else if $library.input_1.reverse.is_of_type("fasta"): + #set read2 = "input_r.fasta" + #else: + #set read2 = "input_r.fastq" + #end if + ln -s '${library.input_1.reverse}' ${read2} && - #else if str($library.type) == 'paired_interleaved': - #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"): - #set read1 = "input_il.fastq.gz" - #set compressed = "GZ" - #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"): - #set read1 = "input_il.fastq.bz2" - #set compressed = "BZ2" - #else if $library.input_1.is_of_type("fasta"): - #set reads_are_fastq = False - #set read1 = "input_il.fasta" - #else: - #set read1 = "input_il.fastq" - #end if - ln -s '${library.input_1}' ${read1} && +#else if str($library.type) == 'paired_interleaved': + #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"): + #set read1 = "input_il.fastq.gz" + #set compressed = "GZ" + #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"): + #set read1 = "input_il.fastq.bz2" + #set compressed = "BZ2" + #else if $library.input_1.is_of_type("fasta"): + #set reads_are_fastq = False + #set read1 = "input_il.fasta" + #else: + #set read1 = "input_il.fastq" + #end if + ln -s '${library.input_1}' ${read1} && +#else: + #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"): + #set read1 = "input_f.fastq.gz" + #set compressed = "GZ" + #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"): + #set read1 = "input_f.fastq.bz2" + #set compressed = "BZ2" + #else if $library.input_1.is_of_type("fasta"): + #set reads_are_fastq = False + #set read1 = "input_f.fasta" + #else: + #set read1 = "input_f.fastq" + #end if + ln -s '${library.input_1}' ${read1} && +#end if + +## execute bowtie2 + +bowtie2 + +## number of threads +-p \${GALAXY_SLOTS:-4} + +## index file path +-x '$index_path' + +## Input reads are fasta? +#if not reads_are_fastq: + -f +#end if + +## Input reads +#if str( $library.type ) == "single": + -U '${read1}' + #if str( $library.unaligned_file ) == "true": + #if $compressed == "GZ": + --un-gz '${output_unaligned_reads_l}' + #else if $compressed == "BZ2": + --un-bz2 '${output_unaligned_reads_l}' #else: - #if $library.input_1.is_of_type("fastq.gz", "fastqsanger.gz"): - #set read1 = "input_f.fastq.gz" - #set compressed = "GZ" - #else if $library.input_1.is_of_type("fastq.bz2", "fastqsanger.bz2"): - #set read1 = "input_f.fastq.bz2" - #set compressed = "BZ2" - #else if $library.input_1.is_of_type("fasta"): - #set reads_are_fastq = False - #set read1 = "input_f.fasta" - #else: - #set read1 = "input_f.fastq" - #end if - ln -s '${library.input_1}' ${read1} && + --un '${output_unaligned_reads_l}' #end if - - ## execute bowtie2 - - bowtie2 - - ## number of threads - -p \${GALAXY_SLOTS:-4} - - ## index file path - -x '$index_path' - - ## Input reads are fasta? - #if not reads_are_fastq: - -f + #end if + #if str( $library.aligned_file ) == "true": + #if $compressed == "GZ": + --al-gz '${output_aligned_reads_l}' + #else if $compressed == "BZ2": + --al-bz2 '${output_aligned_reads_l}' + #else: + --al '${output_aligned_reads_l}' #end if - - ## Input reads - #if str( $library.type ) == "single": - -U '${read1}' - #if str( $library.unaligned_file ) == "true": - #if $compressed == "GZ": - --un-gz '${output_unaligned_reads_l}' - #else if $compressed == "BZ2": - --un-bz2 '${output_unaligned_reads_l}' - #else: - --un '${output_unaligned_reads_l}' - #end if - #end if - #if str( $library.aligned_file ) == "true": - #if $compressed == "GZ": - --al-gz '${output_aligned_reads_l}' - #else if $compressed == "BZ2": - --al-bz2 '${output_aligned_reads_l}' - #else: - --al '${output_aligned_reads_l}' - #end if - #end if + #end if - #elif str( $library.type ) == "paired_interleaved": - --interleaved '${read1}' - #if str( $library.unaligned_file ) == "true": - #if $compressed == "GZ": - --un-gz '${output_unaligned_reads_l}' - #else if $compressed == "BZ2": - --un-bz2 '${output_unaligned_reads_l}' - #else: - --un '${output_unaligned_reads_l}' - #end if - #end if - #if str( $library.aligned_file ) == "true": - #if $compressed == "GZ": - --al-gz '${output_aligned_reads_l}' - #else if $compressed == "BZ2": - --al-bz2 '${output_aligned_reads_l}' - #else: - --al '${output_aligned_reads_l}' - #end if - #end if +#elif str( $library.type ) == "paired_interleaved": + --interleaved '${read1}' + #if str( $library.unaligned_file ) == "true": + #if $compressed == "GZ": + --un-gz '${output_unaligned_reads_l}' + #else if $compressed == "BZ2": + --un-bz2 '${output_unaligned_reads_l}' + #else: + --un '${output_unaligned_reads_l}' + #end if + #end if + #if str( $library.aligned_file ) == "true": + #if $compressed == "GZ": + --al-gz '${output_aligned_reads_l}' + #else if $compressed == "BZ2": + --al-bz2 '${output_aligned_reads_l}' + #else: + --al '${output_aligned_reads_l}' + #end if + #end if +#else: + -1 '${read1}' + -2 '${read2}' + #if str( $library.unaligned_file ) == "true": + #if $compressed == "GZ": + --un-conc-gz '${output_unaligned_reads_l}' + #else if $compressed == "BZ2": + --un-conc-bz2 '${output_unaligned_reads_l}' + #else: + --un-conc '${output_unaligned_reads_l}' + #end if + #end if + #if str( $library.aligned_file ) == "true": + #if $compressed == "GZ": + --al-conc-gz '${output_aligned_reads_l}' + #else if $compressed == "BZ2": + --al-conc-bz2 '${output_aligned_reads_l}' #else: - -1 '${read1}' - -2 '${read2}' - #if str( $library.unaligned_file ) == "true": - #if $compressed == "GZ": - --un-conc-gz '${output_unaligned_reads_l}' - #else if $compressed == "BZ2": - --un-conc-bz2 '${output_unaligned_reads_l}' - #else: - --un-conc '${output_unaligned_reads_l}' - #end if - #end if - #if str( $library.aligned_file ) == "true": - #if $compressed == "GZ": - --al-conc-gz '${output_aligned_reads_l}' - #else if $compressed == "BZ2": - --al-conc-bz2 '${output_aligned_reads_l}' - #else: - --al-conc '${output_aligned_reads_l}' - #end if - #end if - #if str( $library.paired_options.paired_options_selector ) == "yes": - -I "${library.paired_options.I}" - -X "${library.paired_options.X}" - ${library.paired_options.fr_rf_ff} - ${library.paired_options.no_mixed} - ${library.paired_options.no_discordant} - ${library.paired_options.dovetail} - ${library.paired_options.no_contain} - ${library.paired_options.no_overlap} - #end if + --al-conc '${output_aligned_reads_l}' #end if + #end if + #if str( $library.paired_options.paired_options_selector ) == "yes": + -I ${library.paired_options.I} + -X ${library.paired_options.X} + ${library.paired_options.fr_rf_ff} + ${library.paired_options.no_mixed} + ${library.paired_options.no_discordant} + ${library.paired_options.dovetail} + ${library.paired_options.no_contain} + ${library.paired_options.no_overlap} + #end if +#end if - ## Read group information. - @define_read_group_helpers@ - #if str( $library.type ) == "single": - #set $rg_auto_name = $read_group_name_default($library.input_1) - #elif str( $library.type ) == "paired": - #set $rg_auto_name = $read_group_name_default($library.input_1, $library.input_2) - #else - #set $rg_auto_name = $read_group_name_default($library.input_1) - #end if - @set_use_rg_var@ - @set_read_group_vars@ - #if $use_rg - $format_read_group("", $rg_id, '"', arg='--rg-id ') - $format_read_group("SM:", $rg_sm, '"', arg='--rg ') - $format_read_group("PL:", $rg_pl, '"', arg='--rg ') - $format_read_group("LB:", $rg_lb, '"', arg='--rg ') - $format_read_group("CN:", $rg_cn, '"', arg='--rg ') - $format_read_group("DS:", $rg_ds, '"', arg='--rg ') - $format_read_group("DT:", $rg_dt, '"', arg='--rg ') - $format_read_group("FO:", $rg_fo, '"', arg='--rg ') - $format_read_group("KS:", $rg_ks, '"', arg='--rg ') - $format_read_group("PG:", $rg_pg, '"', arg='--rg ') - $format_read_group("PI:", $rg_pi, '"', arg='--rg ') - $format_read_group("PU:", $rg_pu, '"', arg='--rg ') - #end if +## Read group information. +@define_read_group_helpers@ +#if str( $library.type ) == "single": + #set $rg_auto_name = $read_group_name_default($library.input_1) +#elif str( $library.type ) == "paired": + #set $rg_auto_name = $read_group_name_default($library.input_1, $library.input_2) +#else + #set $rg_auto_name = $read_group_name_default($library.input_1) +#end if +@set_use_rg_var@ +@set_read_group_vars@ +#if $use_rg + $format_read_group("", $rg_id, '"', arg='--rg-id ') + $format_read_group("SM:", $rg_sm, '"', arg='--rg ') + $format_read_group("PL:", $rg_pl, '"', arg='--rg ') + $format_read_group("LB:", $rg_lb, '"', arg='--rg ') + $format_read_group("CN:", $rg_cn, '"', arg='--rg ') + $format_read_group("DS:", $rg_ds, '"', arg='--rg ') + $format_read_group("DT:", $rg_dt, '"', arg='--rg ') + $format_read_group("FO:", $rg_fo, '"', arg='--rg ') + $format_read_group("KS:", $rg_ks, '"', arg='--rg ') + $format_read_group("PG:", $rg_pg, '"', arg='--rg ') + $format_read_group("PI:", $rg_pi, '"', arg='--rg ') + $format_read_group("PU:", $rg_pu, '"', arg='--rg ') +#end if - ## Analysis type - #if ( str( $analysis_type.analysis_type_selector ) == "simple" and str( $analysis_type.presets ) != "no_presets" ): - $analysis_type.presets - #elif str( $analysis_type.analysis_type_selector ) == "full": - #if str( $analysis_type.input_options.input_options_selector ) == "yes": - --skip "${analysis_type.input_options.skip}" - --qupto "${analysis_type.input_options.qupto}" - --trim5 "${analysis_type.input_options.trim5}" - --trim3 "${analysis_type.input_options.trim3}" - ${analysis_type.input_options.qv_encoding} - ${analysis_type.input_options.solexa_quals} - ${analysis_type.input_options.int_quals} - #end if +## Analysis type +#if ( str( $analysis_type.analysis_type_selector ) == "simple" and str( $analysis_type.presets ) != "no_presets" ): + $analysis_type.presets +#elif str( $analysis_type.analysis_type_selector ) == "full": + #if str( $analysis_type.input_options.input_options_selector ) == "yes": + --skip ${analysis_type.input_options.skip} + --qupto ${analysis_type.input_options.qupto} + --trim5 ${analysis_type.input_options.trim5} + --trim3 ${analysis_type.input_options.trim3} + ${analysis_type.input_options.qv_encoding} + ${analysis_type.input_options.solexa_quals} + ${analysis_type.input_options.int_quals} + #end if - #if str( $analysis_type.alignment_options.alignment_options_selector ) == "yes": - -N "${analysis_type.alignment_options.N}" - -L "${analysis_type.alignment_options.L}" - -i "${analysis_type.alignment_options.i}" - --n-ceil "${analysis_type.alignment_options.n_ceil}" - --dpad "${analysis_type.alignment_options.dpad}" - --gbar "${analysis_type.alignment_options.gbar}" - ${analysis_type.alignment_options.ignore_quals} - ${analysis_type.alignment_options.nofw} - ${analysis_type.alignment_options.norc} - ${analysis_type.alignment_options.no_1mm_upfront} - #if str( $analysis_type.alignment_options.align_mode.align_mode_selector ) == "end-to-end": - --end-to-end - --score-min "${analysis_type.alignment_options.align_mode.score_min_ete}" - #elif str( $analysis_type.alignment_options.align_mode.align_mode_selector ) == "local": - --local - --score-min "${analysis_type.alignment_options.align_mode.score_min_loc}" - #end if - #end if + #if str( $analysis_type.alignment_options.alignment_options_selector ) == "yes": + -N ${analysis_type.alignment_options.N} + -L ${analysis_type.alignment_options.L} + -i '${analysis_type.alignment_options.i}' + --n-ceil '${analysis_type.alignment_options.n_ceil}' + --dpad ${analysis_type.alignment_options.dpad} + --gbar ${analysis_type.alignment_options.gbar} + ${analysis_type.alignment_options.ignore_quals} + ${analysis_type.alignment_options.nofw} + ${analysis_type.alignment_options.norc} + ${analysis_type.alignment_options.no_1mm_upfront} + #if str( $analysis_type.alignment_options.align_mode.align_mode_selector ) == "end-to-end": + --end-to-end + --score-min '${analysis_type.alignment_options.align_mode.score_min_ete}' + #elif str( $analysis_type.alignment_options.align_mode.align_mode_selector ) == "local": + --local + --score-min '${analysis_type.alignment_options.align_mode.score_min_loc}' + #end if + #end if - #if str( $analysis_type.scoring_options.scoring_options_selector ) == "yes": - #if ( str( $analysis_type.alignment_options.alignment_options_selector ) == "yes" and str( $analysis_type.alignment_options.align_mode.align_mode_selector ) == "local" ): - --ma "${analysis_type.scoring_options.ma}" - #end if - --mp "${analysis_type.scoring_options.mp}" - --np "${analysis_type.scoring_options.np}" - --rdg "${analysis_type.scoring_options.rdg_read_open},${analysis_type.scoring_options.rdg_read_extend}" - --rfg "${analysis_type.scoring_options.rfg_ref_open},${analysis_type.scoring_options.rfg_ref_extend}" - #end if + #if str( $analysis_type.scoring_options.scoring_options_selector ) == "yes": + #if ( str( $analysis_type.alignment_options.alignment_options_selector ) == "yes" and str( $analysis_type.alignment_options.align_mode.align_mode_selector ) == "local" ): + --ma ${analysis_type.scoring_options.ma} + #end if + --mp '${analysis_type.scoring_options.mp}' + --np ${analysis_type.scoring_options.np} + --rdg ${analysis_type.scoring_options.rdg_read_open},${analysis_type.scoring_options.rdg_read_extend} + --rfg ${analysis_type.scoring_options.rfg_ref_open},${analysis_type.scoring_options.rfg_ref_extend} + #end if - #if str( $analysis_type.reporting_options.reporting_options_selector ) == "k": - -k "${analysis_type.reporting_options.k}" - #elif str( $analysis_type.reporting_options.reporting_options_selector ) == "a": - -a - #end if + #if str( $analysis_type.reporting_options.reporting_options_selector ) == "k": + -k ${analysis_type.reporting_options.k} + #elif str( $analysis_type.reporting_options.reporting_options_selector ) == "a": + -a + #end if - #if str( $analysis_type.effort_options.effort_options_selector ) == "yes": - -D "${analysis_type.effort_options.D}" - -R "${analysis_type.effort_options.R}" - #end if + #if str( $analysis_type.effort_options.effort_options_selector ) == "yes": + -D ${analysis_type.effort_options.D} + -R ${analysis_type.effort_options.R} + #end if - #if str( $analysis_type.sam_options.sam_options_selector ) == "yes": - ${analysis_type.sam_options.no_unal} - ${analysis_type.sam_options.omit_sec_seq} - #end if + #if str( $analysis_type.sam_options.sam_options_selector ) == "yes": + ${analysis_type.sam_options.no_unal} + ${analysis_type.sam_options.omit_sec_seq} + ${analysis_type.sam_options.sam-no-qname-trunc} + ${analysis_type.sam_options.xeq} + ${analysis_type.sam_options.soft-clipped-unmapped-tlen} + #end if - #if str( $analysis_type.other_options.other_options_selector ) == "yes": - ${analysis_type.other_options.reorder} - ${analysis_type.other_options.non_deterministic} - --seed "${analysis_type.other_options.seed}" - #end if - - #elif str( $analysis_type.analysis_type_selector ) == "cline": - ${analysis_type.cline} - #end if + #if str( $analysis_type.other_options.other_options_selector ) == "yes": + ${analysis_type.other_options.reorder} + ${analysis_type.other_options.non_deterministic} + --seed ${analysis_type.other_options.seed} + #end if - ## mapping stats (i.e. stderr from bowtie2) - #if $save_mapping_stats - 2> '$mapping_stats' - #end if +#elif str( $analysis_type.analysis_type_selector ) == "cline": + ${analysis_type.cline} +#end if - ## output file - #if ( str( $analysis_type.analysis_type_selector ) != "full" or str( $analysis_type.sam_opt ) != "true" ): - | samtools sort -O bam -o '$output' - #else - > '$output_sam' - #end if +## mapping stats (i.e. stderr from bowtie2) +#if $save_mapping_stats + 2> '$mapping_stats' +#end if - ## rename unaligned sequence files - #if $library.type == "paired" and $output_unaligned_reads_l and $output_unaligned_reads_r: - #from os.path import splitext - #set _unaligned_root, _unaligned_ext = splitext( str( $output_unaligned_reads_l ) ) - && mv "${ _unaligned_root }.1${_unaligned_ext}" '$output_unaligned_reads_l' - && mv "${ _unaligned_root }.2${_unaligned_ext}" '$output_unaligned_reads_r' - #end if - #if $library.type == "paired" and $output_aligned_reads_l and $output_aligned_reads_r: - #from os.path import splitext - #set _aligned_root, _aligned_ext = splitext( str( $output_aligned_reads_l ) ) - && mv "${ _aligned_root }.1${_aligned_ext}" '$output_aligned_reads_l' - && mv "${ _aligned_root }.2${_aligned_ext}" '$output_aligned_reads_r' - #end if +## output file +#if ( str( $analysis_type.analysis_type_selector ) != "full" or str( $analysis_type.sam_opt ) != "true" ): + | samtools sort -@\${GALAXY_SLOTS:-2} -O bam -o '$output' +#else + > '$output_sam' +#end if + +## rename unaligned sequence files +#if $library.type == "paired" and $output_unaligned_reads_l and $output_unaligned_reads_r: + #from os.path import splitext + #set _unaligned_root, _unaligned_ext = splitext( str( $output_unaligned_reads_l ) ) + && mv '${ _unaligned_root }.1${_unaligned_ext}' '$output_unaligned_reads_l' + && mv '${ _unaligned_root }.2${_unaligned_ext}' '$output_unaligned_reads_r' +#end if +#if $library.type == "paired" and $output_aligned_reads_l and $output_aligned_reads_r: + #from os.path import splitext + #set _aligned_root, _aligned_ext = splitext( str( $output_aligned_reads_l ) ) + && mv '${ _aligned_root }.1${_aligned_ext}' '$output_aligned_reads_l' + && mv '${ _aligned_root }.2${_aligned_ext}' '$output_aligned_reads_r' +#end if ]]></command> <inputs> @@ -333,34 +336,25 @@ <when value="single"> <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="FASTA/Q file" help="Must be of datatype "fastqsanger" or "fasta"" /> - <expand macro="align_unalign" /> - </when> <when value="paired"> <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="FASTA/Q file #1" help="Must be of datatype "fastqsanger"or "fasta"" /> <param name="input_2" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="FASTA/Q file #2" help="Must be of datatype "fastqsanger"or "fasta"" /> - <expand macro="align_unalign" /> <expand macro="paired_end_options" /> - </when> <when value="paired_collection"> <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data_collection" collection_type="paired" label="FASTQ Paired Dataset" help="Must be of datatype "fastqsanger" or "fasta"" /> - <expand macro="align_unalign" /> <expand macro="paired_end_options" /> - </when> <when value="paired_interleaved"> <param name="input_1" format="fastqsanger,fastqsanger.gz,fastqsanger.bz2,fasta" type="data" label="Interleaved FASTQ file" help="Must be of datatype "fastqsanger" or "fasta". --interleaved"/> - <expand macro="align_unalign" /> <expand macro="paired_end_options" /> - </when> </conditional> - <!-- reference genome --> <conditional name="reference_genome"> <param name="source" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options. See `Indexes` section of help below"> @@ -379,7 +373,6 @@ <param name="own_file" type="data" format="fasta" label="Select reference genome" /> </when> </conditional> - <!-- read group settings --> <expand macro="read_group_conditional" /> <conditional name="analysis_type"> @@ -502,7 +495,6 @@ <!-- do nothing --> </when> </conditional> - <conditional name="sam_options"> <param name="sam_options_selector" type="select" label="Do you want to tweak SAM/BAM Options?" help="See "Output Options" section of Help below for information"> <option value="yes">Yes</option> @@ -511,6 +503,9 @@ <when value="yes"> <param name="no_unal" type="boolean" truevalue="--no-unal" falsevalue="" label="Suppress SAM records for reads that failed to align" help="--no-unal; Default=False"/> <param name="omit_sec_seq" type="boolean" truevalue="--omit-sec-seq" falsevalue="" label="Suppress SEQ and QUAL strings for secondary alignments" help="--omit-sec-seq; Default=False"/> + <param argument="--sam-no-qname-trunc" type="boolean" truevalue="--sam-no-qname-trunc" falsevalue="" label="Suppress standard behavior of truncating readname at first whitespace at the expense of generating non-standard SAM"/> + <param argument="--xeq" type="boolean" truevalue="--xeq" falsevalue="" label="Use '='/'X', instead of 'M,' to specify matches/mismatches in SAM record."/> + <param argument="--soft-clipped-unmapped-tlen" type="boolean" truevalue="--soft-clipped-unmapped-tlen" falsevalue="" label=" Exclude soft-clipped bases when reporting TLEN"/> </when> <when value="no"> <!-- do nothing --> @@ -535,11 +530,8 @@ </conditional> <param name="save_mapping_stats" type="boolean" checked="False" label="Save the bowtie2 mapping statistics to the history" /> </inputs> - <!-- define outputs --> - <outputs> - <data format="fastqsanger" name="output_unaligned_reads_l" label="${tool.name} on ${on_string}: unaligned reads (L)" > <filter>library['unaligned_file'] is True</filter> <actions> @@ -618,7 +610,6 @@ </conditional> </actions> </data> - <data format="bam" name="output" label="${tool.name} on ${on_string}: aligned reads (sorted BAM)"> <filter>analysis_type['analysis_type_selector'] == "simple" or analysis_type['sam_opt'] is False</filter> <actions> @@ -639,7 +630,6 @@ </conditional> </actions> </data> - <data format="sam" name="output_sam" label="${tool.name} on ${on_string}: aligned reads (SAM)"> <filter>analysis_type['analysis_type_selector'] == "full" and analysis_type['sam_opt'] is True</filter> <actions> @@ -663,9 +653,7 @@ <data format="txt" name="mapping_stats" label="${tool.name} on ${on_string}: mapping stats"> <filter>save_mapping_stats is True</filter> </data> - </outputs> - <tests> <test> <!-- test on paired-end datasets --> @@ -779,7 +767,6 @@ <output name="output" file="bowtie2-test_fasta_in.bam" ftype="bam" lines_diff="2"/> </test> </tests> - <help><![CDATA[ **Bowtie2 Overview**