2

I'm new to phylogenetic analyses, and I'm using the ape library to analyse neuroanatomical traits of 34 primates from 28 different species. I used 10ktrees to obtain a consensus phylogenetic tree (with 28 tips). 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!

roberto
  • 497
  • 4
  • 12
  • 1
    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. – roberto May 12 '18 at 10:30
  • Standard protocol in most interspecific analyses is to average the values of each species so each point represents the average value of all given specimens, in order to avoid over-representation of species that may have been more heavily sampled. – user2352714 Dec 26 '20 at 08:58

1 Answers1

0

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. 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.

The single-individual per species call to pic is pic.BrainVolume <- pic(BrainVolume, tree), where BrainVolume is a vector. 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. I created a 'grouped' version of my original pheno file using

grouped<-split(pheno,pheno$GenBank.Name)

Next, lapply to make a list for the BrainVolume phenotype:

BrainVolume<-lapply(grouped,"[[","BrainVolume")

And finally, use the pic.ortho function which implements Felsenstein's method:

pic.SA<-pic.ortho(SA,tree,intra=TRUE)

The resulting contrasts can be used as with the original pic command.

Reference

Felsenstein J (2008) "Comparative methods with sampling error and within-species variation: Contrasts revisited and revised" American Naturalist 171: 713--725

roberto
  • 497
  • 4
  • 12