It should be OK for Z to be NULL. This currently triggers an issue on initialCounts(), which should be fixed
This commit is contained in:
parent
372891fbe1
commit
177685b6a2
1 changed files with 11 additions and 13 deletions
24
R/indMix.R
24
R/indMix.R
|
|
@ -88,20 +88,18 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d
|
||||||
}
|
}
|
||||||
ninds <- size(rows, 1)
|
ninds <- size(rows, 1)
|
||||||
|
|
||||||
if (!is.null(Z)) {
|
initialPartition <- admixture_initialization(initData, npops, Z)
|
||||||
initialPartition <- admixture_initialization(initData, npops, Z)
|
sumcounts_counts_logml <- initialCounts(
|
||||||
sumcounts_counts_logml <- initialCounts(
|
initialPartition, data, npops, rows, noalle, adjprior
|
||||||
initialPartition, data, npops, rows, noalle, adjprior
|
)
|
||||||
)
|
sumcounts <- sumcounts_counts_logml$sumcounts
|
||||||
sumcounts <- sumcounts_counts_logml$sumcounts
|
counts <- sumcounts_counts_logml$counts
|
||||||
counts <- sumcounts_counts_logml$counts
|
logml <- sumcounts_counts_logml$logml
|
||||||
logml <- sumcounts_counts_logml$logml
|
|
||||||
|
|
||||||
PARTITION <- zeros(ninds, 1)
|
PARTITION <- zeros(ninds, 1)
|
||||||
for (i in seq_len(ninds)) {
|
for (i in seq_len(ninds)) {
|
||||||
apu <- rows[i]
|
apu <- rows[i]
|
||||||
PARTITION[i] <- initialPartition[apu[1]]
|
PARTITION[i] <- initialPartition[apu[1]]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COUNTS <- counts
|
COUNTS <- counts
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue