Skip to content

Commit

Permalink
Partial reversion of b034158 (#25)
Browse files Browse the repository at this point in the history
It should be OK for Z to be NULL. This currently triggers an issue on initialCounts(), which should be fixed
  • Loading branch information
wleoncio committed Aug 11, 2023
1 parent 372891f commit 177685b
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions R/indMix.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,18 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d
}
ninds <- size(rows, 1)

if (!is.null(Z)) {
initialPartition <- admixture_initialization(initData, npops, Z)
sumcounts_counts_logml <- initialCounts(
initialPartition, data, npops, rows, noalle, adjprior
)
sumcounts <- sumcounts_counts_logml$sumcounts
counts <- sumcounts_counts_logml$counts
logml <- sumcounts_counts_logml$logml

PARTITION <- zeros(ninds, 1)
for (i in seq_len(ninds)) {
apu <- rows[i]
PARTITION[i] <- initialPartition[apu[1]]
}
initialPartition <- admixture_initialization(initData, npops, Z)
sumcounts_counts_logml <- initialCounts(
initialPartition, data, npops, rows, noalle, adjprior
)
sumcounts <- sumcounts_counts_logml$sumcounts
counts <- sumcounts_counts_logml$counts
logml <- sumcounts_counts_logml$logml

PARTITION <- zeros(ninds, 1)
for (i in seq_len(ninds)) {
apu <- rows[i]
PARTITION[i] <- initialPartition[apu[1]]
}

COUNTS <- counts
Expand Down

0 comments on commit 177685b

Please sign in to comment.