Calculate the percentage of each unique phylogenetic tree in a BEAST output I have a nexus formatted BEAST output containing 20,000 phylogenetic trees of seven taxa. Is there any way to get the percentage of each unique phylogenetic tree contained in this output?

I already made an unsuccessful attempt with R.
I finally managed to do it in R. Here is my code: 

install.packages('devtools')
library(devtools)
install_github('santiagosnchez/rBt')
library(rBt)

beast_output &lt;- read.annot.beast('beast_output.trees')
beast_output_rooted &lt;- root.multiPhylo(beast_output, c('taxon_A', 'taxon_B'))
unique_topologies &lt;- unique.multiPhylo(beast_output_rooted)

count &lt;- function(item, list) {
  total = 0
  for (i in 1:length(list)) {
    if (all.equal.phylo(item, list[[i]], use.edge.length = FALSE)) {
      total = total + 1
    }
  }
  return(total)
}

result &lt;- data.frame(unique_topology = rep(0, length(unique_topologies)),
                     count = rep(0, length(unique_topologies)))
for (i in 1:length(unique_topologies)) {
  result[i, ] &lt;- c(i, count(unique_topologies[[i]], beast_output_rooted))
}

result$percentage &lt;- ((result$count/length(beast_output_rooted))*100)