root/galaxy-central/tools/fastx_toolkit/fasta_formatter.xml

リビジョン 2, 2.9 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1<tool id="cshl_fasta_formatter" name="FASTA Width">
2        <description>formatter</description>
3        <requirements><requirement type="package">fastx_toolkit</requirement></requirements>
4        <!--
5                Note:
6                        fasta_formatter also has a tabular output mode (-t),
7                        but Galaxy already contains such a tool, so no need
8                        to offer the user a duplicated tool.
9
10                        So this XML tool only changes the width (line-wrapping) of a
11                        FASTA file.
12        -->
13        <command>zcat -f '$input' | fasta_formatter -w $width -o $output</command>
14        <inputs>
15                <param format="fasta" name="input" type="data" label="Library to re-format" />
16
17                <param name="width" type="integer" value="0" label="New width for nucleotides strings" help="Use 0 for single line out." />
18        </inputs>
19
20        <tests>
21                <test>
22                        <!-- Re-format a FASTA file into a single line -->
23                        <param name="input" value="fasta_formatter1.fasta" />
24                        <param name="width" value="0" />
25                        <output name="output" file="fasta_formatter1.out" />
26                </test>
27                <test>
28                        <!-- Re-format a FASTA file into multiple lines wrapping at 60 charactes -->
29                        <param name="input" value="fasta_formatter1.fasta" />
30                        <param name="width" value="60" />
31                        <output name="output" file="fasta_formatter2.out" />
32                </test>
33        </tests>
34
35        <outputs>
36                <data format="input" name="output" metadata_source="input" />
37        </outputs>
38
39<help>
40**What it does**
41
42This tool re-formats a FASTA file, changing the width of the nucleotides lines.
43 
44**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.
45
46--------
47
48**Example**
49
50Input FASTA file (each nucleotides line is 50 characters long)::
51
52    >Scaffold3648
53    AGGAATGATGACTACAATGATCAACTTAACCTATCTATTTAATTTAGTTC
54    CCTAATGTCAGGGACCTACCTGTTTTTGTTATGTTTGGGTTTTGTTGTTG
55    TTGTTTTTTTAATCTGAAGGTATTGTGCATTATATGACCTGTAATACACA
56    ATTAAAGTCAATTTTAATGAACATGTAGTAAAAACT
57    >Scaffold9299
58    CAGCATCTACATAATATGATCGCTATTAAACTTAAATCTCCTTGACGGAG
59    TCTTCGGTCATAACACAAACCCAGACCTACGTATATGACAAAGCTAATAG
60    aactggtctttacctTTAAGTTG
61
62
63Output FASTA file (with width=80)::
64
65    >Scaffold3648
66    AGGAATGATGACTACAATGATCAACTTAACCTATCTATTTAATTTAGTTCCCTAATGTCAGGGACCTACCTGTTTTTGTT
67    ATGTTTGGGTTTTGTTGTTGTTGTTTTTTTAATCTGAAGGTATTGTGCATTATATGACCTGTAATACACAATTAAAGTCA
68    ATTTTAATGAACATGTAGTAAAAACT
69    >Scaffold9299
70    CAGCATCTACATAATATGATCGCTATTAAACTTAAATCTCCTTGACGGAGTCTTCGGTCATAACACAAACCCAGACCTAC
71    GTATATGACAAAGCTAATAGaactggtctttacctTTAAGTTG
72
73Output FASTA file (with width=0 => single line)::
74
75    >Scaffold3648
76    AGGAATGATGACTACAATGATCAACTTAACCTATCTATTTAATTTAGTTCCCTAATGTCAGGGACCTACCTGTTTTTGTTATGTTTGGGTTTTGTTGTTGTTGTTTTTTTAATCTGAAGGTATTGTGCATTATATGACCTGTAATACACAATTAAAGTCAATTTTAATGAACATGTAGTAAAAACT
77    >Scaffold9299
78    CAGCATCTACATAATATGATCGCTATTAAACTTAAATCTCCTTGACGGAGTCTTCGGTCATAACACAAACCCAGACCTACGTATATGACAAAGCTAATAGaactggtctttacctTTAAGTTG
79</help>
80</tool>
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。