# HG changeset patch # User rico # Date 1333653597 14400 # Node ID 97cb38264840c716078e53408b0c2c221723c06f # Parent ad02fc357ce3692b5cfaaccaaf258cad7d65c4be Uploaded diff -r ad02fc357ce3 -r 97cb38264840 phylogenetic_tree.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/phylogenetic_tree.xml Thu Apr 05 15:19:57 2012 -0400 @@ -0,0 +1,168 @@ + + tree + + + phylogenetic_tree.py "$input" + #if $individuals.choice == '0' + "all_individuals" + #else if $individuals.choice == '1' + "$p1_input" + #end if + "$output" "$output.extra_files_path" "$minimum_coverage" "$minimum_quality" + #if ((str($input.metadata.scaffold) == str($input.metadata.ref)) and (str($input.metadata.pos) == str($input.metadata.rPos))) or (str($include_reference) == '0') + "none" + #else + "$input.metadata.dbkey" + #end if + "$data_source" + #set $draw_tree_options = ''.join(str(x) for x in [$branch_style, $scale_style, $length_style, $layout_style]) + #if $draw_tree_options == '' + "" + #else + "-$draw_tree_options" + #end if + #for $individual_name, $individual_col in zip($input.dataset.metadata.individual_names, $input.dataset.metadata.individual_columns) + #set $arg = '%s:%s' % ($individual_col, $individual_name) + "$arg" + #end for + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool uses a SNP table to determine a kind of "genetic distance" between +each pair of individuals. Optionally, that information can be used to +produce a tree-shaped figure that depicts how the individuals are related, +either as a text file in a common format, called NEWICK, or as a picture. +The user specifies the following inputs to the tool. + +SNP table + +Individuals + By default, all individuals are included in the analysis; an option + is to analyze only a subset of individuals that has been specified + using the tool to "Select individuals from a SNP table". + +Minimum coverage + For each pair of individuals, the tool looks for informative SNPs, i.e., + where the sequence data for both individuals is adequate according to + some criterion. Specifying, say, 7 for this option instructs the tool + to consider only SNPs with coverage at least 7 in both individuals + when estimating their "genetic distance". + +Minimum quality + Specifying, say, 37 for this option instructs the tool to consider + only SNPs with SAMtools quality value at least 37 in both individuals + when estimating their "genetic distance". + +Minimum number of informative SNPs + This option instructs the tool to terminate execution if at least one + pair of individuals does not have a required number of informative SNPs. + +Include reference sequence + For SNP tables with a reference sequence, the user can ask that the + reference be indicated in the tree, to help with rooting it. If the + SNP table has no reference sequence, this option has no effect. + +Data source + The genetic distance between two individuals at a given SNP can + be estimated two ways. One method is to use the absolute value of + difference in the frequency of the first allele (equivalently: the + second allele). For instance, if the first individual has 5 reads of + each allele and the second individual has respectively 3 and 6 reads, + then the frequencies are 1/2 and 1/3, giving a distance 1/6 at that + SNP. The other approach is to use the SAMtools genotypes to estimate + the difference in the number of occurrences of the first allele. + For instance, if the two genotypes are 2 and 1, i.e., the individuals + are estimated to have respectively 2 and 1 occurrences of the first + allele at this location, then the distance is 1 (the absolute value + of the difference of the two numbers). + +Output format + There are three options, as described above. + +**Acknowledgments** + +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/ + +To draw the tree, we use the program draw_tree, downloaded from: http://compgen.bscb.cornell.edu/phast/ + +