0
|
1 <tool id="fasta2tab" name="FASTA-to-Tabular" version="1.1.0">
|
|
2 <description>converter</description>
|
|
3 <command interpreter="python">fasta_to_tabular.py $input $output $keep_first $descr_columns</command>
|
|
4 <inputs>
|
|
5 <param name="input" type="data" format="fasta" label="Convert these sequences"/>
|
|
6 <param name="descr_columns" type="integer" size="2" value="1" label="How many columns to divide title string into?" help="Typically 2 to take the ID (first word) and decription (rest) as two columns, or 1 to give a single column">
|
|
7 <validator type="in_range" min="1" />
|
|
8 </param>
|
|
9 <param name="keep_first" type="integer" size="5" value="0" label="How many title characters to keep?" help="Applies only to the first column taken from the title string ('0' = keep the whole thing), useful when your sequence identifiers are all the same length.">
|
|
10 <validator type="in_range" min="0" />
|
|
11 </param>
|
|
12 </inputs>
|
|
13 <outputs>
|
|
14 <data name="output" format="tabular"/>
|
|
15 </outputs>
|
|
16 <tests>
|
|
17 <test>
|
|
18 <param name="input" value="454.fasta" />
|
|
19 <param name="descr_columns" value="1"/>
|
|
20 <param name="keep_first" value="0"/>
|
|
21 <output name="output" file="fasta_to_tabular_out1.tabular" />
|
|
22 </test>
|
|
23
|
|
24 <test>
|
|
25 <param name="input" value="4.fasta" />
|
|
26 <param name="descr_columns" value="1"/>
|
|
27 <param name="keep_first" value="0"/>
|
|
28 <output name="output" file="fasta_to_tabular_out2.tabular" />
|
|
29 </test>
|
|
30
|
|
31 <test>
|
|
32 <param name="input" value="454.fasta" />
|
|
33 <param name="descr_columns" value="1"/>
|
|
34 <param name="keep_first" value="14"/>
|
|
35 <output name="output" file="fasta_to_tabular_out3.tabular" />
|
|
36 </test>
|
|
37
|
|
38 <test>
|
|
39 <param name="input" value="454.fasta" />
|
|
40 <param name="descr_columns" value="2"/>
|
|
41 <param name="keep_first" value="0"/>
|
|
42 <output name="output" file="fasta_to_tabular_out4.tabular" />
|
|
43 </test>
|
|
44
|
|
45 <test>
|
|
46 <param name="input" value="454.fasta" />
|
|
47 <param name="descr_columns" value="5"/>
|
|
48 <param name="keep_first" value="0"/>
|
|
49 <output name="output" file="fasta_to_tabular_out5.tabular" />
|
|
50 </test>
|
|
51
|
|
52 <test>
|
|
53 <param name="input" value="454.fasta" />
|
|
54 <param name="descr_columns" value="5"/>
|
|
55 <param name="keep_first" value="10"/>
|
|
56 <output name="output" file="fasta_to_tabular_out6.tabular" />
|
|
57 </test>
|
|
58
|
|
59 </tests>
|
|
60 <help>
|
|
61
|
|
62 **What it does**
|
|
63
|
|
64 This tool converts FASTA formatted sequences to TAB-delimited format.
|
|
65
|
|
66 Many tools consider the first word of the FASTA ">" title line to be an identifier, and any remaining text to be a free form description.
|
|
67 It is therefore useful to split this text into two columns in Galaxy (identifier and any description) by setting **How many columns to divide title string into?** to **2**.
|
|
68 In some cases the description can be usefully broken up into more columns -- see the examples .
|
|
69
|
|
70 The option *How many characters to keep?* allows to select a specified number of letters from the beginning of each FASTA entry.
|
|
71 With the introduction of the **How many columns to divide title string into?** option this setting is of limited use, but does still allow you to truncate the identifier.
|
|
72
|
|
73 -----
|
|
74
|
|
75 **Example**
|
|
76
|
|
77 Suppose you have the following FASTA formatted sequences from a Roche (454) FLX sequencing run::
|
|
78
|
|
79 >EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_
|
|
80 TCCGCGCCGAGCATGCCCATCTTGGATTCCGGCGCGATGACCATCGCCCGCTCCACCACG
|
|
81 TTCGGCCGGCCCTTCTCGTCGAGGAATGACACCAGCGCTTCGCCCACG
|
|
82 >EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_
|
|
83 AATAAAACTAAATCAGCAAAGACTGGCAAATACTCACAGGCTTATACAATACAAATGTAA
|
|
84
|
|
85 Running this tool with the default settings will produce this (2 column output):
|
|
86
|
|
87 ========================================================================== =======================================
|
|
88 EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
|
|
89 EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_ AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
|
|
90 ========================================================================== =======================================
|
|
91
|
|
92 Having the full title line (the FASTA ">" line text) as a column is not always ideal.
|
|
93
|
|
94 The **How many characters to keep?** option is useful if your identifiers are all the same length.
|
|
95 In this example the identifier is 14 characters, so setting **How many characters to keep?** to **14** (and leaving **How many columns to divide title string into?** as the default, **1**) will produce this (2 column output):
|
|
96
|
|
97 ============== =======================================
|
|
98 EYKX4VC02EQLO5 TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
|
|
99 EYKX4VC02D4GS2 AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
|
|
100 ============== =======================================
|
|
101
|
|
102 If however your FASTA file has identifiers of variable length, it is better to split the text into at least two columns.
|
|
103 Running this tool with **How many columns to divide title string into?** to **2** will produce this (3 column output):
|
|
104
|
|
105 ============== =========================================================== =======================================
|
|
106 EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
|
|
107 EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_ AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
|
|
108 ============== =========================================================== =======================================
|
|
109
|
|
110 Running this tool with **How many columns to divide title string into?** to **5** will produce this (5 column output):
|
|
111
|
|
112 ============== ========== ============ ======== ========================== =======================================
|
|
113 EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
|
|
114 EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_ AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
|
|
115 ============== ========== ============ ======== ========================== =======================================
|
|
116
|
|
117 Running this tool with **How many columns to divide title string into?** to **5** and **How many characters to keep?** to **10** will produce this (5 column output).
|
|
118 Notice that only the first column is truncated to 10 characters -- and be careful not to trim your sequence names too much (generally they should be unique):
|
|
119
|
|
120 ========== ========== ============ ======== ========================== =======================================
|
|
121 EYKX4VC02E length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
|
|
122 EYKX4VC02D length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_ AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
|
|
123 ========== ========== ============ ======== ========================== =======================================
|
|
124
|
|
125 Note the sequences have been truncated for display purposes in the above tables.
|
|
126
|
|
127 </help>
|
|
128 </tool>
|