在R中绘制进化树:ggtree学习笔记

您所在的位置:网站首页 进化树的类型包括哪些 在R中绘制进化树:ggtree学习笔记

在R中绘制进化树:ggtree学习笔记

2024-02-29 06:13| 来源: 网络整理| 查看: 265

ggtree (https://guangchuangyu.github.io/software/ggtree/)是香港大学余光创博士编写的R程序包。ggtree是ggplot2程序包的扩展 (http://www.ggplot2-exts.org/),能够像ggplot2一样,用图层化的语法绘制进化树。这与APE用参数控制绘图明显不同。与ggplot2一样,在ggtree中,通过不同的图层组合即可绘制出更为复杂的图形。

该程序包在正式发布之前就受到CRAN Task Views:Phylogenetics 的作者Brian O’Meara 的关注。ggtree发布在Bioconductor之后,更是受到国际同行的广泛赞誉。作者介绍ggtree的论文在英国生态学会的Methods in Ecology and Evolution发表之后, 在不到一年的时间里, 引用次数已经超过100,可见受欢迎程度。

在数据分析中,读取进化树一般是用ape程序包的read.tree(), 但是构建进化树时,不同软件生成的文件格式多种多样,虽然大部分都是以newick或者nexus格式为基础,但是有时要将进化树建立过程中的信息标注在进化树上,这时read.tree读取的信息往往不足,编写函数导入相关信息也比较麻烦。鉴于此,作者为ggtree编写了读取进化树的函数,以弥补ape程序包read.tree的不足。ggtree能够读取并转换BEAST, r8s,RAxML等软件所生成的数据。用户也可自定义数据,轻松实现R实现基于进化树的高级绘图。

余博士关于ggtree的介绍:

http://cos.name/2015/11/to-achieve-the-visualization-and-annotation-of-evolutionary-tree-using-ggtree/

本笔记主要基于:http://www.bioconductor.org/packages/release/bioc/vignettes/ggtree/inst/doc/ggtree.html

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678#### ggtree可以直接读取的数据格式Newick (via ape)Nexus (via ape)New Hampshire eXtended format (NHX) (http://home.cc.umanitoba.ca/~psgendb/doc/atv/NHX.pdf)Jplace (http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0031009)Phylip以及以下软件输出的数据:BEAST2EPA3HYPHY5PAML1PHYLDOG6pplacer4r8s7RAxML8RevBayes9####################################################用以下函数读取read.beast()       ## for parsing output of BEASEread.codeml()      ## for parsing output of CODEML (rst and mlc files)read.codeml_mlc()  ## for parsing mlc file (output of CODEML)read.hyphy()       ## for parsing output of HYPHYread.jplace()      ## for parsing jplace file including output from EPA and pplacerread.nhx()         ## for parsing NHX file including output from PHYLODOG and RevBayesread.paml_rst()    ## for parsing rst file (output of BASEML and CODEML)read.r8s()         ## for parsing output of r8sread.raxml()       ## for parsing output of RAxML########################################################### 定义的 S4 Classes #####################################apeBootstrap ##for bootstrap analysis of ape::boot.phylo()10, output of apeBoot() defined in ggtreebeast        ##for storing output of read.beast()codeml       ## for storing output of read.codeml()codeml_mlc   ##for storing output of read.codeml_mlc()hyphy        ## for storing output of read.hyphy()jplace       ## for storing output of read.jplace()nhx          ## for storing output of read.nhx()paml_rst     ## for rst file obtained by PAML, including BASEML and CODEML.phangorn     ## for storing ancestral sequences inferred by R package phangorn11, output of phyPML defined in ggtreer8s          ## for storing output of read.r8s()raxml        ## for storing output of read.raxml()### 其他支持的S4 类###phylo, multiPhylo (defined by ape10), phylo4 (defined by phylobase) obkData (defined in OutbreakTools) and phyloseq (defined in phyloseq).### 获取任何能够在进化树上显示的参数get.fields### 显示进化树ggtree(tree_object)### 将任何格式的进化树转换为 phylo格式get.tree### 界定分类单元groupOTU()groupClade()### 将进化树转换为 data.framefortify#####################################################3 举例: BEASTlibrary(ggtree)file 


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3