multi_res_baps: multi_res_baps

View source: R/multi_res_baps.R

multi_res_bapsR Documentation

multi_res_baps

Description

Function to perform Bayesian hierarchical clustering of population structure successively at multiple resolutions, choosing the best partition at each level.

Usage

multi_res_baps(
  sparse.data,
  levels = 2,
  k.init = NULL,
  hc.method = "ward",
  n.cores = 1,
  quiet = TRUE
)

Arguments

sparse.data

a sparse SNP data object returned from import_fasta_sparse_nt

levels

the number of levels to investigate (default=2)

k.init

the initial number of clusters for the top level (default=n.isolates/4)

hc.method

the type of initial hierarchical clustering to use. Can be with 'ward' or 'genie' (default='ward')

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


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