[英]Trait tracking using R, with pasted Excel sheet and phylogenetic tree
I wanted to create a phylogenetic tree where I can trace a certain dimension throughout clades.我想创建一个系统发育树,我可以在其中追踪整个进化枝的某个维度。 I followed the tutorial by Winternitz 2016, but now I run into some problems.
我按照 Winternitz 2016 的教程进行操作,但现在遇到了一些问题。
Here is what I did so far:这是我到目前为止所做的:
tablename<- read.table(file("clipboard"), header=TRUE)
library(adegenet)
library(ape)
library(caper)
library(devtools)
library(geiger)
library(picante)
library(phytools)
library(stringr)
library(TreeTools)
supertree<-ReadTntTree("Pathname", tipLabels =1:36)
plot(supertree,no.margin=TRUE,edge.width=2) #to check if my tree is displayed correctly
Now I have the problem that my tree has (created by TNT) numbers as represenatives of taxa instead of the taxa names.现在我的问题是我的树有(由 TNT 创建)数字作为分类群的代表,而不是分类群的名称。 For the copied table I created a column for the number and the second one is the taxon which is represented by the number.
对于复制的表,我为数字创建了一个列,第二个是由数字表示的分类单元。 Column 3,4 and 5 are filled with either measurements or NA (for not avaiable).
第 3,4 和 5 列填充有测量值或 NA(表示不可用)。 The names of the columns are code (column 1), specimen (column 2), HFM (column 3), WFM (column 4) and Wpp (column 5)
列的名称是代码(第 1 列)、标本(第 2 列)、HFM(第 3 列)、WFM(第 4 列)和 Wpp(第 5 列)
My questions are now:我现在的问题是:
Thank you already for reading and I am looking forward for an answer感谢您的阅读,我期待着答案
Sincerely真挚地
Edit: After the quick comment I also attached a link to the files I can provide.编辑:在快速评论之后,我还附上了我可以提供的文件的链接。 I hope this helps to reproduce my progress so far -
我希望这有助于重现我迄今为止的进步 -
https://drive.google.com/drive/folders/1CJBwCrSIkFqO6qvh0UH0yEiWtDwNpK1B?usp=sharing https://drive.google.com/drive/folders/1CJBwCrSIkFqO6qvh0UH0yEiWtDwNpK1B?usp=sharing
Your line ReadTntTree("Pathname", tipLabels = 1:36)
reads the tree, using the numbers 1..36 to label the tips.您的行
ReadTntTree("Pathname", tipLabels = 1:36)
读取树,使用数字 1..36 标记提示。 But you want the leaves to be labelled with the taxon names.但是您希望叶子标有分类单元名称。
Specify the names of the tips in ReadTntTree
.在
ReadTntTree
中指定提示的名称。 For example, if you know that the order of tips in the TNT tree matches the order of rows in your table, use例如,如果您知道 TNT 树中的提示顺序与表中的行顺序相匹配,请使用
taxonNames <- tablename[, 2]
print(taxonNames) # Check that the names are what you expect
supertree <- ReadTntTree("Pathname", tipLabels = taxonNames)
More laboriously, specify the taxon names by hand: replace the first line with更费力的是,手动指定分类单元名称:将第一行替换为
taxonNames <- c("first_taxon", "second_taxon", <...>)
(Only an option if you have control over the TNT process that is generating your tree file.) (仅当您可以控制生成树文件的 TNT 进程时才可以选择。)
Ask TNT to save the taxon labels in the tree output, using the taxname=; tsav*;
使用
taxname=; tsav*;
taxname=; tsav*;
TNT command – see https://ms609.github.io/TreeTools/articles/load-trees.html#trees-from-tnt TNT 命令 – 见https://ms609.github.io/TreeTools/articles/load-trees.html#trees-from-tnt
Read the trees into R with supertree <- ReadTntTree("Pathname")
使用
supertree <- ReadTntTree("Pathname")
将树读入 R
This approach assumes that the TNT matrix and output file are in the same place on your computer as they were when the TNT analysis is run.这种方法假设 TNT 矩阵和输出文件在您计算机上的位置与运行 TNT 分析时的位置相同。 As such, it is the least reproducible approach -- handy for initial analysis, but less well suited to inclusion in publications.
因此,它是最不可重复的方法——便于初步分析,但不太适合包含在出版物中。
tsav*;
, with taxname-;
to omit taxon names) link to the matrix used to generate the trees, and can load taxon names from there.tsav*;
,带有taxname-;
以省略分类名称)链接到用于生成树的矩阵,并且可以从那里加载分类名称。ReadTntTree()
manual page for further details: for example, of how to use relative paths to the original matrix.ReadTntTree()
手册页:例如,如何使用原始矩阵的相对路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.