HIV Databases HIV Databases home HIV Databases home
HIV sequence database



Rainbow Tree Explanation

Input

The input for rainbow tree is a tree in Newick format. To generate a Newick tree file from aligned sequences try:

Color tree according to...

The Sample Input example depicts the HIV-1 M-group reference phylogeny, with the sequences labeled as obtained from our sequence database. For example:

A1.AU.03.PS1044_Day0.DQ676872

is clade A1, from Australia (AU), sampled in 2003 (03), named PS1044_Day0, with accession number DQ676872.

For these 5 sequences from the Sample Input:

A1.AU.03.PS1044_Day0.DQ676872
A1.UG.92.92UG037.AB253429
B.TH.90.BK132.AY173951
F1.BE.93.VI850.AF077336
F2.CM.02.02CM_0016BBY.AY371158

If the first character was selected for the color key, then A, B, and F would each be assigned a color.

If the first field delineated by a period was selected, then A1, B, and F1 and F2 would each be assigned a color.

If the second field delineated by periods was selected, the five country codes (AU, UG, TH, BE and CM) would each be assigned a color.

Assign colors

Rainbow tree can create a tree of up to 20 colors.
Red Orange Yellow Yellow green Green
Blue Royal blue Dark orchid Deep pink Hot pink
Light pink Brown Khaki Lemon chiffon Teal
Medium turquoise Sky blue Medium purple Medium slate blue Grey

With the default color assignment, the most frequent category will be red, the next most frequent orange, etc. For trees with more than 20 categories, the last color (grey) is re-used for all additional categories, and this is noted in the key. The user may specify their own color choice for each category. Colors are limited to 20, as it becomes difficult to distinguish more than 20 colors in a tree.

Specify outgroup

If unchecked, tree will be unrooted. If checked, you will have the option of choosing an outgroup to root the tree.

Grouped Sequence Names

Below is an example of grouped sequence names. Groups are specified as lists of sequence names. Each sequence must be on a separate line, and groups are separated by an empty line. The first item ending in ':' in a group will be taken as the group name, but this line is optional. If group names are omitted, the names Group-1, Group-2, etc., will be generated for reporting. Sequences that are not present in any group will be named 'Others' and colored gray. This is useful for highlighting some groups of sequences out of a target set.

The following can be pasted in with the Sample Input for testing the Grouped Sequence Names option:

Group-A:
A1.AU.03.PS1044_Day0.DQ676872
A1.RW.92.92RW008.AB253421
A1.UG.92.92UG037.AB253429
A2.CD.97.97CDKTB48.AF286238
A2.CM.01.01CM_1445MV.GU201516
A2.CY.94.94CY017_41.AF286237
B.FR.83.HXB2_LAI_IIIB_BRU.K03455
B.TH.90.BK132.AY173951
B.US.98.1058_11.AY331295
B.NL.00.671_00T36.AY423387

Group-B:
D.CD.83.ELI.K03454
D.CM.01.01CM_4412HAL.AY371157
D.TZ.01.A280.AY253311
D.UG.94.94UG114.U88824
F1.BE.93.VI850.AF077336
F1.FI.93.FIN9363.AF075703
F1.BR.93.93BR020_1.AF005494
F1.FR.96.96FR_MP411.AJ249238
Symbols as tip labels
symbols

Symbols can be applied to branch tips instead of text.

At right, the number next to each symbol is used to specify that symbol.

Symbols can be assigned to groups of sequences. Groups are specified as lists of sequence names. Each sequence must be on a separate line, and groups are separated by an empty line. The first line in a group must contain 2 colon-separated values ending in ':' (e.g., 3:Male: ). These values will be taken as the symbol id and group name. Sequences that are not present in any group will be grouped as 'Unknown', and a bullet (smaller than symbol #16) will be assigned.

The following example can be pasted in with the Sample Input for testing the symbol tip option:

0:Male:
A1.AU.03.PS1044_Day0.DQ676872
A1.UG.92.92UG037.AB253429
A2.CD.97.97CDKTB48.AF286238
A2.CY.94.94CY017_41.AF286237
B.FR.83.HXB2_LAI_IIIB_BRU.K03455
B.NL.00.671_00T36.AY423387
D.CD.83.ELI.K03454
D.TZ.01.A280.AY253311
F1.BE.93.VI850.AF077336
F1.FR.96.96FR_MP411.AJ249238
F2.CM.02.02CM_0016BBY.AY371158
K.CM.96.96CM_MP535.AJ249239
J.CD.97.J_97DC_KTB147.EF614151

1:Female:
A1.RW.92.92RW008.AB253421
A2.CM.01.01CM_1445MV.GU201516
B.TH.90.BK132.AY173951
B.US.98.1058_11.AY331295
C.IN.95.95IN21068.AF067155 
D.CM.01.01CM_4412HAL.AY371157
D.UG.94.94UG114.U88824
F1.FI.93.FIN9363.AF075703
F1.BR.93.93BR020_1.AF005494
G.NG.92.92NG083.U88826
H.BE.93.VI997.AF190128
Color interior edges

If checked, this option will propagate leaf colors inward (toward the root of the tree) until a mismatch is encountered.

Show node labels

If checked, this option displays the node labels from your Newick file. Our sample input does not contain node labels.

R rainbow tree function

Usage

rainbowtree ( treefile, tablefile, treetitle, label = 'seqname', label4ut = 'axial',        
              legend = 'vertical', legendpos = 'bottomleft',  branchwidth = 1, outgroup )

Arguments

treefile the newick tree file name
tablefile the 2- or 3-column table file name. Sequence name (1st column), integer index (1-20) to colors on palette (2nd), and category (3rd). The 3rd column can be omitted when legend='none' and label='seqname'/'none'
treetitle the tree title
label a character string specifying the type of tip labels: 'category', 'seqname' or 'none'(no tip label)
label4ut a character string specifying the display of tip labels for unrooted trees: 'axial' or 'horizontal'
legend a character string specifying the legend style: 'vertical', 'horizontal' or 'none'(no legend)
legendpos a character string specifying the location of legend: 'bottomright', 'bottom', 'bottomleft', 'left', 'topleft', 'top', 'topright', 'right' or 'center'
branchwidth a positive number specifying the width of the branches
outgroup vector of numeric or character specifying the new outgroup
color.int.edges whether to propagate leaf colors upward into a tree until a mismatch is encountered: 'TRUE' or 'FALSE'

Examples

source('rainbowtree.r')
rainbowtree( treefile='mytree.tre', tablefile='mytable.txt')
rainbowtree( treefile='mytree.tre', tablefile='mytable.txt', label='category', legend='horizontal')
rainbowtree( treefile='mytree.tre', tablefile='mytable.txt', label='none', branchwidth=3)
rainbowtree( treefile='/tmp/mytree.tre', tablefile='mytable.txt', outgroup=c('seqname1', 'seqname2'))
rainbowtree( treefile='/tmp/mytree.tre', tablefile='mytable.txt', legendpos='bottomright', outgroup=2)

Output trees

Output tree files are created in the directory where input files are.

 

Return to Rainbow Tree

 

last modified: Tue Mar 18 12:47 2014


Questions or comments? Contact us at seq-info@lanl.gov.

 
Operated by Los Alamos National Security, LLC, for the U.S. Department of Energy's National Nuclear Security Administration
Copyright © 2005-2012 LANS LLC All rights reserved | Disclaimer/Privacy

Dept of Health & Human Services Los Alamos National Institutes of Health