View source: R/best_baps_partition.R
best_baps_partition | R Documentation |
Function to combine smaller clusters from a fast hierarchical algorithm to maximise the BAPS likelihood.
best_baps_partition(sparse.data, h, quiet = FALSE)
sparse.data |
a sparse SNP data object returned from import_fasta_sparse_nt |
h |
a hclust object representing the hierarchical clustering that is to be cut |
quiet |
suppress the printing of extra information (default=FALSE) |
a final clustering
fasta.file.name <- system.file("extdata", "seqs.fa", package = "fastbaps") sparse.data <- import_fasta_sparse_nt(fasta.file.name) d <- snp_dist(sparse.data) d <- as.dist(d/max(d)) h <- hclust(d, method="ward.D2") partition <- best_baps_partition(sparse.data, h) newick.file.name <- system.file("extdata", "seqs.fa.treefile", package = "fastbaps") iqtree <- phytools::read.newick(newick.file.name) h <- phytools::midpoint.root(iqtree) best.partition <- best_baps_partition(sparse.data, h)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.