Added option noFixed
to function rbnpsd
to redraw loci that were drawn fixed for a single allele. These loci are not polymorphic so they would normally not be considered in analyses.
Added function fixed_loci
to test for fixed loci within rbnpsd.
coanc_to_kinship
to easily obtain kinship matrices from coancestry matrices.qis
now returns a numeric admixture proportions matrix (used to be logical).q1d
and q1dc
now handle sigma = 0
special case.q1d
and q1dc
now provide more informative out-of-bounds messages when sigma
is missing (and s
is provided)sigma
root finding in q1d
and q1dc
(when s
is provided) is now more robust, explicitly tested at boundaries (min s > 0
achieved at sigma = 0
and max s = 1
achieved at sigma = Inf
).
interval
and tol
from both q1d
and q1dc
(users would never need to set them now that procedure is more robust).coanc
-> coanc_admix
q1d
-> admix_prop_1d_linear
q1dc
-> admix_prop_1d_circular
qis
-> admix_prop_indep_subpops
rpanc
-> draw_p_anc
rpint
-> draw_p_subpops
rpiaf
-> make_p_ind_admix
rgeno
-> draw_genotypes_admix
rbnpsd
-> draw_all_admix
fst
-> fst_admix
(no deprecated version available in this case, to eliminate conflict with popkin::fst
)Q
-> admix_proportions
F
-> coanc_subpops
(if general matrix is accepted), inbr_subpops
(vector or scalar versions required)s
-> bias_coeff
w
-> weights
Theta
-> coancestry
m
-> m_loci
n
-> n_ind
k
-> k_subpops
pAnc
-> p_anc
B
-> p_subpops
P
-> p_ind
sigma = 0
bug in admix_prop_1d_circular
.draw_all_admix
(compared to deprecated rbnpsd
, which retains old defaults):
require_polymorphic_loci
(old noFixed
) is now TRUE
by default.want_p_ind
and want_p_subpops
(old wantP
and wantB
) are now FALSE
by default.draw_p_subpops
now admits scalar inputs p_anc
and inbr_subpops
, while number of loci and number of subpopulations can be provided as additional options.coanc_subpops
) or if the diagonal matrix case is required (specified as vector or scalar inbr_subpops
).admix_prop_1d_circular
) to prevent overlapping individuals on the edges, and to better agree visually with the linear version (admix_prop_1d_linear
).draw_genotypes_admix
low_mem
option could be set but filled slowly by locus only.draw_all_admix
is also now automatically low-memory whenever want_p_ind = FALSE
, and the explicit low_mem
option has also been removed.beta
in function draw_p_anc
to trigger a symmetric Beta distribution for the ancestral allele frequencies, with the desired shape parameter. The beta
option can also be set on the wrapper function draw_all_admix
. This option allows simulation of a distribution heavier on rare variants (when beta
is much smaller than 1), more similar to real human data.q1dc
, q1d
, qis
, coanc
, rbnpsd
, rgeno
, rpanc
, rpint
, rpiaf
.man/figures/
bias_coeff_admix_fit
, which caused it to die if the desired bias coefficient was an extreme value (particularly 1
). The error message was: f() values at end points not of opposite sign
. The actual bug was not observed in the regular R build, but rather in a limited precision setting where R was configured with --disable-long-double
.