multi_level_best_baps_partition: multi_level_best_baps_partition

View source: R/multi_level_best_baps_partition.R

multi_level_best_baps_partitionR Documentation

multi_level_best_baps_partition

Description

Function to partition a given phylogeny, choosing the best partition at each level using the fastbaps approach.

Usage

multi_level_best_baps_partition(
  sparse.data,
  h,
  levels = 2,
  n.cores = 1,
  quiet = TRUE
)

Arguments

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

levels

the number of levels to investigate (default=2)

n.cores

the number of cores to use in clustering

quiet

whether to print additional information or not (default=TRUE)

Value

a data.frame representing the final clustering at multiple resolutions

Examples


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")
multi.res.df <- multi_level_best_baps_partition(sparse.data, h, levels=2)


gtonkinhill/fastbaps documentation built on Sept. 25, 2022, 1:56 p.m.