PageRenderTime 201ms CodeModel.GetById 192ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/tools/fasta_tools/fasta_to_tabular.xml

https://bitbucket.org/cistrome/cistrome-harvard/
XML | 128 lines | 101 code | 27 blank | 0 comment | 0 complexity | cb3c7ce13cb384fa3ee199fa173334f8 MD5 | raw file
  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
 64This tool converts FASTA formatted sequences to TAB-delimited format.
 65
 66Many tools consider the first word of the FASTA "&gt;" title line to be an identifier, and any remaining text to be a free form description.
 67It 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**.
 68In some cases the description can be usefully broken up into more columns -- see the examples .
 69
 70The option *How many characters to keep?* allows to select a specified number of letters from the beginning of each FASTA entry.
 71With 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
 77Suppose you have the following FASTA formatted sequences from a Roche (454) FLX sequencing run::
 78
 79    &gt;EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_
 80    TCCGCGCCGAGCATGCCCATCTTGGATTCCGGCGCGATGACCATCGCCCGCTCCACCACG
 81    TTCGGCCGGCCCTTCTCGTCGAGGAATGACACCAGCGCTTCGCCCACG
 82    &gt;EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_
 83    AATAAAACTAAATCAGCAAAGACTGGCAAATACTCACAGGCTTATACAATACAAATGTAA
 84
 85Running this tool with the default settings will produce this (2 column output):
 86
 87========================================================================== =======================================
 88EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
 89EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_  AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
 90========================================================================== =======================================
 91
 92Having the full title line (the FASTA "&gt;" line text) as a column is not always ideal.
 93
 94The **How many characters to keep?** option is useful if your identifiers are all the same length.
 95In 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============== =======================================
 98EYKX4VC02EQLO5 TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
 99EYKX4VC02D4GS2 AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
100============== =======================================
101
102If however your FASTA file has identifiers of variable length, it is better to split the text into at least two columns.
103Running this tool with **How many columns to divide title string into?** to **2** will produce this (3 column output):
104
105============== =========================================================== =======================================
106EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
107EYKX4VC02D4GS2 length=60 xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_  AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
108============== =========================================================== =======================================
109
110Running this tool with **How many columns to divide title string into?** to **5** will produce this (5 column output):
111
112============== ========== ============ ======== ========================== =======================================
113EYKX4VC02EQLO5 length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
114EYKX4VC02D4GS2 length=60  xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_ AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
115============== ========== ============ ======== ========================== =======================================
116
117Running 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).
118Notice 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========== ========== ============ ======== ========================== =======================================
121EYKX4VC02E length=108 xy=1826_0455 region=2 run=R_2007_11_07_16_15_57_ TCCGCGCCGAGCATGCCCATCTTGGATTCCGGC...ACG
122EYKX4VC02D length=60  xy=1573_3972 region=2 run=R_2007_11_07_16_15_57_ AATAAAACTAAATCAGCAAAGACTGGCAAATAC...TAA
123========== ========== ============ ======== ========================== =======================================
124
125Note the sequences have been truncated for display purposes in the above tables.
126
127	</help>
128</tool>