annotate phylogenetic_tree.xml @ 10:9b92372de9f6

rename snp to gsSnp, sap to gdSap
author Richard Burhans <burhans@bx.psu.edu>
date Tue, 04 Sep 2012 12:49:53 -0400
parents e29f4d801bb0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
1 <tool id="gd_phylogenetic_tree" name="Phylogenetic" version="1.0.0">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
2 <description>tree</description>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
3
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
4 <command interpreter="python">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
5 phylogenetic_tree.py "$input"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
6 #if $individuals.choice == '0'
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
7 "all_individuals"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
8 #else if $individuals.choice == '1'
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
9 "$p1_input"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
10 #end if
4
7a94f11fe71f change output.extra_files_path to output.files_path
Richard Burhans <burhans@bx.psu.edu>
parents: 0
diff changeset
11 "$output" "$output.files_path" "$minimum_coverage" "$minimum_quality"
0
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
12 #if ((str($input.metadata.scaffold) == str($input.metadata.ref)) and (str($input.metadata.pos) == str($input.metadata.rPos))) or (str($include_reference) == '0')
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
13 "none"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
14 #else
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
15 "$input.metadata.dbkey"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
16 #end if
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
17 "$data_source"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
18 #set $draw_tree_options = ''.join(str(x) for x in [$branch_style, $scale_style, $length_style, $layout_style])
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
19 #if $draw_tree_options == ''
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
20 ""
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
21 #else
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
22 "-$draw_tree_options"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
23 #end if
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
24 #for $individual_name, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns)
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
25 #set $arg = '%s:%s' % ($individual_col, $individual_name)
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
26 "$arg"
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
27 #end for
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
28 </command>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
29
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
30 <inputs>
10
9b92372de9f6 rename snp to gsSnp, sap to gdSap
Richard Burhans <burhans@bx.psu.edu>
parents: 7
diff changeset
31 <param name="input" type="data" format="gdSnp" label="SNP table" />
0
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
32
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
33 <conditional name="individuals">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
34 <param name="choice" type="select" label="Individuals">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
35 <option value="0" selected="true">All</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
36 <option value="1">Individuals in a population</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
37 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
38 <when value="0" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
39 <when value="1">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
40 <param name="p1_input" type="data" format="ind" label="Population individuals" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
41 </when>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
42 </conditional>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
43
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
44 <param name="minimum_coverage" type="integer" min="0" value="0" label="Minimum coverage" help="Note: Minimum coverage and Minimum quality cannot both be 0" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
45
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
46 <param name="minimum_quality" type="integer" min="0" value="0" label="Minimum quality" help="Note: Minimum coverage and Minimum quality cannot both be 0" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
47
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
48 <param name="include_reference" type="select" format="integer" label="Include reference sequence">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
49 <option value="1" selected="true">Yes</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
50 <option value="0">No</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
51 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
52
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
53 <param name="data_source" type="select" format="integer" label="Data source">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
54 <option value="0" selected="true">sequence coverage</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
55 <option value="1">estimated genotype</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
56 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
57
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
58 <param name="branch_style" type="select" display="radio">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
59 <label>Branch type</label>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
60 <option value="" selected="true">square</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
61 <option value="d">diagonal</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
62 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
63
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
64 <param name="scale_style" type="select" display="radio">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
65 <label>Draw branches to scale</label>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
66 <option value="" selected="true">yes</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
67 <option value="s">no</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
68 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
69
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
70 <param name="length_style" type="select" display="radio">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
71 <label>Show branch lengths</label>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
72 <option value="" selected="true">yes</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
73 <option value="b">no</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
74 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
75
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
76 <param name="layout_style" type="select" display="radio">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
77 <label>Tree layout</label>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
78 <option value="" selected="true">horizontal</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
79 <option value="v">vertical</option>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
80 </param>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
81 </inputs>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
82
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
83 <outputs>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
84 <data name="output" format="html" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
85 </outputs>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
86
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
87 <tests>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
88 <test>
10
9b92372de9f6 rename snp to gsSnp, sap to gdSap
Richard Burhans <burhans@bx.psu.edu>
parents: 7
diff changeset
89 <param name="input" value="test_in/sample.gdSnp" ftype="gdSnp" />
0
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
90 <param name="choice" value="0" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
91 <param name="minimum_coverage" value="3" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
92 <param name="minimum_quality" value="30" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
93 <param name="data_source" value="0" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
94 <param name="branch_style" value="" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
95 <param name="scale_style" value="" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
96 <param name="length_style" value="" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
97 <param name="layout_style" value="" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
98 <output name="output" file="test_out/phylogenetic_tree/phylogenetic_tree.html" ftype="html" compare="diff" lines_diff="2">
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
99 <extra_files type="file" name="distance_matrix.phylip" value="test_out/phylogenetic_tree/distance_matrix.phylip" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
100 <extra_files type="file" name="informative_snps.txt" value="test_out/phylogenetic_tree/informative_snps.txt" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
101 <extra_files type="file" name="mega_distance_matrix.txt" value="test_out/phylogenetic_tree/mega_distance_matrix.txt" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
102 <extra_files type="file" name="phylogenetic_tree.newick" value="test_out/phylogenetic_tree/phylogenetic_tree.newick" />
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
103 <extra_files type="file" name="tree.pdf" value="test_out/phylogenetic_tree/tree.pdf" compare="sim_size" delta = "1000"/>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
104 </output>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
105 </test>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
106 </tests>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
107
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
108 <help>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
109 **What it does**
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
110
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
111 This tool uses a SNP table to determine a kind of "genetic distance" between
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
112 each pair of individuals. Optionally, that information can be used to
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
113 produce a tree-shaped figure that depicts how the individuals are related,
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
114 either as a text file in a common format, called NEWICK, or as a picture.
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
115 The user specifies the following inputs to the tool.
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
116
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
117 SNP table
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
118
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
119 Individuals
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
120 By default, all individuals are included in the analysis; an option
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
121 is to analyze only a subset of individuals that has been specified
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
122 using the tool to "Select individuals from a SNP table".
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
123
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
124 Minimum coverage
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
125 For each pair of individuals, the tool looks for informative SNPs, i.e.,
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
126 where the sequence data for both individuals is adequate according to
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
127 some criterion. Specifying, say, 7 for this option instructs the tool
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
128 to consider only SNPs with coverage at least 7 in both individuals
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
129 when estimating their "genetic distance".
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
130
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
131 Minimum quality
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
132 Specifying, say, 37 for this option instructs the tool to consider
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
133 only SNPs with SAMtools quality value at least 37 in both individuals
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
134 when estimating their "genetic distance".
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
135
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
136 Minimum number of informative SNPs
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
137 This option instructs the tool to terminate execution if at least one
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
138 pair of individuals does not have a required number of informative SNPs.
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
139
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
140 Include reference sequence
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
141 For SNP tables with a reference sequence, the user can ask that the
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
142 reference be indicated in the tree, to help with rooting it. If the
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
143 SNP table has no reference sequence, this option has no effect.
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
144
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
145 Data source
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
146 The genetic distance between two individuals at a given SNP can
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
147 be estimated two ways. One method is to use the absolute value of
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
148 difference in the frequency of the first allele (equivalently: the
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
149 second allele). For instance, if the first individual has 5 reads of
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
150 each allele and the second individual has respectively 3 and 6 reads,
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
151 then the frequencies are 1/2 and 1/3, giving a distance 1/6 at that
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
152 SNP. The other approach is to use the SAMtools genotypes to estimate
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
153 the difference in the number of occurrences of the first allele.
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
154 For instance, if the two genotypes are 2 and 1, i.e., the individuals
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
155 are estimated to have respectively 2 and 1 occurrences of the first
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
156 allele at this location, then the distance is 1 (the absolute value
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
157 of the difference of the two numbers).
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
158
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
159 Output format
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
160 There are three options, as described above.
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
161
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
162 **Acknowledgments**
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
163
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
164 To convert the distance matrix to a NEWICK-formatted tree, we use the QuickTree program, downloaded from: http://www.sanger.ac.uk/resources/software/quicktree/
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
165
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
166 To draw the tree, we use the program draw_tree, downloaded from: http://compgen.bscb.cornell.edu/phast/
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
167 </help>
2c498d40ecde Uploaded
miller-lab
parents:
diff changeset
168 </tool>