view salmonquant.xml @ 19:15cd64d7c58b draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit 26cff0d523671ac1e56ba7ef4965861b387727e8
author bgruening
date Fri, 23 Jun 2023 17:02:35 +0000
parents c8903f357804
children f4d5237a84f6
line wrap: on
line source

<tool id="salmon" name="Salmon quant" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE_VERSION@">
    <description>Perform dual-phase, reads or mapping-based estimation of transcript abundance from RNA-seq reads</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="aggressive"><![CDATA[
        #if $quant_type.qtype == "reads":
            @indexing@
            @salreads@
        #else:
            @salalign@
        #end if
        @salquant@
        #if $quant_type.qtype == "reads" and $quant_type.bam_options.writeMappings:
            && @bam_sort@ ./output/samout.sam
        #end if
        #if $quant_type.qtype == "alignment" and $quant_type.sampleOut:
            && @bam_sort@ ./output/postSample.bam
        #end if
        ]]>
    </command>
    <inputs>
        <conditional name="quant_type">
            <param name="qtype" type="select" label="Select salmon quantification mode:">
                <option value="reads" selected="True">Reads</option>
                <option value="alignment">Alignment</option>
            </param>
            <when value="reads">
                <expand macro="index"/>
                <expand macro="reads"/>
            </when>
            <when value="alignment">
                <expand macro="align"/>
            </when>
        </conditional>
        <expand macro="quantboth"/>
    </inputs>
    <outputs>
        <data name="output_quant" format="tabular" from_work_dir="output/quant.sf" label="${tool.name} on ${on_string}: transcript quantification" />
        <data name="output_gene_quant" format="tabular" from_work_dir="output/quant.genes.sf" label="${tool.name} on ${on_string}: gene quantification">
            <filter>geneMap</filter>
        </data>
        <data name="output_bam" format="bam" from_work_dir="output/bamout.bam" label="${tool.name} on ${on_string}: BAM">
            <filter>quant_type['qtype'] == "reads" and quant_type['bam_options']['writeMappings']</filter>
        </data>
        <data name="postSample" format="bam" from_work_dir="output/bamout.bam" label="${tool.name} on ${on_string}: sampled input alignments">
            <filter>quant_type['qtype'] == "alignment" and quant_type['sampleOut']</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="2">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <conditional name="single_or_paired">
                        <param name="single_or_paired_opts" value="paired" />
                        <param name="input_mate1" value="fastqs/reads_1.fastq" />
                        <param name="input_mate2" value="fastqs/reads_2.fastq" />
                        <conditional name="libtype">
                            <param name="strandedness" value="U"/>
                        </conditional>
                    </conditional>
                </section>
                <conditional name="bam_options">
                    <param name="writeMappings" value="--writeMappings=./output/samout.sam"/>
                </conditional>
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
            <assert_command>
                <has_text text="--libType IU"/>
            </assert_command>
        </test>
        <test expect_num_outputs="2">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <param name="single_or_paired.single_or_paired_opts" value="paired" />
                    <param name="single_or_paired.input_mate1" value="fastqs/reads_1.fastq" />
                    <param name="single_or_paired.input_mate2" value="fastqs/reads_2.fastq" />
                </section>
                <conditional name="bam_options">
                    <param name="writeMappings" value="--writeMappings=./output/samout.sam"/>
                </conditional>            
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
            <assert_command>
                <has_text text="--libType A"/>
            </assert_command>
        </test>
        <test expect_num_outputs="1">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <param name="single_or_paired.single_or_paired_opts" value="paired" />
                    <param name="single_or_paired.input_mate1" value="fastqs/reads_1.fastq.gz" />
                    <param name="single_or_paired.input_mate2" value="fastqs/reads_2.fastq.gz" />
                    <param name="single_or_paired.strandedness" value="U"/>
                </section>
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <param name="single_or_paired.single_or_paired_opts" value="single" />
                    <param name="single_or_paired.input_mate1" value="fastqs/reads_both.fastq.bz2" />
                    <param name="single_or_paired.strandedness" value="U"/>
                </section>
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
        </test>
        <!-- Test 05 -->
        <test expect_num_outputs="2">
            <conditional name="quant_type">
                <param name="qtype" value="alignment"/>
                <param name="afile" value="salmonbam.bam"/>
                <param name="transcript" value="transcripts.fasta"/>
                <param name="sampleOut" value="--sampleOut"/>
                <param name="sampleUnaligned" value="--sampleUnaligned"/>
                <param name="noErrorModel" value="--noErrorModel"/>
                <param name="numErrorBins" value="5"/>
            </conditional>
            <!-- bam output uses non-deterministic sampling, so can only use compare="sim_size" -->
            <output name="postSample" ftype="bam" value="postSample.bam" compare="sim_size" delta="20000"/>
            <assert_stderr>
                <has_text text="Sampling alignments; outputting results to ./output/postSample.bam"/>
            </assert_stderr>
        </test>
        <test expect_num_outputs="2">
            <conditional name="quant_type">
                <param name="qtype" value="alignment"/>
                <param name="afile" value="salmonbam.bam"/>
                <param name="ont" value="true" />
                <param name="transcript" value="transcripts.fasta"/>
                <param name="sampleOut" value="--sampleOut"/>
                <param name="sampleUnaligned" value="--sampleUnaligned"/>
                <param name="noErrorModel" value="--noErrorModel"/>
                <param name="numErrorBins" value="5"/>
            </conditional>
            <assert_stderr>
                <has_text text="Sampling alignments; outputting results to ./output/postSample.bam"/>
            </assert_stderr>
            <assert_command>
                <has_text text=" --ont "/>
            </assert_command>
        </test>
        <test expect_num_outputs="1">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <param name="single_or_paired.single_or_paired_opts" value="paired" />
                    <param name="single_or_paired.input_mate1" value="fastqs/reads_1.fastq" />
                    <param name="single_or_paired.input_mate2" value="fastqs/reads_2.fastq" />
                    <param name="single_or_paired.strandeness" value="U"/>
                </section>
                <param name="discardOrphansQuasi" value="-discardOrphansQuasi"/>
                <conditional name="validmap">
                    <param name="validateMappings" value="--validateMappings"/>
                </conditional>
                <param name="dovetail" value="--allowDovetail"/>
                <param name="recoverOrphans" value="--recoverOrphans"/>
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <param name="single_or_paired.single_or_paired_opts" value="paired" />
                    <param name="single_or_paired.input_mate1" value="fastqs/reads_1.fastq" />
                    <param name="single_or_paired.input_mate2" value="fastqs/reads_2.fastq" />
                    <param name="single_or_paired.strandedness" value="U"/>
                </section>
            </conditional>
            <param name="seqBias" value="--seqBias"/>
            <param name="gcBias" value="--gcBias"/>
            <section name="adv">
                <param name="dumpEq" value="--dumpEq"/>
                <param name="minAssignedFrags" value="10"/>
                <param name="noLengthCorrection"/>
                <param name="initUniform" value="--initUniform"/>
                <param name="useEM" value="--useEM"/>
                <param name="noGammaDraw" value="--noGammaDraw"/>
            </section>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="indexed"/>
                    <param name="index" value="hg19_transcript_subset" />
                </conditional>
                <section name="input">
                    <conditional name="single_or_paired">
                        <param name="single_or_paired_opts" value="paired" />
                        <param name="input_mate1" value="fastqs/reads_1.fastq" />
                        <param name="input_mate2" value="fastqs/reads_2.fastq" />
                        <param name="strandedness" value="U"/>
                    </conditional>
                </section>
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
        </test>
        <!-- Test 10 -->
        <!-- Test writeQualities option-->
        <test expect_num_outputs="2">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <param name="single_or_paired.single_or_paired_opts" value="paired" />
                    <param name="single_or_paired.input_mate1" value="fastqs/reads_1.fastq" />
                    <param name="single_or_paired.input_mate2" value="fastqs/reads_2.fastq" />
                </section>
                <conditional name="bam_options">
                    <param name="writeMappings" value="--writeMappings=./output/samout.sam"/>
                    <param name="writeQualities" value="true"/>
                </conditional>            
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
            <assert_command>
                <has_text text="--libType A"/>
            </assert_command>
        </test>
        <!-- Test genome input for decoy index -->
        <test expect_num_outputs="2">
            <conditional name="quant_type">
                <param name="qtype" value="reads"/>
                <conditional name="refTranscriptSource">
                    <param name="TranscriptSource" value="history"/>
                    <section name="s_index">
                        <param name="fasta" value="transcripts.fasta"/>
                        <param name="genome" value="genome.fasta"/>
                    </section>
                </conditional>
                <section name="input">
                    <conditional name="single_or_paired">
                        <param name="single_or_paired_opts" value="paired" />
                        <param name="input_mate1" value="fastqs/reads_1.fastq" />
                        <param name="input_mate2" value="fastqs/reads_2.fastq" />
                        <conditional name="libtype">
                            <param name="strandedness" value="U"/>
                        </conditional>
                    </conditional>
                </section>
                <conditional name="bam_options">
                    <param name="writeMappings" value="--writeMappings=./output/samout.sam"/>
                </conditional>
            </conditional>
            <output name="output_quant" ftype="tabular">
                <assert_contents>
                    <has_text text="EffectiveLength" />
                    <has_text text="TPM" />
                    <has_text text="NM_001168316" />
                    <has_text text="NM_174914" />
                    <has_text text="NM_018953" />
                    <has_text text="NR_003084" />
                    <has_text text="NM_017410" />
                    <has_text text="NM_153693" />
                    <has_text text="NR_031764" />
                    <has_n_columns n="5" />
                </assert_contents>
            </output>
            <assert_command>
                <has_text text="--libType IU"/>
                <has_text text="--decoy"/>
            </assert_command>
        </test>
    </tests>
    <help><![CDATA[
        @salmonhelp@
    ]]></help>
    <expand macro="citations"/>
</tool>