emvolz / treedater

Scalable relaxed clock phylogenetic dating
24 stars 11 forks source link

How to add dates if they are not already on tip labels or can I import them from a csv file? #13

Closed slvrshot closed 4 years ago

slvrshot commented 4 years ago

Apologize as I am new to this...

I have some samples run through ParSNP to get the core genome and gubbins to remove recombination. I am attempting to use your tools and I have successfully imported the tree using:

tre <- read.tree("gubbins.final_tree.tre")

But I soon realized my tips do not have a date on them. That information is in a separate datafile. Is there a way to pull this data from my csv file or add them to the tips on my tree?

Thanks!

emvolz commented 4 years ago

Yes - provided you can load the data into R (e.g. using read.table or read.csv). The dater function requires a numeric vector. This can be in the same order as the tree tip.label or (safer option) you can used a named vector where names correspond to tip labels. Here is a recent example where I did that