view umi-tools_extract.xml @ 4:e73a22ff585c draft

planemo upload commit 76cbd559320d2a639e35ed10cb2d9522a5a77ae0
author iuc
date Mon, 16 Apr 2018 16:38:40 -0400
parents 79436b3019e9
children f77bc14eba31
line wrap: on
line source

<tool id="umi_tools_extract" name="UMI-tools extract" version="@VERSION@.1">
    <description>Extract UMI from fastq files</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code"><![CDATA[
    @COMMAND_LINK@

    umi_tools extract
            --bc-pattern='$bc_pattern'
            #if $input_type.type == 'single':
                #if $gz:
                    --stdin=input_single.gz
                    --stdout out.gz
                #else
                    --stdin='$input_type.input_single'
                    --stdout '$out'
                #end if
            #else:
                #if $gz:
                    --stdin=input_read1.gz
                    --read2-in=input_read2.gz
                    --stdout out1.gz
                    --read2-out=out2.gz
                #else:
                    --stdin='$input_type.input_read1'
                    --read2-in='$input_type.input_read2'
                    --stdout '$out1'
                    --read2-out='$out2'
                #end if
                #if $input_type.barcode.barcode_select == "both_reads":
                    --split-barcode
                    --bc-pattern2='$input_type.barcode.bc_pattern2'
                #end if
            #end if
            #if not $prime3:
                --3prime
            #end if
            #if $quality.quality_selector =='true':
                --quality-filter-threshold '$quality.quality_filter_threshold'
                --quality-encoding '$quality.quality_encoding'
            #end if
            #if $print_log == "1":
                --log='$out_log'
            #else
                --supress-stats
            #end if
        #if $gz:
            #if $input_type.type == 'single':
                && mv out.gz '$out'
            #else
                && mv out1.gz '$out1'
                && mv out2.gz '$out2'
            #end if
        #end if
    ]]></command>
    <inputs>
        <expand macro="input_types" />
        <param name="bc_pattern" argument="--bc-pattern" type="text" label="Barcode pattern for first read"
            help="Use this option to specify the format of the UMI/barcode. Use Ns to
                    represent the random positions and Xs to indicate the bc positions.
                    Bases with Ns will be extracted and added to the read name. Remaining
                    bases, marked with an X will be reattached to the read.">
        </param>
        <param name="prime3" argument="--3prime" type="boolean" label="Is the barcode at the 5' end?"
            truevalue="1" falsevalue="0" checked="true"
            help="By default the barcode is assumed to be on the 5' end of the read, but
                use this option to sepecify that it is on the 3' end instead." />
        <param name="print_log" argument="-L" type="boolean" label="Output log?"
            truevalue="1" falsevalue="0" checked="true"
            help="Choose if you want to generate a text file containing logging information." />
        <conditional name="quality">
            <param name="quality_selector" type="select" label="Enable quality filter?" >
                <option value="false">No</option>
                <option value="true">Yes</option>
            </param>
            <when value="false">
            </when>
            <when value="true">
                <param name="quality_filter_threshold" label="Phred score threshold"
                    type="integer" value="20" argument="--quality-filter-threshold"
                    help="Remove reads where any UMI base quality score falls below this threshold." />
                <param name="quality_encoding" argument="--quality-encoding" type="select" label="Library type"
                    help="Quality score encoding. Choose from phred33 [33-77], phred64 [64-106] or solexa [59-106].">
                    <option value="phred33">phred33 [33-77]</option>
                    <option value="phred64">phred64 [64-106]</option>
                    <option value="solexa">solexa [59-106]</option>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="out" format_source="input_single">
            <filter>input_type['type'] == "single"</filter>
        </data>
        <data name="out1" format_source="input_read1">
            <filter>input_type['type'] !== "single"</filter>
        </data>
        <data name="out2" format_source="input_read2">
            <filter>input_type['type'] !== "single"</filter>
        </data>
        <data name="out_log" format="txt">
            <filter>print_log == True</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="type" value="single" />
            <param name="input_single" value="t_R1.fastq" ftype="fastq" />
            <param name="bc_pattern" value="XXXNNN" />
            <param name="prime3" value="0" />
            <param name="quality_selector" value="true" />
            <param name="quality_filter_threshold" value="10" />
            <param name="quality_encoding" value="phred33" />
            <output name="out" file="out_SE.fastq" />
            <output name="out_log" file="out_single.log" lines_diff="22"/>
        </test>
        <test>
            <param name="type" value="paired" />
            <param name="input_read1" value="t_R1.fastq.gz" ftype="fastq.gz" />
            <param name="input_read2" value="t_R2.fastq.gz" ftype="fastq.gz" />
            <param name="bc_pattern" value="NNNXXX" />
            <output name="out1" file="out_R1.fastq.gz" decompress="true" lines_diff="2" />
            <output name="out2" file="out_R2.fastq.gz" decompress="true" lines_diff="2" />
            <output name="out_log" file="out_paired.log" lines_diff="16"/>
        </test>
        <test>
            <param name="type" value="paired_collection" />
            <param name="input_readpair" >
                <collection type="paired">
                    <element name="forward" ftype="fastq.gz" value="t_R1.fastq.gz" />
                    <element name="reverse" ftype="fastq.gz" value="t_R2.fastq.gz" />
                </collection>
            </param>
            <param name="bc_pattern" value="NNNXXX" />
            <output name="out1" file="out_R1.fastq.gz" decompress="true" lines_diff="2" />
            <output name="out2" file="out_R2.fastq.gz" decompress="true" lines_diff="2" />
            <output name="out_log" file="out_paired.log" lines_diff="16"/>
        </test>
    </tests>
    <help><![CDATA[


UMI-tools extract.py - Extract UMI from fastq
=============================================

Purpose
-------

Extract UMI barcode from a read and add it to the read name, leaving
any sample barcode in place. Can deal with paired end reads and UMIs
split across the paired ends

Options
-------

--split-barcode
       By default the UMI is assumed to be on the first read. Use this
       option if the UMI is contained on both reads and specify the
       pattern of the barcode/UMI on the second read using the option
       ``--bc-pattern2``

--bc-pattern
       Use this option to specify the format of the UMI/barcode. Use Ns to
       represent the random positions and Xs to indicate the bc positions.
       Bases with Ns will be extracted and added to the read name. Remaining
       bases, marked with an X will be reattached to the read.

       E.g. If the pattern is NNXXNN,
       Then the read:

       @HISEQ:87:00000000 read1
       AAGGTTGCTGATTGGATGGGCTAG
       DA1AEBFGGCG01DFH00B1FF0B
       +

       will become:
       @HISEQ:87:00000000_AATT read1
       GGGCTGATTGGATGGGCTAG
       1AFGGCG01DFH00B1FF0B
       +

--bc-pattern2
       Use this option to specify the format of the UMI/barcode for
       the second read pair if required. If --bc-pattern2 is not
       supplied, this defaults to the same pattern as --bc-pattern

--3prime
       By default the barcode is assumed to be on the 5' end of the read, but
       use this option to sepecify that it is on the 3' end instead

-L
       Specify a log file to retain logging information and final statistics

--split-barcode
       barcode is split across read pair

--quality-filter-threshold=QUALITY_FILTER_THRESHOLD
       Remove reads where any UMI base quality score falls
       below this threshold
--quality-encoding=QUALITY_ENCODING
       Quality score encoding. Choose from phred33[33-77]
       phred64 [64-106] or solexa [59-106]

Usage:
------

For single ended reads:
        umi_tools extract --bc-pattern=[PATTERN] -L extract.log [OPTIONS]

reads from stdin and outputs to stdout.

For paired end reads:
        umi_tools extract --bc-pattern=[PATTERN] --read2-in=[FASTQIN] --read2-out=[FASTQOUT] -L extract.log [OPTIONS]

reads end one from stdin and end two from FASTQIN and outputs end one to stdin
and end two to FASTQOUT.

    ]]></help>
    <expand macro="citations" />
</tool>