view alevin.xml @ 9:ecb9ea6269ee draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/salmon commit fe9dd99a14770b6c5f26e24893599acb577e304f"
author bgruening
date Wed, 24 Mar 2021 20:15:12 +0000
parents 04b494623f8e
children e4c01dcece8b
line wrap: on
line source

<tool id="alevin" name="Alevin" version="@VERSION@+galaxy2">
    <description>Quantification and analysis of 3’ tagged-end single-cell sequencing data</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <command detect_errors="exit_code"><![CDATA[
        mkdir ./index
        && mkdir ./output
        #if $refTranscriptSource.TranscriptSource != "indexed":
            && salmon index -i ./index
                --kmerLen '${refTranscriptSource.s_index.kmer}'
                --gencode
                --transcripts '${refTranscriptSource.s_index.fasta}'
            #set $index_path = './index'
        #else
            #set $index_path = $refTranscriptSource.index.fields.path
        #end if
        #if $pairstraight.readselect == 'paired':
            #if $pairstraight.file1.is_of_type("fastq.gz"):
                && cp '${pairstraight.file1}' ./mate1.fastq.gz
                && gunzip ./mate1.fastq.gz
                && cp '${pairstraight.file2}' ./mate2.fastq.gz
                && gunzip ./mate2.fastq.gz
            #else if $pairstraight.file1.is_of_type("fastq.bz2"):
                && cp '${pairstraight.file1}' ./mate1.fastq.bz2
                && bzip2 -d ./mate1.fastq.bz2
                && cp '${pairstraight.file2}' ./mate2.fastq.bz2
                && bzip2 -d ./mate2.fastq.bz2
            #else:
                && ln -s '${pairstraight.file1}' ./mate1.fastq
                && ln -s '${pairstraight.file2}' ./mate2.fastq
            #end if
        #else:
            #if $pairstraight.unmatedreads.is_of_type("fastq.gz"):
                && cp '${pairstraight.unmatedreads}' ./unmate.fastq.gz
                && gunzip ./unmate.fastq.gz
            #else if $pairstraight.unmatedreads.is_of_type("fastq.bz2"):
                && cp '${pairstraight.unmatedreads}' ./unmate.fastq.bz2
                && bzip2 -d unmate.fastq.bz2
            #else:
                && ln -s '${pairstraight.unmatedreads}' ./unmate.fastq
            #end if
        #end if

        && ln -s '${tgmap}' ./alevinmap.tsv
        && salmon alevin -l
        #if $pairstraight.readselect == 'paired':
            ${pairstraight.orientation}${pairstraight.strandedness}
            -i $index_path
            -1 ./mate1.fastq
            -2 ./mate2.fastq
        #else:
            '${pairstraight.strandedness}'
            -i $index_path
            -r zcat ./unmate.fastq
        #end if
        -o ./output
        -p "\${GALAXY_SLOTS:-4}"
        ${protocol}
        --tgMap ./alevinmap.tsv
        #if $whitelist:
            --whitelist '${optional.whitelist}'
        #end if
        #if $optional.numCellBootstraps:
            --numCellBootstraps '${optional.numCellBootstraps}'
        #end if
        #if $optional.forceCells:
            --forceCells '${optional.forceCells}'
        #end if
        #if $optional.expectCells:
            --expectCells '${optional.expectCells}'
        #end if
        #if $optional.mrna:
            --mrna '${optional.mrna}'
        #end if
        #if $optional.rrna:
            --rrna '${optional.rrna}'
        #end if
        #if $optional.keepCBFraction:
            --keepCBFraction '${optional.keepCBFraction}'
        #end if
        ${optional.noDedup}
        ${optional.dumpBfh}
        ${optional.dumpFeatures}
        ${optional.dumpUmiGraph}
        ${optional.dumpMtx}
        #if $optional.lowRegionMinNumBarcodes:
            --lowregionMinNumBarcodes '${optional.lowRegionMinNumBarcodes}'
        #end if
        #if $optional.maxNumBarcodes:
            --maxNumBarcodes '${optional.maxNumBarcodes}'
        #end if
        #if $optional.freqThreshold:
            --freqThreshold '${optional.freqThreshold}'
        #end if

        #if $optional.dumpMtx != "--dumpMtx":
            && python '$__tool_directory__/vpolo_convert.py' -m
        #else:
            && gunzip output/alevin/quants_mat.mtx.gz
        #end if
        #if $optional.dumpUmiGraph:
            && python '$__tool_directory__/vpolo_convert.py' -u
            && sh '$__tool_directory__/umiout.sh'
        #end if

        && gunzip output/alevin/quants_tier_mat.gz
        #if $optional.numCellBootstraps:
            && gunzip output/alevin/quants_mean_mat.gz
            && gunzip output/alevin/quants_var_mat.gz
        #end if

        && gunzip output/aux_info/fld.gz
        && gunzip output/aux_info/observed_bias.gz
        && gunzip output/aux_info/observed_bias_3p.gz
        ]]>
    </command>
    <inputs>
        <expand macro="index"/>
        <conditional name="pairstraight">
            <param name="readselect" label="Single or paired-end reads?" type="select">
                <option value="paired">Paired-end</option>
                <option value="unmated">Single-end</option>
            </param>
            <when value="paired">
                <param name="file1" type="data" format="fastq,fastq.gz,fastqsanger.gz,fastq.bz2" help="CB+UMI raw sequence file(s)"/>
                <param name="file2" type="data" format="fastq,fastq.gz,fastqsanger.gz,fastq.bz2" help="Read-sequence file(s)"/>
                <expand macro="orient"/>
                <expand macro="stranded"/>
            </when>
            <when value="unmated">
                <param name="unmatedreads" type="data" format="fastq,fastq.gz,fastqsanger.gz,fastq.bz2" label="Unmated reads files"/>
                <expand macro="stranded"/>
            </when>
        </conditional>
        <param name="protocol" type="select">
            <option value="--dropseq">DropSeq Single Cell protocol</option>
            <option value="--chromium">10x chromium v2 Single Cell protocol</option>
            <option value="--chromiumV3">10x chromium v3 Single Cell protocol</option>
            <option value="--gemcode">Gemcode v1 Single Cell protocol</option>
            <option value="--celseq">CEL-Seq Single Cell protocol</option>
            <option value="--celseq2">CEL-Seq2 Single Cell protocol</option>
        </param>
        <param name="tgmap" type="data" format="tsv,tabular" label="Transcript to gene map file" help="Tsv with no header, containing two columns mapping each transcript present in the reference to the corresponding gene (the first column is a transcript and the second is the corresponding gene)."/>
        <param name="allout" type="boolean" label="Retrieve all output files" truevalue="Yes" falsevalue="No" checked="false" help="If not selected, all log, info.txt, and json files output by Alevin will not be retrieved"/>
        <section name="optional" title="Optional commands" expanded="false">
            <param name="whitelist" type="data" format="tsv,tabular" optional="true" label="Whitelist file" help="Explicitly specify whitelist CP for cell detection and CB sequence correction. If not specified, putative CBs generated."/>
            <param name="noDedup" type="boolean" truevalue="--noDedup" falsevalue="" checked="false" help="Causes pipeline to only perform CB correction, then maps the read-sequences to the transcriptome generating the interim data-structure of CB-EqClass-UMI-count. Used in parallel with --dumpBarcodeEq or --dumpBfh for the purposes of obtaining raw information or debugging."/>
            <param name="mrna" type="data" format="tsv" optional="true" help="Single column tsv of mitochondrial genes which are to be used as a feature for CB whitelising naive Bayes classification."/>
            <param name="rrna" type="data" format="tsv" optional="true" help="Single column tsv of ribosomal genes which are to be used as a feature for CB whitelising naive Bayes classification."/>
            <param name="dumpBfh" type="boolean" truevalue="--dumpBfh" falsevalue="" checked="false" help="Dumps the full CB-EqClass-UMI-count data-structure for the purposed of allowing raw data analysis and debugging."/>
            <param name="dumpFeatures" type="boolean" truevalue="--dumpFeatures" falsevalue="" checked="false" help="Dumps all features used by the CB classification and their counts at each cell level. Generally, this is used for the purposes of debugging."/>
            <param name="dumpUmiGraph" type="boolean" truevalue="--dumpUmiGraph" falsevalue="" checked="false" help="Dump the per-cell level umi graph"/>
            <param name="dumpMtx" type="boolean" truevalue="--dumpMtx" falsevalue="" checked="false" help="Converts the default binary format of alevin for gene-count matrix into a human readable mtx (matrix market exchange) sparse format."/>
            <param name="forceCells" type="integer" optional="true" help="Explicitly specify the number of cells."/>
            <param name="expectCells" type="integer" optional="true" help="define a close upper bound on expected number of cells."/>
            <param name="numCellBootstraps" type="integer" optional="true" help="Performs certain number of bootstrap and generate the mean and variance of the count matrix"/>
            <param name="minScoreFraction" type="float" optional="true" help="This value controls the minimum allowed score for a mapping to be considered valid. It matters only when --validateMappings has been passed to Salmon. The maximum possible score for a fragment is ms = read_len * ma (or ms = (left_read_len + right_read_len) * ma for paired-end reads).
                The argument to --minScoreFraction determines what fraction of the maximum score s a mapping must achieve to be potentially retained. For a minimum score fraction of f, only mappings with a score less than (f * s) will be kept. Mappings with lower scores will be considered as low-quality, and will be discarded."/>
            <param name="keepCBFraction" type="float" optional="true" help="Fraction of cellular barcodes to keep (Between 0 and 1)."/>
            <param name="lowRegionMinNumBarcodes" type="integer" optional="true" help="Minimum number of cell barcodes to use fo learning low confidence region (defaults to 200)"/>
            <param name="maxNumBarcodes" type="integer" optional="true" help="Maximum allowable limit to process the cell barcodes. Defaults to 100000"/>
            <param name="freqThreshold" type="integer" optional="true" help="Minimum frequency for a barcode to be considered. Defaults to 10"/>
        </section>
    </inputs>
    <outputs>
        <data name="quants_mat.tsv" label="quants_mat.tsv" format="txt" from_work_dir="quants_mat.tsv">
            <filter>optional["dumpMtx"] is not True</filter>
        </data>
        <data name="quants_mat.mtx" label="quants_mat.mtx" format="mtx" from_work_dir="output/alevin/quants_mat.mtx">
            <filter>optional["dumpMtx"]</filter>
        </data>
        <data name="raw_cb_frequency.txt" label="raw_cb_frequency.txt" format="txt" from_work_dir="output/alevin/raw_cb_frequency.txt">
            <filter>optional["dumpFeatures"]</filter>
        </data>
        <data name="quants_mat_cols.txt" label="quants_mat_cols.txt" format="txt" from_work_dir="output/alevin/quants_mat_cols.txt"/>
        <data name="quants_mat_rows.txt" label="quants_mat_rows.txt" format="txt" from_work_dir="output/alevin/quants_mat_rows.txt"/>
        <data name="quants_tier_mat" label="quants_tier_mat" format="mtx" from_work_dir="output/alevin/quants_tier_mat"/>
        <data name="alevin.log" label="alevin.log" format="txt" from_work_dir="output/alevin/alevin.log">
            <filter>allout</filter>
        </data>
        <data name="featureDump.txt" label="featureDump.txt" format="txt" from_work_dir="output/alevin/featureDump.txt"/>
        <data name="whitelist.txt" label="whitelist.txt" format="txt" from_work_dir="output/alevin/whitelist.txt"/>
        <data name="bfh.txt" label="bfh.txt" format="txt" from_work_dir="output/alevin/bfh.txt">
            <filter>optional["dumpBfh"]</filter>
        </data>
        <data name="quants_mean_mat" label="quants_mean_mat" format="mtx" from_work_dir="output/alevin/quants_mean_mat">
            <filter>optional["numCellBootstraps"]</filter>
        </data>
        <data name="quants_var_mat" label="quants_var_mat" format="mtx" from_work_dir="output/alevin/quants_var_mat">
            <filter>optional["numCellBootstraps"]</filter>
        </data>
        <data name="quants_boot_rows.txt" label="quants_boot_rows.txt" format="txt" from_work_dir="output/alevin/quants_boot_rows.txt">
            <filter>optional["numCellBootstraps"]</filter>
        </data>
        <data name="alevinmeta_info.json" format="json" label="meta_info.json" from_work_dir="output/aux_info/alevin_meta_info.json">
            <filter>allout</filter>
        </data>
        <data name="ambig_info.tsv" format="tsv" label="ambig_info.tsv" from_work_dir="output/aux_info/ambig_info.tsv">
            <filter>allout</filter>
        </data>
        <data name="meta_info.json" format="json" label="meta_info.json" from_work_dir="output/aux_info/meta_info.json">
            <filter>allout</filter>
        </data>
        <data name="expected_bias" format="txt" label="expected_bias" from_work_dir="output/aux_info/fld"/>
        <data name="observed_bias" format="txt" label="observed_bias" from_work_dir="output/aux_info/observed_bias"/>
        <data name="observed_bias_3p" format="txt" label="observed_bias_3p" from_work_dir="output/aux_info/observed_bias_3p"/>
        <data name="flenDist.txt" format="txt" label="flenDist.txt" from_work_dir="output/libParams/flenDist.txt"/>
        <data name="salmon_quant.log" format="txt" label="salmon_quant.log" from_work_dir="output/logs/salmon_quant.log">
            <filter>allout</filter>
        </data>
        <collection name="umigraphs" type="list" label="Umi graph PDFs">
            <filter>optional["dumpUmiGraph"]</filter>
            <discover_datasets pattern="__name_and_ext__" ext="pdf" directory="fixed"/>
        </collection>
        <data name="cmd_info.json" label="cmd_info.json" format="json" from_work_dir="output/cmd_info.json">
            <filter>allout</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="11">
            <conditional name="refTranscriptSource">
                <param name="TranscriptSource" value="history"/>
                <section name="s_index">
                    <param name="fasta" value="minitranscript.fa"/>
                </section>
            </conditional>
            <conditional name="pairstraight">
                <param name="readselect" value="paired"/>
                <param name="file1" value="fastqs/moreminifastq1.fastq.gz"/>
                <param name="file2" value="fastqs/moreminifastq2.fastq.gz"/>
                <param name="orientation" value="I"/>
                <param name="strandedness" value="SR"/>
            </conditional>
            <param name="protocol" value="--chromium"/>
            <param name="tgmap" value="minitxp.tsv"/>
            <section name="optional">
                <param name="keepCBFraction" value="1"/>
                <param name="dumpFeatures" value="Yes"/>
                <param name="freqThreshold" value="5"/>
                <param name="dumpMtx" value="Yes"/>
            </section>
            <output name="quants_mat.mtx" file="alevin_mat.mtx" ftype="mtx"/>
        </test>
        <test expect_num_outputs="14">
            <conditional name="refTranscriptSource">
                <param name="TranscriptSource" value="history"/>
                <section name="s_index">
                    <param name="fasta" value="minitranscript.fa"/>
                </section>
            </conditional>
            <conditional name="pairstraight">
                <param name="readselect" value="paired"/>
                <param name="file1" value="fastqs/moreminifastq1.fastq.gz"/>
                <param name="file2" value="fastqs/moreminifastq2.fastq.gz"/>
                <param name="orientation" value="I"/>
                <param name="strandedness" value="SR"/>
            </conditional>
            <param name="protocol" value="--chromium"/>
            <param name="tgmap" value="minitxp.tsv"/>
            <section name="optional">
                <param name="keepCBFraction" value="1"/>
                <param name="dumpFeatures" value="Yes"/>
                <param name="numCellBootstraps" value="2"/>
                <param name="freqThreshold" value="5"/>
                <param name="dumpMtx" value="Yes"/>
            </section>
            <output name="quants_mat.mtx" file="alevin_mat.mtx" ftype="mtx"/>
        </test>
    </tests>
    <help><![CDATA[
        @salmonhelp@
        @alevinhelp@
    ]]></help>
    <expand macro="citations"/>
</tool>