Fixed argument passing (#25)

This commit is contained in:
Waldir Leoncio 2023-08-09 14:45:43 +02:00
parent 3d3131b68c
commit b75d38fee4
2 changed files with 6 additions and 5 deletions

View file

@ -14,8 +14,9 @@
#' greedyMix(data, "fasta")
greedyMix <- function(
data, format, partitionCompare = NULL, ninds = NULL, rowsFromInd = NULL,
noalle = NULL, adjprior = NULL, npops = 1L, priorTerm = NULL,
alleleCodes = NULL, inp = NULL, popnames = NULL, fixedK = FALSE, verbose = TRUE
noalle = NULL, adjprior = NULL, npops = 1L, priorTerm = NULL, counts = NULL,
sumcounts = NULL, max_iter = 100L, alleleCodes = NULL, inp = NULL,
popnames = NULL, fixedK = FALSE, verbose = FALSE
) {
# Importing and handling data ================================================
data <- importFile(data, format, verbose)
@ -39,7 +40,7 @@ greedyMix <- function(
# Generating partition summary ===============================================
logml_npops_partitionSummary <- indMixWrapper(c, npops, fixedK, verbose);
logml_npops_partitionSummary <- indMixWrapper(c, npops, counts, sumcounts, max_iter, fixedK, verbose);
logml <- logml_npops_partitionSummary[["logml"]]
npops <- logml_npops_partitionSummary[["npops"]]
partitionSummary <- logml_npops_partitionSummary[["partitionSummary"]]

View file

@ -1,7 +1,7 @@
indMixWrapper <- function(c, npops, fixedK = FALSE, verbose = FALSE) {
indMixWrapper <- function(c, npops, counts, sumcounts, max_iter, fixedK = FALSE, verbose = FALSE) {
if (fixedK) {
stop("indMix_fixK() not yet implemented.") # TODO: translate indMix_fixK.m
} else {
indMix(c, npops, verbose)
indMix(c, npops, counts, sumcounts, max_iter, verbose)
}
}