L_computation <-
function(k,mu,n_tree,sequences,n, nodes, edges, el, eig_val, eig_vect, ivp, propinv) {
n_seq<-sequences[,k,drop=F]
if ("-" %in% n_seq){
gaps <- which(n_seq=='-')
n_tree <- drop.tip(n_tree,tip=rownames(n_seq)[gaps])
nodes <- unique(n_tree$edge[, 1]) - 1
edges <- n_tree$edge[, 2] -1
el <- n_tree$edge.length
n_seq <- n_seq[-gaps,]
n <- Ntip(n_tree)}
L = matrix(0,nrow=(2*n-1),ncol=4)
L[n_seq=='a',1]<-1
L[n_seq=='c',2]<-1
L[n_seq=='g',3]<-1
L[n_seq=='t',4]<-1
return(llpruning(nodes,edges, el, L, eig_val, eig_vect, ivp, propinv))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.