[R-sig-phylo] Cophenetic repeats
Hi all, I'm trying to decide if this an R error, or an error in how I've implemented branch lengths. When i create the cophenetic matrix for my tree, and look at the relatedness of all tips to a single tip (i.e just looking at one column in the matrix). I find that a large portion of them have identical cophenetic distances. I thought the cophenetic would be the sum of the branch length between tips (patristic distance), therefore there should only be pairs (sister species have equal terminal branch length) with *exactly * the same value. Comparisons from distantly related taxa should be similar, since most of the distance is dictated by the internal branches, but the terminal branch should atleast create some difference. Sorry that i can't really create a reproducible example for the question. Here is some documentation: trx-read.nexus(ColombiaPhylogenyUM.tre) seeds-sample(trx$tip.label,1) sp.weight.alpha-cophenetic(trx)[,seeds] table(sp.weight.alpha)sp.weight.alpha 0 0.00775074 0.1179723 0.2187406 0.2379734 0.23797341 0.2525792 1 1 2 4 3 2 6 0.36612256 0.36612257 0.52326843 0.59034104 0.59034105 0.59034106 0.607038 2 2 2 31 82 29 3 82 of the species have the exact same distance to my selected tip .59034105 Am i using this function correctly? I appreciate the help, Ben Weinstein -- Ben Weinstein Graduate Student Ecology and Evolution Stony Brook University http://life.bio.sunysb.edu/~bweinste/index.html [[alternative HTML version deleted]] ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Re: [R-sig-phylo] Cophenetic repeats
Hello Ben, is your tree ultrametric? Do you have a e.g. UPGMA tree? This would explain your observation. You can test your tree with is.ultrametric(trx). Regards, Klaus On 5/27/12, Ben Weinstein bwein...@life.bio.sunysb.edu wrote: Hi all, I'm trying to decide if this an R error, or an error in how I've implemented branch lengths. When i create the cophenetic matrix for my tree, and look at the relatedness of all tips to a single tip (i.e just looking at one column in the matrix). I find that a large portion of them have identical cophenetic distances. I thought the cophenetic would be the sum of the branch length between tips (patristic distance), therefore there should only be pairs (sister species have equal terminal branch length) with *exactly * the same value. Comparisons from distantly related taxa should be similar, since most of the distance is dictated by the internal branches, but the terminal branch should atleast create some difference. Sorry that i can't really create a reproducible example for the question. Here is some documentation: trx-read.nexus(ColombiaPhylogenyUM.tre) seeds-sample(trx$tip.label,1) sp.weight.alpha-cophenetic(trx)[,seeds] table(sp.weight.alpha)sp.weight.alpha 0 0.00775074 0.1179723 0.2187406 0.2379734 0.23797341 0.2525792 1 1 2 4 3 2 6 0.36612256 0.36612257 0.52326843 0.59034104 0.59034105 0.59034106 0.607038 2 2 2 31 82 29 3 82 of the species have the exact same distance to my selected tip .59034105 Am i using this function correctly? I appreciate the help, Ben Weinstein -- Ben Weinstein Graduate Student Ecology and Evolution Stony Brook University http://life.bio.sunysb.edu/~bweinste/index.html [[alternative HTML version deleted]] ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Re: [R-sig-phylo] length of attribute (names) when calculating independent contrasts
Many thanks, Emmanuel, Setting the number of nodes to 9 solved the problem. Cheers Agus 2012/5/25 Agus Camacho agus.cama...@gmail.com Thanks emmanuel, Got this: tree$node.label [1] 1 2 3 4 5 6 7 8 9 10 tree$Nnode[1] 9 Wonder how is that possible. So im sending how i generated the tree. tree - read.tree(text= C.leiolepis:0.0168, C.nicterus:0.0099):0.0242 ,C.sinebrachiatus:0.024):0.074 ,(S.catimbau:0.0652,N.ablephara:0.0309):0.0648):0.0659 ,P.erythrocercus:0.0235,P.tetradactylus:0.0259):0.0462 ,V.rubricauda:0.124):0.0225 ,M.maximiliani:0.0615):0.0828 ,P.paeminosus:0.1093):0.0131);) tree$node.label=c(1,2,3,4,5,6,7,8,9,10) plot(tree,show.node.label=TRUE,use.edge.length=TRUE) 2012/5/24 Emmanuel Paradis emmanuel.para...@ird.fr Hi Agus, It seems the problem comes when pic() tries to create names to the contrasts. Probably your tree has badly formatted node labels. What do the following commands return? tree$node.label tree$Nnode Cheers, Emmanuel Agus Camacho wrote on 25/05/2012 01:58: Hi all, When calculating independent contrasts of a variable, I get the following message: ContrastWeight- pic(Weight,tree)Error en names(contr)- lbls : el atributo 'names' [10] debe tener la misma longitud que el vector [9] The attribute names [10] must have the same length than the vector[9] (this was translated by me) After checking the help on the command, i made the following observations, length(Weight)[1] 10 class(Weight)[1] numeric tree$tip.label [1] C.leiolepis C.nicterus C.sinebrachiatus [4] S.catimbau N.ablephara P.erythrocercus [7] P.tetradactylus V.rubricauda M.maximiliani [10] P.paeminosus class(tree)[1] phylo Weight C.leiolepis C.nicterus C.sinebrachiatus S.catimbau 0.9020.7160.53705260.5887500 N.ablephara P.erythrocercus P.tetradactylus V.rubricauda 0.5460.41272730.3970.4725294 M.maximiliani P.paeminosus 0.4830.4677692 However, to me, everything seems to be right about the names and the vector's length. Any hint? Thanks to all. I am new to these analyses and appreciate much the help from the mail list. Agus __**_ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/**listinfo/r-sig-phylohttps://stat.ethz.ch/mailman/listinfo/r-sig-phylo -- Emmanuel Paradis IRD, Jakarta, Indonesia http://ape.mpl.ird.fr/ -- Agustín Camacho Guerrero. Doutorando em Zoologia. Laboratório de Herpetologia, Departamento de Zoologia, Instituto de Biociências, USP. Rua do Matão, trav. 14, nº 321, Cidade Universitária, São Paulo - SP, CEP: 05508-090, Brasil. -- Agustín Camacho Guerrero. Doutorando em Zoologia. Laboratório de Herpetologia, Departamento de Zoologia, Instituto de Biociências, USP. Rua do Matão, trav. 14, nº 321, Cidade Universitária, São Paulo - SP, CEP: 05508-090, Brasil. [[alternative HTML version deleted]] ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo