App-Egaz
view release on metacpan or search on metacpan
share/2_mash.tt2.sh view on Meta::CPAN
tmp <- as.matrix(tmp)
mat <- tmp[,-1]
rownames(mat) <- tmp[,1]
dist_mat <- as.dist(mat)
clusters <- hclust(dist_mat, method = "ward.D2")
tree <- as.phylo(clusters)
write.tree(phy=tree, file="tree.nwk")
group <- cutree(clusters, h=0.4) # k=5
groups <- as.data.frame(group)
groups$ids <- rownames(groups)
rownames(groups) <- NULL
groups <- groups[order(groups$group), ]
write_tsv(groups, "groups.tsv")
'
log_info newick-utils
cat tree.nwk |
[% IF opt.outgroup -%]
nw_reroot - [% opt.outgroup %] |
share/plot_tree.R view on Meta::CPAN
font = 1,
adj = 0,
xpd = TRUE,
label.offset = 0.001,
no.margin = TRUE,
underscore = TRUE
)
nodelabels(
tree$node.label,
adj = c(1.3,-0.5),
frame = "n",
cex = 0.8,
font = 3,
xpd = TRUE
)
add.scale.bar(cex = 0.8, lwd = 2, length = barlen)
}
pdf(file = opt$outfile)
tree <- read.tree(opt$infile)
plot_tree(tree)
( run in 0.596 second using v1.01-cache-2.11-cpan-e1769b4cff6 )