view fasta_formatter.xml @ 4:516b97a23d7e draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/fastx_toolkit/fasta_formatter commit fd099d17eceaa319fbfe429f4725328d88b18c9f
author iuc
date Thu, 10 Aug 2023 06:52:44 +0000
parents 859422bcb689
children
line wrap: on
line source

<tool id="cshl_fasta_formatter" version="1.0.1+galaxy@VERSION_SUFFIX@" profile="22.05" name="FASTA Width">
    <description>formatter</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <!--
        Note:
            fasta_formatter also has a tabular output mode (-t),
            but Galaxy already contains such a tool, so no need
            to offer the user a duplicated tool.

            So this XML tool only changes the width (line-wrapping) of a
            FASTA file.
    -->
    <command detect_errors="exit_code"><![CDATA[
@CATS@ fasta_formatter
-w $width
-o '$output'
    ]]></command>
    <inputs>
        <expand macro="fasta_input" />

        <param name="width" type="integer" value="0" label="New width for nucleotides strings" help="Use 0 for single line out." />
    </inputs>
    <outputs>
        <data name="output" format="fasta" metadata_source="input" />
    </outputs>
    <tests>
        <test>
            <!-- Re-format a FASTA file into a single line -->
            <param name="input" value="fasta_formatter1.fasta" />
            <param name="width" value="0" />
            <output name="output" file="fasta_formatter1.out" />
        </test>
        <test>
            <!-- Re-format a FASTA file into multiple lines wrapping at 60 charactes -->
            <param name="input" value="fasta_formatter1.fasta" />
            <param name="width" value="60" />
            <output name="output" file="fasta_formatter2.out" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

This tool re-formats a FASTA file, changing the width of the nucleotides lines.

**TIP:** Outputting a single line (with **width = 0**) can be useful for scripting (with **grep**, **awk**, and **perl**). Every odd line is a sequence identifier, and every even line is a nucleotides line.

--------

**Example**

Input FASTA file (each nucleotides line is 50 characters long)::

    >Scaffold3648
    AGGAATGATGACTACAATGATCAACTTAACCTATCTATTTAATTTAGTTC
    CCTAATGTCAGGGACCTACCTGTTTTTGTTATGTTTGGGTTTTGTTGTTG
    TTGTTTTTTTAATCTGAAGGTATTGTGCATTATATGACCTGTAATACACA
    ATTAAAGTCAATTTTAATGAACATGTAGTAAAAACT
    >Scaffold9299
    CAGCATCTACATAATATGATCGCTATTAAACTTAAATCTCCTTGACGGAG
    TCTTCGGTCATAACACAAACCCAGACCTACGTATATGACAAAGCTAATAG
    aactggtctttacctTTAAGTTG


Output FASTA file (with width=80)::

    >Scaffold3648
    AGGAATGATGACTACAATGATCAACTTAACCTATCTATTTAATTTAGTTCCCTAATGTCAGGGACCTACCTGTTTTTGTT
    ATGTTTGGGTTTTGTTGTTGTTGTTTTTTTAATCTGAAGGTATTGTGCATTATATGACCTGTAATACACAATTAAAGTCA
    ATTTTAATGAACATGTAGTAAAAACT
    >Scaffold9299
    CAGCATCTACATAATATGATCGCTATTAAACTTAAATCTCCTTGACGGAGTCTTCGGTCATAACACAAACCCAGACCTAC
    GTATATGACAAAGCTAATAGaactggtctttacctTTAAGTTG

Output FASTA file (with width=0 => single line)::

    >Scaffold3648
    AGGAATGATGACTACAATGATCAACTTAACCTATCTATTTAATTTAGTTCCCTAATGTCAGGGACCTACCTGTTTTTGTTATGTTTGGGTTTTGTTGTTGTTGTTTTTTTAATCTGAAGGTATTGTGCATTATATGACCTGTAATACACAATTAAAGTCAATTTTAATGAACATGTAGTAAAAACT
    >Scaffold9299
    CAGCATCTACATAATATGATCGCTATTAAACTTAAATCTCCTTGACGGAGTCTTCGGTCATAACACAAACCCAGACCTACGTATATGACAAAGCTAATAGaactggtctttacctTTAAGTTG

------

This tool is based on `FASTX-toolkit`__ by Assaf Gordon.

 .. __: http://hannonlab.cshl.edu/fastx_toolkit/
    ]]></help>
    <expand macro="citations" />
</tool>