[R-sig-phylo] APE: zoom with polytomies

Felipe Zapata felipe.zapata at umsl.edu
Thu Feb 18 17:49:19 CET 2010


Thanks Christoph! That was the problem!!  I could not find the phyloch  
in the CRAN package repository, though. But your solution number 1 did  
the trick.

F


On Feb 18, 2010, at 2:41 AM, Christoph Heibl wrote:

>> A question for ape/adephylo users/developers:
>>
>> I am trying to use the function zoom with a tree having several  
>> polytomies but the zoomed subtree does not match the original tree  
>> (tip names don't match, tips dropped are incorrect, etc.).  Can I  
>> use zoom with this kind of trees?
>>
>> Thanks,
>>
>> Felipe
>>
>
> Hi Felipe,
>
> I think 'zoom' should work fine whether you have polytomies in your  
> tree or not.
>
> The real problem might be that you used 'zoom' after dropping some  
> tips. Dropping of tips will change the number of tip and nodelabels,  
> so in order to get the same subclade zoomed after dropping tips you  
> have to update the tiplabel numbers you are using in zoom.
>
> Consider this example:
>
> # a random tree:
> require(ape)
> x <- read.tree(text = "(((t6:0.9124642322, 
> (((t15:0.763347025,t13:0.4794026697):0.426768458,t9:0.7685599467): 
> 0.7559998292,(((t8:0.9458652218,(t4:0.4264551129, 
> (t12:0.9265467434,t14:0.06012448971):0.4074520699):0.3801177626): 
> 0.4832803826,t16:0.1149912339):0.3508147765,(t3:0.2073358065, 
> ((t1:0.1833784787,t10:0.935524419):0.3867754398,t17:0.07411593921): 
> 0.2092757893):0.8222714649):0.1480638876):0.3325922119):0.4045951709, 
> ((t20:0.008494108217,t19:0.8814952525):0.5567112574,t5:0.6317262289): 
> 0.2361973079):0.165878773,(t11:0.1028172295, 
> ((t18:0.3764394664,t2:0.1837577075):0.7649489271,t7:0.7671515651): 
> 0.9871137862):0.3174205599);")
>
> # create a polytomy:
> x <- di2multi(x, 0.2)
>
> # have a look at it:
> plot(x)
>
> # say you want to zoom on the clade containing t8, t4, t12, and t14
> # their tip numbers are:
> tips <- 5:8
> zoom(x, tips)
>
> #  now delete t15, t3, and t19 from x
> y <- drop.tip(x, 2:4)
>
> # and try to zoom again on the same clade:
> zoom(y, tips)
> # this is not what you want because the tip numbering has changed.
>
>
> # Solution 1: Have a look at the new tip numbers with
> tiplabels(y)
> # and update the tips vector accordingly:
> tips <- 2:5
> zoom(y, tips)
>
> # Solution 2: You can use 'noi' and 'descedents' from the phyloch  
> package
> # to update your tip label vector automatically. I use this with  
> large trees,
> # where you cannot simply keep trace of the tip numbers:
>
> require(phyloch)
> z <- noi(y, c("t4", "t8", "t12", "t14"))
> new.tips <- descendants(y, z)
> zoom(y, new.tips)
>
> I hope this solves your problem!
> Christoph
>
>> _______________________________________________
>> R-sig-phylo mailing list
>> R-sig-phylo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>
>
>
> ________________________________________________________
>
> Christoph Heibl
>
> Systematic Botany
> Ludwig-Maximilians-Universität München
> Menzinger Str. 67
> D-80638 München
> GERMANY
>
> phone:     +49-(0)89-17861-251
> e-mail:    heibl at lmu.de
>
> http://www.christophheibl.de/ch-home.html
>
> SAVE PAPER - THINK BEFORE YOU PRINT
>
>
>



More information about the R-sig-phylo mailing list