weigh.clocks <- function(ratesmat){
bsdmatdim <- nrow(ratesmat)
Nbranches <- ncol(ratesmat)
meanlengths <- colMeans(ratesmat)
wghts <- (meanlengths * Nbranches) / sum(meanlengths)
locus.brlens <- do.call(rbind, lapply(1:bsdmatdim, function(x) ratesmat[x,] / wghts))
if(!is.null(rownames(ratesmat))) rownames(locus.brlens) <- rownames(ratesmat)
return(locus.brlens)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.