[Phylobase-devl] FW: adephylo phylo4d

Jombart, Thibaut t.jombart at imperial.ac.uk
Wed Feb 23 13:09:28 CET 2011


Dear all, 

A user of adephylo just reported an issue which I think is a bug in the phylo4d constructor. I tried giving it a go - the issue is somewhere in the formatData procedure - but I am not sure how this function is meant to behave anyway.

The issue is fairly simple: we have a "phylo" tree and a data.frame corresponding to tip data with row names identical to tip labels; yet a phylo4d can't seem to be obtained unless we disable tip/data matching:

####
library(phylobase)

## read tree
tre <- read.tree("tre.txt")

## read tip data
dat <- read.table("/home/thibaut/Desktop/temp/tipdata.txt", header=TRUE, row.names=1)

## reorder tip data according to tips
sum(tre$tip.label == rownames(dat))
all(tre$tip.label %in% rownames(dat))
dat <- dat[tre$tip.label,]
identical(rownames(dat), tre$tip.label) # is TRUE

x <- phylo4d(tre, dat, match.data=TRUE) # THIS IS THE ERROR
Error in formatData(phy = x, dt = tip.data, type = "tip", ...) : 
  Your tip data are being matched to internal nodes. Make sure that your data identifiers are correct.

x <- phylo4d(tre, dat, match.data=FALSE) # this works
####

This happens both with latest CRAN version and the current devel version (compiled from the svn sources on the 22 feb 2011).

Paul Dennis pointed out this issue and kindly allowed me to forward you the datasets to be able to reproduce the issue. Please do not send these data to anyone else.

Many thanks

Thibaut.

ps: here is my R version:
> R.version
               _                            
platform       x86_64-unknown-linux-gnu     
arch           x86_64                       
os             linux-gnu                    
system         x86_64, linux-gnu            
status                                      
major          2                            
minor          12.1                         
year           2010                         
month          12                           
day            16                           
svn rev        53855                        
language       R                            
version.string R version 2.12.1 (2010-12-16)


-- 
######################################
Dr Thibaut JOMBART
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - Faculty of Medicine
St Mary’s Campus
Norfolk Place
London W2 1PG
United Kingdom
Tel. : 0044 (0)20 7594 3658
t.jombart at imperial.ac.uk
http://sites.google.com/site/thibautjombart/
http://adegenet.r-forge.r-project.org/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tre.txt
URL: <http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20110223/3cd1fae4/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tipdata.txt
URL: <http://lists.r-forge.r-project.org/pipermail/phylobase-devl/attachments/20110223/3cd1fae4/attachment-0003.txt>


More information about the Phylobase-devl mailing list