view fastq_trimmer.xml @ 6:f0b18efb97f1 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/galaxy_sequence_utils/fastq_trimmer commit bb5df9e62585e12f08dfc0a9f86eec8e205b4845
author iuc
date Fri, 04 Oct 2024 10:35:28 +0000
parents b63b2bfb3ea3
children
line wrap: on
line source

<tool id="fastq_trimmer" name="FASTQ Trimmer" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>by column</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <edam_topics>
        <edam_topic>topic_0622</edam_topic>
    </edam_topics>
    <edam_operations>
        <edam_operation>operation_3192</edam_operation>
    </edam_operations>
    <expand macro="requirements"/>
    <command><![CDATA[
gx-fastq-trimmer '$input_file' '$output_file' ${offset_type.left_column_offset} ${offset_type.right_column_offset} ${offset_type.base_offset_type} '${input_file.extension[len('fastq'):]}' $keep_zero_length
    ]]></command>
    <inputs>
        <param name="input_file" type="data" format="fastqsanger,fastqcssanger,fastqsanger.gz,fastqcssanger.gz,fastqsanger.bz2,fastqcssanger.bz2" label="FASTQ file"/>
        <conditional name="offset_type">
            <param name="base_offset_type" type="select" label="Define Base Offsets as" help="Use Absolute for fixed length reads (Illumina, SOLiD)&lt;br&gt;Use Percentage for variable length reads (Roche/454)">
                <option value="offsets_absolute" selected="true">Absolute Values</option>
                <option value="offsets_percent">Percentage of Read Length</option>
            </param>
            <when value="offsets_absolute">
                <param name="left_column_offset" type="integer" min="0" value="0" label="Offset from 5' end" help="Values start at 0, increasing from the left" />
                <param name="right_column_offset" type="integer" value="0" label="Offset from 3' end" help="Values start at 0, increasing from the right; use a negative value to remove everything to the right of the absolute value of the position" />
            </when>
            <when value="offsets_percent">
                <param name="left_column_offset" type="float" min="0" max="100" value="0" label="Offset from 5' end" />
                <param name="right_column_offset" type="float" min="0" max="100" value="0" label="Offset from 3' end" />
            </when>
        </conditional>
        <param name="keep_zero_length" type="boolean" truevalue="keep_zero_length" falsevalue="exclude_zero_length" checked="false" label="Keep reads with zero length" />
    </inputs>
    <outputs>
        <data name="output_file" format_source="input_file" />
    </outputs>
    <tests>
        <test>
            <!-- Do nothing trim -->
            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
            <param name="base_offset_type" value="offsets_absolute"/>
            <param name="left_column_offset" value="0"/>
            <param name="right_column_offset" value="0"/>
            <param name="keep_zero_length" value="keep_zero_length" />
            <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
        </test>
        <!-- Trim to empty File -->
        <test>
            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
            <param name="base_offset_type" value="offsets_absolute"/>
            <param name="left_column_offset" value="30"/>
            <param name="right_column_offset" value="64"/>
            <param name="keep_zero_length" value="exclude_zero_length" />
            <output name="output_file" file="empty_file.dat" ftype="fastqsanger" />
        </test>
        <test>
            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
            <param name="base_offset_type" value="offsets_percent"/>
            <param name="left_column_offset" value="50"/>
            <param name="right_column_offset" value="50"/>
            <param name="keep_zero_length" value="exclude_zero_length" />
            <output name="output_file" file="empty_file.dat" ftype="fastqsanger" />
        </test>
        <!-- Trim to 4 inner-most bases -->
        <test>
            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
            <param name="base_offset_type" value="offsets_absolute"/>
            <param name="left_column_offset" value="45"/>
            <param name="right_column_offset" value="45"/>
            <param name="keep_zero_length" value="exclude_zero_length" />
            <output name="output_file" file="fastq_trimmer_out1.fastqsanger" ftype="fastqsanger" />
        </test>
        <test>
            <param name="input_file" value="sanger_full_range_original_sanger.fastqsanger" ftype="fastqsanger" />
            <param name="base_offset_type" value="offsets_percent"/>
            <param name="left_column_offset" value="47.87"/>
            <param name="right_column_offset" value="47.87"/>
            <param name="keep_zero_length" value="exclude_zero_length" />
            <output name="output_file" file="fastq_trimmer_out1.fastqsanger" ftype="fastqsanger" />
        </test>
    </tests>
    <help><![CDATA[
**What is does**

This tool allows you to trim the ends of reads.

You can specify either absolute or percent-based offsets. Offsets are calculated, starting at 0, from the respective end to be trimmed. When using the percent-based method, offsets are rounded to the nearest integer.

For example, if you have a read of length 36::

  @Some FASTQ Sanger Read
  CAATATGTNCTCACTGATAAGTGGATATNAGCNCCA
  +
  =@@.@;B-%?8>CBA@>7@7BBCA4-48%<;;%<B@

And you set absolute offsets of 2 and 9::

  @Some FASTQ Sanger Read
  ATATGTNCTCACTGATAAGTGGATA
  +
  @.@;B-%?8>CBA@>7@7BBCA4-4

Or you set percent offsets of 6% and 20% (corresponds to absolute offsets of 2,7 for a read length of 36)::

  @Some FASTQ Sanger Read
  ATATGTNCTCACTGATAAGTGGATATN
  +
  @.@;B-%?8>CBA@>7@7BBCA4-48%

-----

.. class:: warningmark

Trimming a color space read will cause any adapter base to be lost.
    ]]></help>
    <citations>
        <citation type="doi">10.1093/bioinformatics/btq281</citation>
    </citations>
</tool>