Re: [R-sig-phylo] Generating a tree based on a distance matrix?

2011-05-12 Thread Liam J. Revell
19082355898663e-30 found after 0 nearest neighbor interchange(s). > test$edge.length [,1] 6,7 0.005683385 7,1 0.516492136 7,8 0.761613776 8,2 0.714302898 8,3 0.071461088 6,4 0.217680734 6,5 0.393926894 You can easily see that they are the same branch lengths as in our original tree.

Re: [R-sig-phylo] Generating a tree based on a distance matrix?

2011-05-12 Thread Liam J. Revell
ive you the correct tree? Keep in mind that NJ will return an unrooted tree and that the branches might be rotated around any node (thus, your plotted tree may seem quite different from the ML tree). - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu

Re: [R-sig-phylo] Generating a tree based on a distance matrix?

2011-05-13 Thread Liam J. Revell
u the true tree and branch lengths - so there should be no need to use my function anyway. (See Felsenstein 2004; p. 166.) - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 5/13

Re: [R-sig-phylo] ACE - ML

2011-05-17 Thread Liam J. Revell
Sorry, I didn't see that this had already been addressed. -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 5/17/2011 12:39 PM, David Bapst wrote: Alanna- It's because whe

Re: [R-sig-phylo] ACE - ML

2011-05-17 Thread Liam J. Revell
Hi Alanna, You can get this kind of error if your tree has tip edges with zero length. Then C<-vcv.phylo(tree) will be exactly singular. Could this be true of your tree? Best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ em

Re: [R-sig-phylo] fitContinuous in geiger

2011-05-18 Thread Liam J. Revell
netics/ which does not have this issue. Good luck. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 5/18/2011 3:50 AM, Annemarie Verkerk wrote: Hi all, I’m having some tro

Re: [R-sig-phylo] Simulating BM data on phylogeny

2011-05-21 Thread Liam J. Revell
value of the mean for increased variance in the simulated distribution. Try this to see what I mean: xbar<-vector() for(i in -5:5) xbar[i+6]<-abs(mean(rnorm(n=1000,sd=(10^i)^2))) plot(10^c(-5:5),xbar,log="xy") Sincerely, Liam -- Liam J. Revell University of Massachusetts

Re: [R-sig-phylo] fitContinuous in geiger

2011-05-23 Thread Liam J. Revell
netics/phylosig/v0.3/phylosig.R";) > fit<-phylosig(tree,x,method="lambda",test=TRUE) Best of luck. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 5/23/

Re: [R-sig-phylo] ancestral state reconstruction with fixed internal node(s)

2011-06-30 Thread Liam J. Revell
t;atree" are different (because the latter has a different number of tips) *and* we have a different number of them (because we used multi2di() to fully resolve our multifurcating tree after we attached the extra tip). Hope this helps. - Liam -- Liam J. Revell University of Massachusett

Re: [R-sig-phylo] a question about pic function(ape package)

2011-07-11 Thread Liam J. Revell
UE Hope this helps. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 7/11/2011 10:44 PM, wrote: dear all, I have a question when I used the pic funtion, it appeared an er

Re: [R-sig-phylo] pic() vs gls()

2011-07-13 Thread Liam J. Revell
ields the same results and P-value. (Note that smdata<-as.matrix(smdata) seems to be important here as if smdata is a data frame, then smdata[,1] does not inherit the rownames of smdata and pic() will return an incorrect set of contrasts.) I hope this helps. No doubt other subscribers to the

Re: [R-sig-phylo] follow up for lambda transform - query: how to use an existing covariance matrix directly in a gls procedure in R?

2011-07-15 Thread Liam J. Revell
trix after lambda transformation (given a set value of lambda) is just: mat.lambda<-lambda*(mat-diag(diag(mat)))+diag(diag(mat)) I'm not sure whether or not this is exactly what you're looking for, but I hope it helps. Best, Liam -- Liam J. Revell University of Massachusetts Boston web: htt

Re: [R-sig-phylo] Converting a List of Trees into a multiPhylo Object

2011-07-18 Thread Liam J. Revell
Try: class(y)<-"multiPhylo" for list y. Does that work? - Liam Liam J. Revell University of Massachusetts Boston web: http://www.bio.umb.edu/facstaff/faculty_Revell.html email: liam.rev...@umb.edu blog: http://phytools.blogspot.com -Original Message- From: David Bapst

Re: [R-sig-phylo] LTT plot non-ultrametric trees

2011-08-10 Thread Liam J. Revell
This is implemented in my "phytools" package. This is not yet on CRAN, but can be downloaded from http://anolis.oeb.harvard.edu/~liam/R-phylogenetics/. The function is ltt(). It is slow, but seems to work. Please let me know if you have success with this. - Liam -- Liam

Re: [R-sig-phylo] LTT plot non-ultrametric trees

2011-08-10 Thread Liam J. Revell
ALSE) Sorry about this. Also: max(p1$times)==max(p2$times) can be FALSE because if drop.extinct is set to TRUE, then the crown age of the pruned tree can be smaller than in the full tree if some lineages arising at the root of the tree do not leave any extant descendants. - Liam -- Liam J.

Re: [R-sig-phylo] LTT plot non-ultrametric trees

2011-08-11 Thread Liam J. Revell
rstanding about the differences in maximum ages! Cheers, Rob On 11 August 2011 14:05, Liam J. Revell mailto:liam.rev...@umb.edu>> wrote: Hi Rob. I can reproduce your error, but I haven't figured out the problem yet. You can try an earlier version of this function, which s

Re: [R-sig-phylo] LTT plot non-ultrametric trees

2011-08-11 Thread Liam J. Revell
() differ by 3 instead of 2). I'm sure that this can be fixed easily. Thanks for sharing this. Best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 8/11/2011 7:52 PM, Rob La

Re: [R-sig-phylo] Interpreting rate.evol.mcmc output

2011-08-12 Thread Liam J. Revell
nstance, you can compute parameter estimates as the mean or median; as well as HPD intervals and ESSs using, for instance, the MCMC diagnostics package "coda.") I hope this is helpful. Thanks again for giving the method a try. Please don't hesitate to contact me for further clarific

Re: [R-sig-phylo] Blomberg's K and assumptions regarding independent contrasts

2011-08-22 Thread Liam J. Revell
) on this tree (and any star tree). I hope this is helpful. Sorry for the slow reply. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 8/12/2011 1:35 AM, Manabu

Re: [R-sig-phylo] Maximum Parsimony branch lengths

2011-09-02 Thread Liam J. Revell
uot;) > tree<-pratchet(dna) # or you could use optim.parsimony() > tree<-acctran(tree,dna) I hope this helps. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 9/2/201

Re: [R-sig-phylo] edge representation of trees produced by birthdeath.tree() in geiger

2011-09-09 Thread Liam J. Revell
ot; This tells us, to take your example, that node 13 should be connected to tips 1 & 2, which tre$tip.label tells us have labels "8" & "9", just as we see with: > plot(tre); nodelabels() I hope this clears things up somewhat. All the best, Liam

Re: [R-sig-phylo] post-order tree traversal

2011-09-14 Thread Liam J. Revell
instance if you just label the nodes as they are first encountered in the matrix this would be in the order of a post-order traversal of the tree. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu

Re: [R-sig-phylo] Simulating binomial trait shifts on a phylogeny

2011-10-11 Thread Liam J. Revell
now if this is useful or if you have any questions or difficulties implementing. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 10/11/2011 6:18 PM, Antigoni

Re: [R-sig-phylo] Simulating a phylogeny with outgroup on long branch

2011-10-13 Thread Liam J. Revell
r3$tip.label=="tr1"]<-"NA" tr3<-paste.tree(tr3,tr1) tr3$tip.label[tr3$tip.label=="tr2"]<-"NA" tr3<-paste.tree(tr3,tr2) # plot the full tree plot(tr3) I hope this is kind of what you are going for. All the best, Liam -- Liam J. Revell University of

Re: [R-sig-phylo] basal dichotomy in phylo object

2011-10-25 Thread Liam J. Revell
500 is tipward of 174 in the tree, to re-root the tree halfway along the edge leading to node number 500 (in tree$edge), you would just do: rooted.tree<-reroot(tree,node.number=500,position=tree$edge.length[tree$edge[,2]==500]/2) I think. All the best, Liam -- Liam J. Revell University

Re: [R-sig-phylo] basal dichotomy in phylo object

2011-10-25 Thread Liam J. Revell
e this helps. Also, thanks Klaus. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 10/25/2011 11:19 AM, Klaus Schliep wrote: Dear Ondrej, there is also a function midpoint in ph

Re: [R-sig-phylo] Comparative Methods and Pseudo-Traits

2011-11-10 Thread Liam J. Revell
e Revell 2010, MEE; or, better yet, Stone 2011, Syst. Biol. doi:10.1093/sysbio/syq098.) Regarding extinction probability, perhaps someone else on the list can address that specific example. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/

Re: [R-sig-phylo] Comparative Methods and Pseudo-Traits

2011-11-10 Thread Liam J. Revell
s, and then compare them using likelihood. This seems the most prudent course of action for this type of data. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 11/

Re: [R-sig-phylo] question about pic3

2011-11-11 Thread Liam J. Revell
of contrasts will not be. Also, in a bit of self promotion, I will also note that phylosig in the phytools package can compute K for trees with polytomies with no problem because it does not use contrasts: library(picante) K<-phylosig(tr1,x) All the best, Liam -- Liam J. Revell University

Re: [R-sig-phylo] question about pic3

2011-11-11 Thread Liam J. Revell
BTW: > library(picante) > K<-phylosig(tr1,x) should actually be: > library(phytools) > K<-phylosig(tr1,x) Best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com

Re: [R-sig-phylo] extremely small yet highly significant values for Pagel's lambda in fitContinuous

2011-11-12 Thread Liam J. Revell
ge, phytools, also can conduct this test: require(phytools) fitLambda<-phylosig(tree,x,method="lambda",test=T) All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.

Re: [R-sig-phylo] on phylosig

2011-11-12 Thread Liam J. Revell
of lambda=1.0 (which could be interpreted as a test for departure from BM). This can be done by using fitContinuous(...,model="lambda") and fitContinuous(...,model="BM"), and then comparing the likelihoods. I hope this is helpful. Liam Liam J. Revell University of

Re: [R-sig-phylo] Comparative Methods and Pseudo-Traits

2011-11-14 Thread Liam J. Revell
tic regression of Ives & Garland (2009), but I'm not too familiar with this method. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 11/14/2011 3:54 PM, David Bapst

Re: [R-sig-phylo] covriance matrix internal nodes

2011-11-21 Thread Liam J. Revell
C)),c(1:ntips,(ntips+2):ncol(C))] return(C) } else return(vcv.phylo(phy)) } All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 11/21/2011 12:09 PM, ppi...@uniroma3.it wrote: &

Re: [R-sig-phylo] covriance matrix internal nodes

2011-11-23 Thread Liam J. Revell
C)),c(1:ntips,(ntips+2):ncol(C))] return(C) } else return(vcv.phylo(phy)) } All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 11/21/2011 12:09 PM, ppi

Re: [R-sig-phylo] Rotating a fan tree

2011-12-02 Thread Liam J. Revell
r1))) radial.phylog(newick2phylog(write.tree(tr2))) Hopefully someone else has a better idea. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 12/1/2011 11:45 PM, Alison R. Davis R

Re: [R-sig-phylo] split data set and topology on PGLS

2011-12-14 Thread Liam J. Revell
tion: evol.vcv). All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 12/14/2011 3:26 PM, Theodore Garland Jr wrote: Why not just include an interaction term between your

Re: [R-sig-phylo] Measures of dissimilarity between phylogenetic trees

2011-12-26 Thread Liam J. Revell
other metrics of tree distance. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 12/26/2011 6:27 PM, Bruno de Medeiros wrote: Hi everyone, I am simulating charact

Re: [R-sig-phylo] phyDat format problem

2012-01-09 Thread Liam J. Revell
th 10 character and 9 different site patterns. The states are 0 1 However: p<-as.data.frame(p) p2<-phyDat(p,type="USER",levels=c(0,1)) Gives me: > p2 10 sequences with 5 character and 5 different site patterns. The states are 0 1 -- Liam J. Revell University of Massachusetts Bo

Re: [R-sig-phylo] Lambda; PIC vs. PGLS

2012-01-13 Thread Liam J. Revell
lt;-gls(y~x,data=data,correlation=corPagel(0.5,tree,fixed=FALSE),method="ML") # fit using caper:pgls r2<-pgls(y~x,data=comparative.data(tree,data,"Species"),lambda="ML") # fit using phytools:phyl.resid r3<-phyl.resid(tree,x,y,method="lambda") -- Liam J.

Re: [R-sig-phylo] Blomberg K Statistic

2012-01-19 Thread Liam J. Revell
particular direction. If you share your tree and data I would be happy to look at the issue more closely. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 1/19

Re: [R-sig-phylo] Bug in geiger::fitContinuous with meserr

2012-02-02 Thread Liam J. Revell
mes(meserr)) meserr<-meserr[o,] should be changed to o<-match(rownames(td$data),rownames(meserr)) meserr<-as.matrix(meserr[o,]) because the former inadvertently converts meserr to a vector, when a matrix is subsequently needed. - Liam -- Liam J. Revell University of Massachusetts Boston w

Re: [R-sig-phylo] Reconstructing Ancestral Characters and Exporting Data

2012-02-08 Thread Liam J. Revell
hope this helps. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 2/8/2012 1:59 PM, Amy Boddy wrote: Hello, I was wondering if somebody could help me with a problem I am having i

Re: [R-sig-phylo] differing sigma2 results

2012-02-11 Thread Liam J. Revell
should not alter the relative likelihoods of different models fit to the same rescaled data! All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 2/11/2012 10:20 AM,

Re: [R-sig-phylo] problem calculating independent contrasts

2012-02-20 Thread Liam J. Revell
; $Data.not.tree [1] "Chlorocebus pygerythrus" - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 2/20/2012 7:30 PM, Graham Slater wrote: Hi Tom, have you tried ru

Re: [R-sig-phylo] convergence issues with hansen model

2012-03-12 Thread Liam J. Revell
You might want to try the OUWie package by Beaulieu & O'Meara (http://cran.r-project.org/web/packages/OUwie/index.html). I have not tried it yet, but it promises to do multi-optimum OU model fitting as well. All the best, Liam -- Liam J. Revell University of Massachusetts Boston

Re: [R-sig-phylo] convergence issues with hansen model

2012-03-13 Thread Liam J. Revell
Hi Rafael. I don't want to speak on behalf of the authors who are also on this list, but OUwie can read in modified "phylo" objects created by the phytools functions read.simmap & make.simmap. All the best, Liam -- Liam J. Revell University of Massachuset

Re: [R-sig-phylo] estimating branch lengths on existing tree topology without branch lengths

2012-04-30 Thread Liam J. Revell
uence Reconstruction" (http://cran.r-project.org/web/packages/phangorn/index.html) for details. - Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 4/30/2012 11:36 AM, Annemarie Ver

Re: [R-sig-phylo] estimate ancestral states of specific internal nodes

2012-05-08 Thread Liam J. Revell
set of trees is simple, for instance, using sapply: sp<-c("t1","t3","t8") target.state<-sapply(trees,function(a,x,sp) ace(x,a)$ace[as.character(findMRCA(a,sp))],x=x,sp=sp) Or, of course, you could just as easily use a simple "for" loop. Perhaps this helps?

Re: [R-sig-phylo] more problems with branch names

2012-05-09 Thread Liam J. Revell
Looks like this may be because your row names in your data frame have spaces, while your tree tip labels do not. Try: rownames(example)<-sub(" ","",rownames(example)) example<-example[tree$tip.label,] Help? - Liam -- Liam J. Revell University of Mass

Re: [R-sig-phylo] Non-parametric alternative to phylogenetic ANOVA?

2012-05-30 Thread Liam J. Revell
also give you parameter estimated (fitted means for each factor) and standard errors. These can be used to conduct posthoc comparison of means using t-tests in the standard way. I hope this helps. All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb

Re: [R-sig-phylo] Question about Kcalc with >1 data points per species

2012-06-06 Thread Liam J. Revell
,2]; names(xvar)<-temp[,1] # replace NA with mean variance xvar[is.na(xvar)]<-mean(xvar,na.rm=TRUE) # get the N per species n<-as.vector(table(names(y))) # compute the standard errors se<-sqrt(xvar/n) # compute K K<-phylosig(tree,xbar,se=se) Hopefully that works for you. All the

Re: [R-sig-phylo] Error estimating RMA in phytools

2012-06-22 Thread Liam J. Revell
the analysis. You might also get this error (or one quite similar) if you tree has zero-length terminal edges or y=k*x for non-zero scalar constant k (i.e., r(x,y)==1 or -1). All the best, Liam -- Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ em

Re: [R-sig-phylo] Phylogenetic Canonical Correlations

2012-07-13 Thread Liam J. Revell
matrices in which each column of each matrix # is a scalar constant - Liam -- Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 7/13/2012 1:32 PM, Jonath

Re: [R-sig-phylo] Within-species error in PGLS (or similar)

2012-07-17 Thread Liam J. Revell
as before. If anyone would like to compare to Ives & Garland's MATLAB code I would love to hear the result as I only hope I got this right. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.re

Re: [R-sig-phylo] simulate traits evolution in correlated with body mass

2012-07-24 Thread Liam J. Revell
Hi Andrew. For desired correlation r, size data x, and tree you could just do: library(phytools) y<-r*x+sqrt(1-r^2)*fastBM(tree) This should give you the correlation r on average and the y|x should be Brownian. (If x is Brownian, then both y & x & y|x will be too.) - Liam Lia

Re: [R-sig-phylo] simulate traits evolution in correlated with body mass

2012-07-24 Thread Liam J. Revell
Actually, modify my previous email. That only works for sig^2(x)=1.0. It should be: library(phytools) y<-r*x+sqrt(1-r^2)*fastBM(tree,sig2=mean(pic(x,tree)^2)) - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.rev

Re: [R-sig-phylo] find mrca of multiple taxa.

2012-08-15 Thread Liam J. Revell
Hi Ben. Take a look at the function findMRCA in my package, phytools. I think this does what you want. Good luck. Liam Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com -Original

Re: [R-sig-phylo] Plot size

2012-08-28 Thread Liam J. Revell
e plotting window. Is this at all helpful? All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 8/28/2012 1:34 PM, Gwennaël Bataille wrote: Dea

Re: [R-sig-phylo] Alter the branch lengths of a Tree

2012-08-28 Thread Liam J. Revell
llows: tree$edge.length<-runif(n=nrow(tree$edge),min=0,max=2) tree$edge.length tree$edge.length[tree$edge.length<1]<-1 tree$edge.length[tree$edge.length>1]<-2 tree$edge.length plot(tree) I hope this is of some help. All the best, Liam Liam J. Revell, Assistant Professor of Bio

Re: [R-sig-phylo] testing binomial characters

2012-08-29 Thread Liam J. Revell
will also see that there was considerable discussion about whether it was possible to fit the same model using MCMCglmm. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog:

Re: [R-sig-phylo] tips to root brach length

2012-09-03 Thread Liam J. Revell
Hi. Try: diag(vcv.phylo(tree)) nodeHeights in phytools will also give you a matrix with all the heights of internal and terminal nodes in the same order as tree$edge. - Liam Liam J. Revell University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu

Re: [R-sig-phylo] cryptic missing data during phyl.pairedttest

2012-09-12 Thread Liam J. Revell
t works. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 9/12/2012 3:53 PM, Agus Camacho wrote: Dear all, Im trying to ha

Re: [R-sig-phylo] GLS with Orstein-Uhlenbeck model

2012-09-13 Thread Liam J. Revell
ary(phytools); library(geiger) fit<-fitContinuous(tree,x,model="OU")$Trait1 ou<-ace(x,ouTree(tree,fit$alpha)) # or ou<-anc.ML(ouTree(tree,fit$alpha),x) Good luck. - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/li

Re: [R-sig-phylo] likelihood of discrete data

2012-09-13 Thread Liam J. Revell
o fix. You can do: Y<-phyDat(X,type="USER",levels=unique(as.vector(X)) lik<-pml(tree,Y,Q=Q) This will compute the likelihood you want, I think. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell

Re: [R-sig-phylo] Problem with ace/anc.ML

2012-09-14 Thread Liam J. Revell
oot(...)) & root(...,resolve.root=TRUE) don't produce the same rooted phylogenies. The former, not the latter, should be used in this case. - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.r

Re: [R-sig-phylo] variation in rates over time

2012-09-17 Thread Liam J. Revell
different rate of evolution than the rest of the tree, you could do this as follows: library(phytools) # load phytools tree<-make.era.map(tree,c(0,max(nodeHeights(tree))-3.4)) plotSimmap(tree,pts=F,lwd=3) # visualize fit<-brownie.lite(tree,x) # fit model That's it. Good luck. Liam Lia

Re: [R-sig-phylo] variation in rates over time, unexpected message when using Brownie.lite

2012-09-18 Thread Liam J. Revell
trees to do the analyses of brownie.lite in one of its functions. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 9/18/2012 4:08 PM, Agus Camac

Re: [R-sig-phylo] phy.manova from Geiger package gives an error of different variable length with variables of equal length

2012-09-25 Thread Liam J. Revell
Hi Agus. I think the problem is that c() concatenates your data for the continuous dependent variables in your model into one long vector. Try instead: table<-as.matrix(table) Y<-cbind(table[,2],table[,3]) x<-as.factor(table[,1]) phy.manova(tree,Y,x) Good luck. - Liam Liam

Re: [R-sig-phylo] ape hangs when plotting radial tree from custom phyloobject

2012-10-15 Thread Liam J. Revell
Hi Philipp. As I'm not responsible for ape or plot.phylo, I'm not sure why this would be the case, but reorde.phylo() seems to solve your problem: tree<-reorder(tree) plot(tree, type="unrooted") You might also try: tree<-read.tree(text=write.tree(tree)) - Liam Li

Re: [R-sig-phylo] node ages

2012-10-31 Thread Liam J. Revell
) This should give the same result as branching.times for ultrametric trees, but will not be "messed up" for trees containing lineages that terminate before the present. - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.um

Re: [R-sig-phylo] breaking up phylogeny figure

2012-11-14 Thread Liam J. Revell
along with links to the code, on my blog: http://blog.phytools.org/2012/11/function-to-break-up-plotted-tree-into.html All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog:

Re: [R-sig-phylo] Adding a branch to a tree

2012-11-16 Thread Liam J. Revell
ip<-list(edge=matrix(c(2,1),1,2), tip.label="species.name", edge.length=1.0, Nnode=1) class(tip)<-"phylo" # attach to any node (say, node 16) btree<-bind.tree(tree,tip,where=16) plotTree(btree) Hopefully that works. Good luck. - Liam Liam J. Revell,

Re: [R-sig-phylo] Phylogenetic signal and PGLS

2012-11-28 Thread Liam J. Revell
than 4 min. to run a tree of 1000 tips on my computer.) I hope this helps. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 11/28/201

Re: [R-sig-phylo] truncated downwards plot.phylo and plot margin

2013-03-05 Thread Liam J. Revell
x.lim. For instance, I found via trial & error that: plot(bird.orders,x.lim=c(1.3,35.5),y.lim=c(1.5,22.4),no.margin=T) got me pretty darn close. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ em

Re: [R-sig-phylo] testing for correlates of rates of evolution

2013-03-11 Thread Liam J. Revell
names(a)]^2 r<-cor(a,b,method=method) return(r) } r.null<-c(r,replicate(nsim-1,foo(tree,V))) P<-mean(abs(r.null)>=abs(r)) return(list(beta=beta,r=r,P=P,method=method)) } Perhaps this is a good idea. I don't know. All the best, Liam Liam J. Revell, As

Re: [R-sig-phylo] testing for correlates of rates of evolution

2013-03-12 Thread Liam J. Revell
I did a little further exploration of this proposed "method" - the results & discussion are here: http://blog.phytools.org/2013/03/investigating-whether-rate-of-one.html Maybe this will be of some help in deciding the best approach to go forward with. All the best, Liam

Re: [R-sig-phylo] Ancestral state estimates of continuous traits

2013-03-15 Thread Liam J. Revell
etic datasets.) All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/15/2013 8:18 AM, Alejandro Gonzalez wrote: Hello, I am using ape to obtain

Re: [R-sig-phylo] testing for correlates of rates of evolution

2013-03-15 Thread Liam J. Revell
e Brownian process of evolution in y (i.e., the "rate of evolution" in y, sensu O'Meara et al. 2006 and other refs). All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@um

Re: [R-sig-phylo] branches wtih multiple colors

2013-03-18 Thread Liam J. Revell
). Presently plotSimmap only plots right & left-facing square phylograms. If this is what you're looking for, please let me know if you need any assistance using these phytools functions. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston

Re: [R-sig-phylo] Concatenation of character matrices

2013-03-20 Thread Liam J. Revell
mes))) bb<-sort(unique(sapply(YY,colnames))) XX<-matrix(NA,length(aa),length(bb),dimnames=list(aa,bb)) for(i in 1:length(YY)) XX[rownames(YY[[i]]),colnames(YY[[i]])]<-YY[[i]] at least. Hope this is helpful. Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Bos

Re: [R-sig-phylo] ace in ape how to derive ancestral states (which.max)

2013-03-20 Thread Liam J. Revell
on (we should use the marginal or joint reconstructions instead). 2) Extracting only the most likely state as *the* ancestral state at the node ignores the uncertainty of our estimate. Really we have a probability distribution for the states at each node. - Liam Liam J. Revell, Assistant

Re: [R-sig-phylo] ace in ape how to derive ancestral states (which.max)

2013-03-20 Thread Liam J. Revell
Fitzjohn's package diversitree can be used to obtain the joint reconstructions under likelihood. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools

Re: [R-sig-phylo] ace in ape how to derive ancestral states (which.max)

2013-03-21 Thread Liam J. Revell
as ancestral state estimates (except at the root). All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 3/20/2013 6:02 PM, Liam J. Revell wrote

Re: [R-sig-phylo] Information on {ape] function "nodelabels"

2013-03-25 Thread Liam J. Revell
ditional likelihoods for the subtree, not marginal ancestral state reconstructions. I believe that the help page for ace will be clarified in future versions of ape. Good luck. Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.um

Re: [R-sig-phylo] combining p-values in PCMs

2013-04-01 Thread Liam J. Revell
ted by varBeta<-var(BB[,"beta"])+mean(BB[,"var(beta)"]) t.beta<-mean(BB[,"beta"])/sqrt(varBeta) P.beta<-2*pt(abs(t.beta),df=length(trees[[1]]$tip)-2,lower.tail=FALSE) I think that's right. All the best, Liam Liam J. Revell, Assistant Professor of Bio

Re: [R-sig-phylo] combining p-values in PCMs

2013-04-02 Thread Liam J. Revell
gle consensus or "best" tree will surely be too small. I hope that seems reasonable to you. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytool

Re: [R-sig-phylo] pruning a tree

2013-04-05 Thread Liam J. Revell
that method 2 isn't working because your species names are not row names in your data matrix. To have that, you could do: birddata<-read.csv("H:/birddata_family_20130405.csv",header=T,row.names=1) All the best, Liam Liam J. Revell, Assistant Professor of Biology University o

Re: [R-sig-phylo] Exporting Ancestor Reconstruction from Mesquite to R for ouch

2013-04-05 Thread Liam J. Revell
ganize your results of interest more sensibly than this so that they can be easily aggregated across mappings. Good luck. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blo

Re: [R-sig-phylo] statistically test whether two characters evolve dependently

2013-04-08 Thread Liam J. Revell
cters & two traits; Threshml can analyze more than two traits - but I believe is still limited to binary discrete characters. Please let me know if it would be helpful to your research to extend threshBayes to allow for multistate (ordered, naturally) discrete characters. All the best, Lia

Re: [R-sig-phylo] statistically test whether two characters evolve dependently

2013-04-08 Thread Liam J. Revell
uous). - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 4/8/2013 8:27 PM, Liam J. Revell wrote: Hi Peter. I'm not sure if this is what you mean, but Fe

Re: [R-sig-phylo] statistically test whether two characters evolve dependently

2013-04-09 Thread Liam J. Revell
. Several people have made suggestions about this to me but I'm not sure I understand them. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org

Re: [R-sig-phylo] pruning tree of 10000 species

2013-04-10 Thread Liam J. Revell
Hi Elaine. A tree of 10,000 tips written to file should not take up 3.9 GB. Even a 1000 Newick trees of this size should not take up this much space. Are you sure this is the size of your file? All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts

Re: [R-sig-phylo] pruning tree of 10000 species

2013-04-12 Thread Liam J. Revell
quiet = TRUE, skip = 0, comment.char = "#", nlines=1) tree<-read.tree(text=temptree) - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 4/12/2013 11

Re: [R-sig-phylo] randomizing Pagel's lambda

2013-04-12 Thread Liam J. Revell
bda<-phylosig(tree,x,method="lambda")$lambda # obs. lambda # lambda from randomized tips ff<-function(x){ x$tip.label<-sample(x$tip.label); x } ll<-replicate(nn-1,phylosig(ff(tree),x,method="lambda")$lambda) p<-mean(c(lambda,ll)>=lambda) # p.value from rand

Re: [R-sig-phylo] Estimating ancestral states of a trait under "selection"

2013-04-19 Thread Liam J. Revell
d to put priors on everything (or nothing, in which a pretty uninformative prior is used). If you decide this is what you want to do & have difficulty figuring it out, please let me know. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston w

Re: [R-sig-phylo] Strahler numbers for calculating branching complexity

2013-04-19 Thread Liam J. Revell
ion that I think does this - I posted it to my blog here: http://blog.phytools.org/2013/04/computing-strahler-numbers-for-nodes-on.html. Check it out and let us know if this does what it is supposed to. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts

Re: [R-sig-phylo] Strahler numbers for calculating branching complexity

2013-04-20 Thread Liam J. Revell
Glad to hear it Alastair. I posted an answer to your second question (how to extract the set of most inclusive clades with Strahler number i) here: http://blog.phytools.org/2013/04/extracting-set-of-most-inclusive-clades.html. All the best, Liam Liam J. Revell, Assistant Professor of

Re: [R-sig-phylo] Number of character state changes in a parsimony reconstruction

2013-05-03 Thread Liam J. Revell
r reconstruction using parsimony & maximum likelihood (http://tinyurl.com/cq93pyj). All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 5/2/

Re: [R-sig-phylo] Find common ancestor of multiple taxa

2013-05-09 Thread Liam J. Revell
This is exactly what findMRCA in phytools does, but I wrote it a while ago so I'm not sure how fast it is - Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog:

  1   2   3   4   5   6   >