[Phylobase-devl] Tree plotting and Node Labels

Marguerite Butler mbutler at hawaii.edu
Sat Jul 19 01:23:25 CEST 2008


Hi Steve,

I am not sure if this question is related to what you were doing with  
modifying phylo4d. It comes up in a plot example, where a user might  
want to plot a tree with particular nodes labeled, but the rest blank.

The default behavior of the phylo4 constructor is to create a node  
label. So I got it to work, by erasing these and then adding the ones  
I want, but it's quite kludgy.

require(phylobase)
read.nexus("squamatetree1.nex") -> tree
tree4 <- as(tree, "phylo4")
smalltree4 <- subset(tree4, mrca=MRCA(tree4, "Wetmorena_haetiana",  
"Abronia_graminea"))

If we just change the specific node labels and then plot, we get an  
ugly mess:

smalltree4$node.label[1] <- "root"
smalltree4$node.label[12] <- "Ophisaurus"
plot(smalltree4, show.node.label=T)

So we have to erase the contents first and then plot:

smalltree4$node.label <- vector(mode="character", length=23)
smalltree4$node.label
smalltree4$node.label[1] <- "root"
smalltree4$node.label[12] <- "Ophisaurus"
plot(smalltree4, show.node.label=T)

Do you have any thoughts on this?

Marguerite



On Jul 18, 2008, at 10:13 AM, Steve Kembel wrote:

> Hi,
>
> I just updated the phylo4d data structure to eliminate the problem
> with duplicate node labels causing crashes when creating phylo4d
> objects with node data. The phylo4d data now rely entirely on the
> tip.label and node.label slots as opposed to storing duplicates of
> those names in the row.names. You can create phylo4d objects matching
> on your data's row.names or a column containing labels with the
> label.type argument to phylo4d, and you can output the data with the
> labels as a column:
> library(phylobase)
> example(phylo4d)
> print(obj)
> tdata(obj)
> tdata(obj,label.type="column")
>
> Further testing appreciated. I think I fixed all the dependent
> functions that this change broke, except for the NexusToPhylo4D
> function which I couldn't get working, will wait for Brian's update.
> I'd say go ahead and make any changes on the trunk.
>
> Steve
>
> On Jul 17, 2008, at 7:56 AM, Brian O'Meara wrote:
>
>> I was testing nexus parsing again before a course using R here at
>> NESCent, and it now doesn't work (just the tree part, I think). I'm
>> having trouble checking out the code again from r-forge, but once
>> that's working, I'll see what the problem is. I'll fix it on the
>> trunk, unless someone things I should branch it for the change(s).
> _______________________________________________
> Phylobase-devl mailing list
> Phylobase-devl at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/ 
> phylobase-devl

____________________________________________
Marguerite A. Butler
Department of Zoology
University of Hawaii
2538 McCarthy Mall, Edmondson 259
Honolulu, HI  96822

Phone: 808-956-4713
Lab:  808-956-5867
FAX:   808-956-9812
Dept: 808-956-8617
http://www.hawaii.edu/zoology/faculty/butler.html
http://www2.hawaii.edu/~mbutler
http://www.hawaii.edu/zoology/


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20080718/b09c1152/attachment-0002.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: squamatetree1.nex
Type: application/octet-stream
Size: 9913 bytes
Desc: not available
Url : http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20080718/b09c1152/attachment-0001.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20080718/b09c1152/attachment-0003.htm 


More information about the Phylobase-devl mailing list