[英]How can analyse a trait where I have data for multiple individuals at each tip of my phylogenetic tree?
I'm new to phylogenetic analyses, and I'm using the ape
library to analyse neuroanatomical traits of 34 primates from 28 different species. 我是系统发育分析的新手,并且正在使用
ape
库分析28种不同物种的34种灵长类动物的神经解剖特征。 I used 10ktrees to obtain a consensus phylogenetic tree (with 28 tips). 我使用了10ktrees来获得共识的系统发育树(有28个技巧)。 However, I can't combine the phenotypes and the tree because the number of observations do not match the number of tips.
但是,我无法将表型和树结合起来,因为观察数与提示数不匹配。 Should I use a polytomy for spliting a tip into multiple subjects?
我应该使用多义术将笔尖分成多个主题吗?
This is my code thus far: 到目前为止,这是我的代码:
tree <- read.nexus("10ktree.nex")
pheno <- read.csv("pheno.csv")
BrainVolume <- pheno$BrainVolume
names(BrainVolume) <- pheno$GenBank.Name
pic.BrainVolume <- pic(BrainVolume, tree)
And I get the following error: 我得到以下错误:
Error in pic(BrainVolume, tree) :
length of phenotypic and of phylogenetic data do not match
Thank you for your help! 谢谢您的帮助!
As I said in the comment, Chapter 6.1.10 "Intraspecific variation" in the 2nd edition (2012) of Emmanuel Paradis's book "Analysis of phylogenetics and evolution with R" has information exactly on that issue. 正如我在评论中说的那样,伊曼纽尔·帕拉迪斯(Emmanuel Paradis)的第二版(2012年)第6.1.10章“种内变异”具有“用R进行系统发育和进化分析”的确切信息。 The chapter discusses several methods.
本章讨论了几种方法。 This is one, based on Felsenstein (2008), which extends the single individual per species phylogenetic contrast method to multiple individuals.
这是基于Felsenstein(2008)的一种方法,该方法将每个物种的单个个体的系统发育对比方法扩展到多个个体。
The single-individual per species call to pic is pic.BrainVolume <- pic(BrainVolume, tree)
, where BrainVolume
is a vector. 对pic的每个物种的单个个体调用为
pic.BrainVolume <- pic(BrainVolume, tree)
,其中BrainVolume
是向量。 For the multiple-individual approach, BrainVolume has to be a list, where some entries can have a vector representing the values of the multiple individuals of the same species. 对于多个体方法,BrainVolume必须是一个列表,其中某些条目可以具有一个表示同一物种的多个个体的值的向量。 I created a 'grouped' version of my original
pheno
file using 我使用以下命令创建了原始
pheno
文件的“分组”版本
grouped<-split(pheno,pheno$GenBank.Name)
Next, lapply
to make a list for the BrainVolume
phenotype: 接下来,
lapply
以列出BrainVolume
表型:
BrainVolume<-lapply(grouped,"[[","BrainVolume")
And finally, use the pic.ortho
function which implements Felsenstein's method: 最后,使用实现Felsenstein方法的
pic.ortho
函数:
pic.SA<-pic.ortho(SA,tree,intra=TRUE)
The resulting contrasts can be used as with the original pic
command. 所得的对比度可以与原始
pic
命令一起使用。
Reference 参考
Felsenstein J (2008) "Comparative methods with sampling error and within-species variation: Contrasts revisited and revised" American Naturalist 171: 713--725 Felsenstein J(2008)“具有抽样误差和物种内变异的比较方法:对比和修订过的对比”,美国自然主义者171:713--725
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.