fix_clusters | R Documentation |
Function to iteratively update an intially clustering, greedily maximising the BAPS marginal likelihood.
fix_clusters(sparse.data, clusters, n.iterations = 1, quiet = FALSE)
sparse.data |
a sparse SNP data object returned from import_fasta_sparse_nt |
clusters |
the initial clustering to be improved. Given as a vector of cluster memberships (1 to n.cluster) of length equal to the number of sequences |
n.iterations |
the number of greedy maximisation iterations to perform |
quiet |
whether or not to print the improvements in the likelihood at each step (default=FALSE) |
a final clustering
## Not run: fasta.file.name <- system.file("extdata", "seqs.fa", package = "fastbaps") sparse.data <- import_fasta_sparse_nt(fasta.file.name) sim.matrix <- snp_similarity(sparse.data) x <- as.dist(1-sim.matrix/max(sim.matrix)) phylo <- ape::as.phylo(hclust(x, method="average")) clusters <- best_baps_partition(sparse.data, phylo) clusters <- fix_clusters(sparse.data, clusters) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.