iTOL基本用法已經(jīng)會(huì)了,之前記錄過一點(diǎn):系統(tǒng)發(fā)育(進(jìn)化)樹繪制小結(jié)。最近重用,調(diào)圖時(shí)又發(fā)現(xiàn)了些細(xì)節(jié),記錄下備忘。
1. 注冊
不注冊也可用,但注冊登錄可保存樹在itol網(wǎng)站上。

2. 去枝長
進(jìn)化樹能展示枝長是最好的,能用來判斷材料和群體間的特殊性。但現(xiàn)在大部分文章中的進(jìn)化樹都是去掉了枝長的,也可以理解,樣本太多,展示不好看。
處理前:

處理后:

3. 加圖例
對(duì)進(jìn)化樹添加分類后的注釋,圖片的圖例是需要自己設(shè)置的。不然就只能導(dǎo)出,用其他軟件添加,或用文字說明。
比如這里我注釋三圈,最內(nèi)圈用range,外兩圈用strip(不懂的看之前文章或看itol示例注釋)。兩部分設(shè)置有點(diǎn)不同。
range的注釋圖例可點(diǎn)開legend即可??梢杂檬髽?biāo)自由移動(dòng)圖例的相對(duì)距離。

strip的注釋圖例,需要自定義,如果有多重注釋,注意看選擇的是哪個(gè)數(shù)據(jù)集就對(duì)該數(shù)據(jù)集進(jìn)行設(shè)置。最后同樣的,圖例位置可自由移動(dòng)。


4. 無根樹顏色
材料過多時(shí),我們常用無根樹來展示,這時(shí)一般展示枝長。很簡單,去標(biāo)簽,注釋上色即可。


直接拖拽注釋文件上色。

但是由于樹枝太多密集,顏色顯示不是很明顯。需要做一點(diǎn)調(diào)整:將線型調(diào)小一點(diǎn)。

此外,還可以嘗試做一些高級(jí)調(diào)整,如去掉標(biāo)尺、旋轉(zhuǎn)圖片角度等。

但因?yàn)闊o根樹去掉了標(biāo)簽(樣本名稱),所以沒有range注釋,只有strip類型,需要手動(dòng)設(shè)置圖例(見上)。或者不用圖例,直接在圖片備注中說明即可。
5. 導(dǎo)出圖片
當(dāng)你要導(dǎo)出pdf、png等有長寬位置信息類型圖片時(shí),最好選擇Full image,它會(huì)自動(dòng)設(shè)置配置合適你的圖片大小。如果用screen,那么在網(wǎng)頁上是什么樣,導(dǎo)出就是什么樣,你不好把握尺寸。
另外,如果是png,分辨率也有必要設(shè)置一下,盡量大點(diǎn)。

更新補(bǔ)充
iTOL真是調(diào)圖神器,任何細(xì)節(jié)都可調(diào)節(jié),而且非常美觀,曾嘗試過ggtree,但效果不佳。頂級(jí)文章中的進(jìn)化樹多用iTOL吧。不過學(xué)習(xí)依然需要成本,記錄要求以備忘。
6. 無根樹添加背景
使用Manual annotation,有很多選項(xiàng),有固定形狀或手動(dòng)繪制,可多嘗試。

可設(shè)置線條或背景顏色、透明度等,個(gè)性化非常多。我試了一個(gè)例子:

7. 其他細(xì)節(jié)
旋轉(zhuǎn)、枝長、標(biāo)簽、弱化線條等。

去掉tree scale box,展示葉節(jié)點(diǎn)等。

8.導(dǎo)出文本
可以將聚類的結(jié)果按順序?qū)С鑫谋?,便于材料分類的后續(xù)分析,很實(shí)用的功能,再也不用一個(gè)個(gè)去對(duì)照看了。
如果你的材料聚類非常清晰,找到每類的根節(jié)點(diǎn),染色將其所有枝長(clade)標(biāo)色,導(dǎo)出的文本就含有分組信息。
如果材料聚類不是很清晰,你不太好找到根節(jié)點(diǎn)標(biāo)色,或者不是你預(yù)期的分組,這時(shí)你也可以把樹作為整體標(biāo)色并導(dǎo)出,導(dǎo)出后你只需找到每類的邊界樣本就可辨別,而非一個(gè)個(gè)去對(duì)照。
比如:

以上示例可大體判斷聚為三類,找到三類根節(jié)點(diǎn),右擊將其標(biāo)色。
如果找不到每類的節(jié)點(diǎn),把全部的樹標(biāo)色也行(一定要標(biāo),不然導(dǎo)不出文本,或者只導(dǎo)出部分文本)。

選中后選中右上角導(dǎo)出標(biāo)注文本即可:


完全是按進(jìn)化樹聚類的順序。這時(shí)你就可以進(jìn)行下游分類分析了。
常用的幾種注釋
多層分類,如群體遺傳中不同類型分組時(shí)(品種類型:栽培農(nóng)家野生,地區(qū):南北方,生態(tài)類型等),常常用到多層注釋。不同類型可用顏色、形狀等注釋,可在節(jié)點(diǎn)、枝條、標(biāo)簽(樣本名)、條帶、陰影等地方體現(xiàn)。
我常用的幾種注釋如下:
- 標(biāo)簽上注釋range
注釋可選擇某節(jié)點(diǎn),或者每個(gè)樣本對(duì)應(yīng)的組別(推薦之),注釋文件如下:
TREE_COLORS
SEPARATOR TAB
DATA
I148 range #eeffee group1
I110 range #ddddff group2

- 條帶strip
條帶分類,且枝條顏色和條帶一致。注釋文件tol_color_strip.txt:
DATASET_COLORSTRIP
#lines starting with a hash are comments and ignored during parsing
#select the separator which is used to delimit the data below (TAB,SPACE or COMMA).This separator must be used throught this file (except in the SEPARATOR line, which uses space).
#SEPARATOR TAB
SEPARATOR SPACE
#SEPARATOR COMMA
#label is used in the legend table (can be changed later)
DATASET_LABEL color_strip1
#dataset color (can be changed later)
COLOR #ff0000
#optional settings
#all other optional settings can be set or changed later in the web interface (under 'Datasets' tab)
COLOR_BRANCHES 1
#maximum width
STRIP_WIDTH 25
#left margin, used to increase/decrease the spacing to the next dataset. Can be negative, causing datasets to overlap.
MARGIN 0
#border width; if set above 0, a black border of specified width (in pixels) will be drawn around the color strip
BORDER_WIDTH 1
BORDER_COLOR #000
#show internal values; if set, values associated to internal nodes will be displayed even if these nodes are not collapsed. It could cause overlapping in the dataset display.
SHOW_INTERNAL 0
#In colored strip charts, each ID is associated to a color. Color can be specified in hexadecimal, RGB or RGBA notation
#Internal tree nodes can be specified using IDs directly, or using the 'last common ancestor' method described in iTOL help pages
#Actual data follows after the "DATA" keyword
DATA
#ID1 value1
#ID2 value2
160232 #caf390 COL#caf390
13773 #404c05 COL#404c05

只對(duì)條帶分類。注釋文件tol_color_strip2.txt:
#optional settings
#all other optional settings can be set or changed later in the web interface (under 'Datasets' tab)
COLOR_BRANCHES 1
#maximum width
STRIP_WIDTH 25
#left margin, used to increase/decrease the spacing to the next dataset. Can be negative, causing datasets to overlap.
MARGIN 0
#border width; if set above 0, a black border of specified width (in pixels) will be drawn around the color strip
BORDER_WIDTH 1
BORDER_COLOR #000
#show internal values; if set, values associated to internal nodes will be displayed even if these nodes are not collapsed. It could cause overlapping in the dataset display.
SHOW_INTERNAL 0
#In colored strip charts, each ID is associated to a color. Color can be specified in hexadecimal, RGB or RGBA notation
#Internal tree nodes can be specified using IDs directly, or using the 'last common ancestor' method described in iTOL help pages
#Actual data follows after the "DATA" keyword
DATA
#ID1 value1
#ID2 value2
160232 #caf390 COL#caf390
13773 #404c05 COL#404c05

- 對(duì)枝條或標(biāo)簽分組
對(duì)枝條注釋:文件如下:
TREE_COLORS
SEPARATOR SPACE
DATA
s54 clade #377EB8 normal 2
s212 clade #377EB8 normal 2
s219 clade #377EB8 normal 2
......

對(duì)標(biāo)簽注釋,文件如下:
TREE_COLORS
SEPARATOR SPACE
DATA
s54 clade #377EB8 normal 2
s212 clade #377EB8 normal 2
s219 clade #377EB8 normal 2
......

利用這個(gè)可實(shí)現(xiàn)對(duì)標(biāo)簽分類,通過選擇at tips,或?qū)hift調(diào)為負(fù)數(shù)。

還可對(duì)節(jié)點(diǎn)末端設(shè)置形狀,使之區(qū)分更為明顯。

當(dāng)然這種方法不是很好,樣本多了會(huì)顯示比較亂。不如直接設(shè)置symbol來調(diào)節(jié)節(jié)點(diǎn)。
- (末端)節(jié)點(diǎn)注釋symbol
對(duì)末端節(jié)點(diǎn)注釋在無根樹優(yōu)化中最常見,因?yàn)闊o根樹不能像圈圖或矩形圖可無限加層來添加多類注釋,一般就只能通過枝條和節(jié)點(diǎn)來區(qū)分組別。
這個(gè)注釋文件iTOL的example_data注釋文件是沒有提供的。我也是在官方找了很久才找到示例:https://itol.embl.de/help/dataset_symbols_template.txt
DATASET_SYMBOL
#Symbol datasets allow the display of various symbols on the branches of the tree. For each node, one or more symbols can be defined.
#Each symbol's color, size and position along the branch can be specified.
#lines starting with a hash are comments and ignored during parsing
#=================================================================#
# MANDATORY SETTINGS #
#=================================================================#
#select the separator which is used to delimit the data below (TAB,SPACE or COMMA).This separator must be used throughout this file.
#SEPARATOR TAB
#SEPARATOR SPACE
SEPARATOR COMMA
#label is used in the legend table (can be changed later)
DATASET_LABEL,example symbols
#dataset color (can be changed later)
COLOR,#ffff00
#=================================================================#
# OPTIONAL SETTINGS #
#=================================================================#
#=================================================================#
# all other optional settings can be set or changed later #
# in the web interface (under 'Datasets' tab) #
#=================================================================#
#Each dataset can have a legend, which is defined using LEGEND_XXX fields below
#For each row in the legend, there should be one shape, color and label.
#Optionally, you can define an exact legend position using LEGEND_POSITION_X and LEGEND_POSITION_Y. To use automatic legend positioning, do NOT define these values
#Optionally, shape scaling can be present (LEGEND_SHAPE_SCALES). For each shape, you can define a scaling factor between 0 and 1.
#Optionally, shapes can be inverted (LEGEND_SHAPE_INVERT). When inverted, shape border will be drawn using the selected color, and the fill color will be white.
#Shape should be a number between 1 and 6, or any protein domain shape definition.
#1: square
#2: circle
#3: star
#4: right pointing triangle
#5: left pointing triangle
#6: checkmark
#LEGEND_TITLE,Dataset legend
#LEGEND_POSITION_X,100
#LEGEND_POSITION_Y,100
#LEGEND_SHAPES,1,2,3
#LEGEND_COLORS,#ff0000,#00ff00,#0000ff
#LEGEND_LABELS,value1,value2,value3
#LEGEND_SHAPE_SCALES,1,1,0.5
#LEGEND_SHAPE_INVERT,0,0,0
#largest symbol will be displayed with this size, others will be proportionally smaller.
MAXIMUM_SIZE,50
#symbols can be filled with solid color, or a gradient
#GRADIENT_FILL,1
#Internal tree nodes can be specified using IDs directly, or using the 'last common ancestor' method described in iTOL help pages
#=================================================================#
# Actual data follows after the "DATA" keyword #
#=================================================================#
#the following fields are required for each node:
#ID,symbol,size,color,fill,position,label
#symbol should be a number between 1 and 5:
#1: rectangle
#2: circle
#3: star
#4: right pointing triangle
#5: left pointing triangle
#6: checkmark
#size can be any number. Maximum size in the dataset will be displayed using MAXIMUM_SIZE, while others will be proportionally smaller
#color can be in hexadecimal, RGB or RGBA notation. If RGB or RGBA are used, dataset SEPARATOR cannot be comma.
#fill can be 1 or 0. If set to 0, only the outline of the symbol will be displayed.
#position is a number between 0 and 1 and defines the position of the symbol on the branch (for example, position 0 is exactly at the start of node branch, position 0.5 is in the middle, and position 1 is at the end)
DATA
#Examples
#internal node will have a red filled circle in the middle of the branch
#9606|184922,2,10,#ff0000,1,0.5
#node 100379 will have a blue star outline at the start of the branch, half the size of the circle defined above (size is 5 compared to 10 above)
#100379,3,5,#0000ff,0,0
#node 100379 will also have a filled green rectangle in the middle of the branch, same size as the circle defined above (size is 10)
#100379,1,10,#00ff00,1,0.5
表頭說明看上面注釋就好,數(shù)據(jù)說明:#ID,symbol,size,color,fill,position,label。如100379,1,10,#00ff00,1,0.5表示第一列節(jié)點(diǎn)/樣本,第二列形狀,第三列大?。ㄖ挥写笮〔灰粫r(shí)才能體現(xiàn),若大小設(shè)置一樣,則需要導(dǎo)入后才能用symbol size調(diào)節(jié)),第四列顏色,第五列填充,第六列位置(0是節(jié)點(diǎn)起始,0.5是中間,1是末端)。

9. 重定根(使亞群分類聚集更明顯)
在iTOL中調(diào)節(jié)進(jìn)化樹并選擇特定的分支作為根節(jié)點(diǎn)(root the tree on the selected branch),可以通過以下步驟進(jìn)行:
上傳進(jìn)化樹文件:首先,你需要將你的進(jìn)化樹文件(通常是Newick或NHX格式)上傳到iTOL。這可以通過點(diǎn)擊iTOL界面上的“Tree upload”按鈕來完成。
選擇進(jìn)化樹:上傳文件后,點(diǎn)擊你想要編輯的進(jìn)化樹文件名稱,進(jìn)入編輯界面。
使用Node functions menu:在進(jìn)化樹的編輯界面中,點(diǎn)擊你想要作為根節(jié)點(diǎn)的分支或葉節(jié)點(diǎn)。這將顯示一個(gè)功能菜單(Node functions menu)。
選擇重根操作:在Node functions menu中,找到并選擇“Tree structure editing”選項(xiàng)。在這個(gè)子菜單中,你可以選擇“Re-root the tree”功能來重新設(shè)定樹的根節(jié)點(diǎn)。
確認(rèn)重根位置:選擇“Re-root the tree”后,你可以選擇在所選節(jié)點(diǎn)處重根,或者選擇“Root at midpoint”來在當(dāng)前節(jié)點(diǎn)的中間位置重根。
保存更改:完成重根操作后,你可以通過點(diǎn)擊界面上的“Save”或“Export”按鈕來保存或?qū)С瞿愕倪M(jìn)化樹。
選擇某一個(gè)節(jié)點(diǎn):

調(diào)節(jié)后:

10. 顯示bootstrap值
在iTOL中,即使忽略分支長度,也可以顯示bootstrap值。以下是如何操作的步驟:
上傳樹文件:首先,你需要上傳你的進(jìn)化樹文件(通常是Newick格式)到iTOL。這可以通過點(diǎn)擊iTOL界面上的“Tree upload”按鈕來完成。
忽略分支長度:在iTOL的控制面板中,找到“Basic”選項(xiàng)卡下的“Mode options”部分。其中有“Branch lengths”設(shè)置,你可以選擇“Ignore”來忽略分支長度,使樹顯示為 cladogram 。
顯示Bootstrap值:在“Advanced”選項(xiàng)卡中,找到“Bootstraps/metadata”設(shè)置,將其切換到“Display”。這樣,如果你的樹文件中包含了bootstrap信息,它們就會(huì)被顯示出來 。
自定義Bootstrap值的顯示方式:你可以通過“Data source”選擇器選擇要顯示的元數(shù)據(jù)來源,并設(shè)置“Display range”值來選擇要顯示的bootstrap值的范圍。默認(rèn)情況下,所有值都會(huì)被包括在內(nèi)。如果定義了多個(gè)元數(shù)據(jù)字段,可以同時(shí)定義多個(gè)閾值范圍 。
-
調(diào)整Bootstrap值的顯示樣式:iTOL允許你以四種不同的方式顯示元數(shù)據(jù):
- 作為符號(hào)(Symbol):選擇形狀類型、最小和最大大小以及填充顏色。
- 作為文本標(biāo)簽(Text):直接在分支上顯示值作為文本標(biāo)簽。
- 作為分支顏色(Color):根據(jù)它們的元數(shù)據(jù)值和控制框中定義的顏色梯度來給樹分支上色。
- 作為分支寬度(Width):根據(jù)它們的元數(shù)據(jù)值來設(shè)置樹分支的寬度 。
添加圖例:如果元數(shù)據(jù)以符號(hào)或分支顏色的形式顯示,可以通過設(shè)置“Legend”切換為“On”來向樹添加相應(yīng)的圖例 。
通過這些步驟,你可以在iTOL中忽略分支長度的同時(shí)顯示bootstrap值,并根據(jù)需要調(diào)整它們的顯示方式。

11. 多亞群注釋時(shí)添加圖例
