pair.dist.dna {phybase} | R Documentation |
Calculate pairwise distances among DNA sequences. The DNA sequences are coded as 1:A, 2:G, 3:C, 4:T.
pair.dist.dna(sequences, nst = 0)
sequences |
DNA sequences |
nst |
substitution model. 0:no model, 1:JC |
If nst=0, the distance is equal to the proportion of sites having different nucleotides between two sequences.
The function returns a distance matrix.
Liang Liu lliu@oeb.harvard.edu
Jukes, TH and Cantor, CR. 1969. Evolution of protein molecules. Pp. 21-123 in H. N. Munro, ed. Mammalian protein metabolism. Academic Press, New York.
tree<-"(((H:0.00402#0.01,C:0.00402#0.01):0.00304#0.01,G:0.00707#0.01):0.00929#0.01,O:0.01635#0.01)#0.01;" nodematrix<-read.tree.nodes(tree)$nodes sequences<-sim.dna(nodematrix,10000,model=1) pair.dist.dna(sequences,nst=1)