Building a tree for binary data
1
0
Entering edit mode
10.4 years ago
Yongjie Zhang ▴ 110

Hi all,

I have a binary data set below and want to build a tree. Could you tell me which program can do that? Thanks. Yongjie

>V26_16
010011101
>V26_17
010011101
>V40_4
000010101
>V40_5
111111111
>09_9_24
010010101
>09_31_28
000010101
>552
111010101
>556
111010101
>494
111010101
>40
000000101
phylogeny • 3.5k views
ADD COMMENT
0
Entering edit mode

Thanks, mikhail. I appreciate your help. I'm not very familiar with R, but I think I can follow those codes you gave. I was also told PAUP and NTSYS can assist me. Thank you again.

ADD REPLY
2
Entering edit mode
10.4 years ago

This question seems more programming related than bioinformatics one. You can compute Hamming distance and then build a tree using Ape package in R.

Here is some sample code to do this, just in case

#load packages
install.packages("stringdist", "ape")
require(stringdist); require(ape)
# sample data
labels  <- c("V26_16", "V26_15", "V26_14", "V26_13", "V26_12")
strings <- c("10111", "11000", "10100", "10110", "11111")
# compute hamming distance
dm <- stringdistmatrix(strings, strings, method = "hamming")
# convert to distance object, add labels
colnames(dm) <- labels
rownames(dm) <- labels
d <- dist(dm)
# hierarchical clustering
hcl <- hclust(d)
# plot the tree
phylo <- as.phylo(hcl)
phylo$tip.label <- hcl$labels
plot(phylo)

ADD COMMENT

Login before adding your answer.

Traffic: 2151 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6