Mercurial > repos > damion > ffp_phylogeny
comparison ffp_phylogeny.xml @ 0:eb6e5e78a066 draft
Uploaded
author | damion |
---|---|
date | Mon, 23 Feb 2015 18:25:25 -0500 |
parents | |
children | d1c88b118a3f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:eb6e5e78a066 |
---|---|
1 <tool id="ffp_phylogeny" name="Feature Frequency Profile Phylogeny" version="0.1.00"> | |
2 <description>An alignment free comparison tool for phylogenetic analysis and text comparison</description> | |
3 <requirements> | |
4 <requirement type="package" version="0.3.19_d4382db015acec0e5cc43d6c1ac80ae12cb7e6b3">ffp-phylogeny</requirement> | |
5 </requirements> | |
6 | |
7 <macros> | |
8 <token name="@BINARY@">./ffp_phylogeny.py</token> | |
9 <import>ffp_macros.xml</import> | |
10 </macros> | |
11 <expand macro="requirements" /> | |
12 <command interpreter="python"><![CDATA[ | |
13 ffp_phylogeny.py | |
14 #for $i in $sequence.filesin | |
15 "$i" ## full file paths | |
16 #end for | |
17 -x " | |
18 #for $i in $sequence.filesin | |
19 $i.name, ## original file names | |
20 #end for | |
21 " | |
22 -t "$(sequence.file_type.split('-')[0])" | |
23 -l "$length" | |
24 -o "$info" | |
25 ##if $normalize: | |
26 ## -n | |
27 ##end if | |
28 #if $sequence.file_type != 'text': | |
29 #if $sequence.file_type.find('multi') > 0: | |
30 -m | |
31 #end if | |
32 #if $sequence.grouping: | |
33 -d | |
34 #end if | |
35 #if $metric: | |
36 -M "$metric" | |
37 #end if | |
38 #if $similarity: | |
39 -s | |
40 #end if | |
41 #if $abbreviate: | |
42 -a | |
43 #end if | |
44 #end if | |
45 #if $phylogeny.phylo_type == 'filter': | |
46 -f "$phylogeny.filt.filter_type" | |
47 -L "$phylogeny.filt.lower" | |
48 -U "$phylogeny.filt.upper" | |
49 #end if | |
50 #if $tree: | |
51 -T | |
52 #end if | |
53 | |
54 ##ffpjsd -n FLOAT , --normval=FLOAT | |
55 ## For option -e, --euclid, change the n-norm distance (Default is n=2) to any other value where n > 1 | |
56 | |
57 ]]></command> | |
58 <expand macro="stdio" /> | |
59 <inputs> | |
60 | |
61 <!-- Either amino acid or nucleotide input --> | |
62 <!-- Ideally we could determine from file content or suffix what type it is --> | |
63 | |
64 <param name="length" type="integer" min="1" max="25" label="l-mer length" value="6" help="String of valid characters of this length will be counted. Synonyms: feature, k-mer, n-gram, k-tuple" size="2"/> | |
65 <!-- | |
66 <param name="normalize" label="Normalize counts into relative frequency" type="boolean" checked="true" help="" /> | |
67 --> | |
68 <conditional name="sequence"> | |
69 <param type="select" name="file_type" label="File type" help="Note: For phylogeny display, at least three profiles are required, as files or fasta sequences within a file."> | |
70 <option value="amino">Amino Acids, one sequence per file</option> | |
71 <option value="amino-multi">Amino Acids, multiple fasta sequences per file</option> | |
72 <option value="nucleotide">Nucleic acids, one sequence per file</option> | |
73 <option value="nucleotide-multi">Nucleic acids, multiple fasta sequences per file</option> | |
74 <option value="text">Text, single file</option> | |
75 </param> | |
76 | |
77 <when value="amino"><!-- ffpaa --> | |
78 <param name="filesin" type="data" label="Select input file(s)" format="fasta" multiple="true" /> | |
79 <param name="grouping" label="Enable amino acid grouping" type="boolean" checked="true" help="Counts amino acids in groups rather than individually (usually advantageous, see below)." /> | |
80 </when> | |
81 | |
82 <when value="amino-multi"> | |
83 <param name="filesin" type="data" label="Select input file(s)" format="fasta" multiple="true" /> | |
84 <param name="grouping" label="Enable amino acid grouping" type="boolean" checked="true" help="Counts amino acids in groups rather than individually (usually advantageous, see below)." /> | |
85 </when> | |
86 | |
87 <when value="nucleotide"><!-- ffpry --> | |
88 <param name="filesin" type="data" label="Select input file(s)" format="fasta" multiple="true" /> | |
89 <param name="grouping" label="Enable purine / pyrimidine grouping" type="boolean" checked="true" help="Counts each nucleotide as a purine(R) or pyrimidine(Y) rather than individually (usually advantageous)." /> | |
90 </when> | |
91 | |
92 <when value="nucleotide-multi"> | |
93 <param name="filesin" type="data" label="Select input file(s)" format="fasta" multiple="true" /> | |
94 <param name="grouping" label="Enable purine / pyrimidine grouping" type="boolean" checked="true" help="Counts each nucleotide as a purine(R) or pyrimidine(Y) rather than individually (usually advantageous)." /> | |
95 </when> | |
96 | |
97 <when value="text"><!-- ffptxt --> | |
98 <param name="filesin" type="data" multiple="true"/> | |
99 </when> | |
100 | |
101 | |
102 </conditional> | |
103 | |
104 <conditional name="phylogeny"> | |
105 <param type="select" name="phylo_type" label="Feature filtering"> | |
106 <option value="all">Include all features (Phenetic phylogeny)</option> | |
107 <option value="filt">Include only filtered features (Core/evolutionary phylogeny) </option> | |
108 </param> | |
109 <when value="all"></when> | |
110 <when value="filt"> | |
111 <conditional name="filt"> | |
112 | |
113 <param type="select" name="filter_type" label="Filter type" help="Features are included in profiles if at least 1 profile has lower count/percent, and no profile has more than upper count/percent"> | |
114 <option value="count">lower / upper count limit</option> | |
115 <option value="f">raw frequencies</option> | |
116 <option value="n">normal distribution</option> | |
117 <option value="e">extreme value (Gumbel) distribution</option> | |
118 </param> | |
119 <when value="count"> | |
120 <param name="lower" type="integer" label="lower count (one profile needs at least this)" value="0" min="0" /> | |
121 <param name="upper" type="integer" label="upper count (no profile can have more than this)" value="0" min="0" /> | |
122 </when> | |
123 <when value="f"> | |
124 <param name="lower" type="float" label="lower %" value="0.05" min="0" max=".5" /> | |
125 <param name="upper" type="float" label="upper %" value="0.95" min=".5" max="1" /> | |
126 </when> | |
127 <when value="n"> | |
128 <param name="lower" type="float" label="lower %" value="0.05" min="0" max=".5" /> | |
129 <param name="upper" type="float" label="upper %" value="0.95" min=".5" max="1" /> | |
130 </when> | |
131 <when value="e"> | |
132 <param name="lower" type="float" label="lower %" value="0.05" min="0" max=".5" /> | |
133 <param name="upper" type="float" label="upper %" value="0.95" min=".5" max="1" /> | |
134 </when> | |
135 | |
136 </conditional> | |
137 </when> | |
138 | |
139 </conditional> | |
140 | |
141 <param type="select" name="metric" label="Continuous Distance Measure" help="See ffpjsd documentation for details."> | |
142 <option value="" selected="true">Jensen Shannon divergence (default)</option> | |
143 <option value="euclid">Euclidean</option> | |
144 <option value="euclid2">Euclidean squared</option> | |
145 <option value="cosine">Cosine</option> | |
146 <option value="manhattan">Manhattan</option> | |
147 <option value="pearson">pearson correlation coefficient*</option> | |
148 <option value="chebyshev">Chebyshev</option> | |
149 <option value="canberra">Canberra</option> | |
150 <option value="hamming">Hamming</option> | |
151 <option value="evol">Evolutionary Distance used in E.coli Publications</option> | |
152 | |
153 <!-- | |
154 | |
155 With these options the input FFPs are treated as binary data. When two FFPs (i and j) are compared each | |
156 distance measure uses a cross tabulation for pairwise feature comparison with sums A, B, C and D. A is | |
157 the number of features which are present in both vectors while D is the number of features that are absent in | |
158 both vectors. B means the feature is present in i and absent in j. C means the feature is absent in i but | |
159 present in j. N is the sum of A+B+C+D. All of the binary distance options can be used together with the -s | |
160 option to print a similarity matrix. THe binary distance do not need to be normalized with ffprwn. | |
161 | |
162 <option value="">BINARY DISTANCE MEASURES</option> | |
163 | |
164 --> | |
165 | |
166 <option value="matching">matching*</option> | |
167 <option value="jaccard">Jaccard*</option> | |
168 <option value="tanimoto">Rogers-Tanimoto*</option> | |
169 <option value="dice">Dice*</option> | |
170 <option value="antidice">anti-Dice*</option> | |
171 <option value="sneath">Sneath-Sokal*</option> | |
172 <option value="hamman">Hamman*</option> | |
173 <option value="phi">Pearson Phi*</option> | |
174 <option value="anderberg">Anderberg*</option> | |
175 <option value="gower">Gower*</option> | |
176 <option value="russel">Russel-Rao*</option> | |
177 <option value="yule">Yule*</option> | |
178 <option value="ochiai">Ochiai*</option> | |
179 <option value="kulczynski">Kulczynski*</option> | |
180 | |
181 </param> | |
182 | |
183 <param type="boolean" name="similarity" label="*Similarity Matrix" help="Print a similarity matrix rather than a distance matrix for items marked by asterisk(*). This option effects the output of distances metrics which have a value normalized from 0 to 1 or -1 to 1."/> | |
184 | |
185 <param type="boolean" name="abbreviate" label="Short labels" help="Shorten tree taxonomy labels as much as possible."/> | |
186 | |
187 <param type="boolean" name="tree" checked="true" label="Generate Tree Phylogeny" truevalue="1" falsevalue="0" /> | |
188 | |
189 </inputs> | |
190 <outputs> | |
191 <data name="info" format="nhx" label="Feature Frequency Profile"> | |
192 <change_format> | |
193 <when input="tree" value="0" format="tabular"/> | |
194 </change_format> | |
195 <!-- doesn't work: filter>tree == "1"</filter --> | |
196 </data> | |
197 </outputs> | |
198 | |
199 <tests> | |
200 <test> | |
201 <param name="length" value="1"/> | |
202 <param name="tree" value="0"/> | |
203 <param name="grouping" value="true"/> | |
204 <param name="file_type" value="nucleotide"/> | |
205 <param name="filesin" value="genome1,genome2"/> | |
206 <output name="info" file="test_length_1_output.tabular"/> | |
207 </test> | |
208 <test> | |
209 <param name="length" value="2"/> | |
210 <param name="tree" value="0"/> | |
211 <param name="grouping" value="true"/> | |
212 <param name="file_type" value="nucleotide"/> | |
213 <param name="filesin" value="genome1,genome2"/> | |
214 <output name="info" file="test_length_2_output.tabular"/> | |
215 </test> | |
216 </tests> | |
217 | |
218 <help><![CDATA[ | |
219 | |
220 .. class:: infomark | |
221 | |
222 | |
223 **What it does** | |
224 | |
225 FFP (Feature frequency profile) is an alignment free comparison tool for phylogenetic analysis and text comparison. It can be applied to nucleotide sequences, complete genomes, proteomes and even used for text comparison. | |
226 | |
227 This galaxy tool prepares a mini-pipeline consisting of **[ffpry | ffpaa | ffptxt] > [ ffpfilt | ffpcol > ffprwn] > ffpjsd > ffptree** . The last step is optional - by deselecting the "Generate Tree Phylogeny" checkbox, the tool will output a distance matrix rather than a Newick (.nhx) formatted tree file. | |
228 | |
229 Each sequence or text file has a profile containing tallies of each feature found. A feature is a string of valid characters of given length. | |
230 | |
231 For nucleotide data, by default each character (ATGC) is grouped as either purine(R) or pyrmidine(Y) before being counted. | |
232 | |
233 For amino acid data, by default each character is grouped into one of the following: | |
234 (ST),(DE),(KQR),(IVLM),(FWY),C,G,A,N,H,P. Each group is represented by the first character in its series. | |
235 | |
236 One other key concept is that a given feature, e.g. "TAA" is counted in forward | |
237 AND reverse directions, mirroring the idea that a feature's orientation is not | |
238 so important to distinguish when it comes to alignment-free comparison. | |
239 The counts for "TAA" and "AAT" are merged. | |
240 | |
241 The labeling of the resulting counted feature items is perhaps the trickiest | |
242 concept to master. Due to computational efficiency measures taken by the | |
243 developers, a feature that we see on paper as "TAC" may be stored and labeled | |
244 internally as "GTA", its reverse compliment. One must look for the alternative | |
245 if one does not find the original. | |
246 | |
247 Also note that in amino acid sequences the stop codon "*" (or any other character | |
248 that is not in the Amino acid alphabet) causes that character frame not to be | |
249 counted. Also, character frames never span across fasta entries. | |
250 | |
251 A few tutorials: | |
252 * http://sourceforge.net/projects/ffp-phylogeny/files/Documentation/tutorial.pdf | |
253 * https://github.com/apetkau/microbial-informatics-2014/tree/master/labs/ffp-phylogeny | |
254 | |
255 ------- | |
256 | |
257 .. class:: warningmark | |
258 | |
259 **Note** | |
260 | |
261 Taxonomy label details: If each file contains one profile, the file's name is used to label the profile. | |
262 If each file contains fasta sequences to profile individually, their fasta identifiers will be used to label them. | |
263 The "short labels" option will find the shortest label that uniquely identifies each profile. | |
264 Either way, there are some quirks: ffpjsd clips labels to 10 characters if they are greater than 50 characters, so all labels are trimmed to 50 characters first. | |
265 Also "id" is prefixed to any numeric label since some tree visualizers won't show purely numeric labels. | |
266 In the accidental case where a Fasta sequence label is a duplicate of a previous one it will be prefixed by "DupLabel-". | |
267 | |
268 The command line ffpjsd can hang if one provides an l-mer length greater than the length of file content. | |
269 One must identify its process id (">ps aux | grep ffpjsd") and kill it (">kill [process id]"). | |
270 ------- | |
271 | |
272 **References** | |
273 | |
274 The original ffp-phylogeny code is at http://ffp-phylogeny.sourceforge.net/ . | |
275 This tool uses Aaron Petkau's modified version: https://github.com/apetkau/ffp-3.19-custom . | |
276 | |
277 The development of the ff-phylogeny should be attributed to: | |
278 | |
279 Sims GE, Jun S-R, Wu GA, Kim S-H. Alignment-free genome comparison with feature frequency profiles (FFP) and optimal resolutions. Proceedings of the National Academy of Sciences of the United States of America 2009;106(8):2677-2682. doi:10.1073/pnas.0813249106. | |
280 | |
281 ]]></help> | |
282 </tool> | |
283 | |
284 |