All doc examples are now run (all used to be “dontrun”).
Other minor non-code changes for first CRAN submission.
plotPopkin now allows NULL elements in input list x, makes empty plots with titles (good for placeholders or other non-existent data)
Clarified plotPopkin documentation (that marPad is added to xMar values if set)
README.md now contains instructions for installing from CRAN as well as from GitHub.
Now the popkin
function preserves the individual names if they are present in the input genotype matrix. These names get copied to the rows and columns of the output kinship matrix.
Converted the vignette from PDF to HTML
inbrDiag
-> inbr_diag
neff
-> n_eff
plotPopkin
-> plot_popkin
rescalePopkin
-> rescale_popkin
weightsSubpops
-> weights_subpops
plot_popkin
).plotPopkin
retains the older argument names.inbr_diag
now accepts lists of kinship matrices to transform (for easier plotting of multiple matrices).plot_popkin
now requires its non-NULL inputs to be proper kinship matrices. Previously, the code used to somewhat allow for non-square matrices to be visualized, but this case had no guarantees to work. The code is cleaner under the assumption of symmetric square matrices.validate_kinship
, mean_kinship
plot_popkin
bug fixes and enhancements!
plot_popkin
now resets graphical parameters when done and after every panel as needed.
NULL
(default) for subsequent panels, the original margins were not reset (instead, the last values were incorrectly propagated).par
values) is now reset after plotting is complete.plot_popkin
option panel_letters
(default is A-Z, so the default remains to not show letters for a single panel).leg_cex
option to plot_popkin
.popkin
function the deprecated parameter names lociOnCols
and memLim
alongside the new names, to prevent breaking existing code (generate warnings).inbr_diag
now handles NULL
inputs correctly (preserves them as NULL
without throwing errors).plot_popkin
has a new logical option null_panel_data
, to change behavior in the presence of NULL
kinship matrices (whether they must or must not have titles and other parameters).
NULL
panelssolve_m_mem_lim
, which generalizes previous behavior to estimate chunk sizes (in number of loci) given a limited memory and number of individuals for various numbers of matrices (of dimensions (m,n) or (n,n)) and vectors (lengths m or n). This function is shared with related projects (such as popkinsuppl
on GitHub).solve_m_mem_lim
always returns integer chunk sizes (number of loci). Previously the function returned non-integers only if the total matrix size m
was not provided.solve_m_mem_lim
in other dependent packages. In particular, the internal function get_mem_lim_m
was removed.popkin
function accepts the new parameter mem_factor
.plot_popkin
updates:
labs_even = TRUE
were not placed correctly. The error was most evident for very small samples (i.e. n = 3
individuals), and was imperceptible otherwise (i.e. n = 100
or more).diag_line = TRUE
did not extend fully to extremes. This error was again most evident for very small samples, and was imperceptible otherwise.weights
option, to change width of every individual to highlight individuals with more weight.raster
option, equivalent to useRaster
option in the image
function used internally. If weights
are not NULL
, raster
is forced to FALSE
(required for image
to work in this setting). So its only use is to set it when weights
are null, as needed.Memory control bugfixes
solve_m_mem_lim
now returns memory limit from get_mem_lim
or user, in addition to the chunk size in both number of loci and in expected memory usage.Other enhancements
n_eff
function now ensures output n_eff
estimates are in the theoretically valid range of [ 1, 2*n ]. Numerical issues in small and noisy kinship matrix estimates could lead to out-of-bounds estimates, which are now replaced with their closest boundary values.plot_popkin
, added option names_las
plot_popkin_single
:
kinship_range
to agree with the default of plot_popkin
when a single kinship matrix is plotted (as a result, default colors now agree in that case too).breaks
is now invisible.plot_popkin
are visible, differences are only noticeable calling this internal function plot_popkin_single
directly.Improvements to function plot_popkin
:
leg_per_panel
, which if true allows each kinship panel to have a different scale (each gets its own legend/color key).leg_*
options to be able to take on different values per panel.leg_width
to control the width of the legend panels. Increased the default width of this legend/color key (from 0.1 to 0.3, as a fraction of the width of the kinship panels), which changes the behavior in the original case when this legend is shared across kinship panels. Now the full legend fits in the panel, without needing an outer margin to the right.leg_mar
behavior changed. Now leg_mar
can be a scalar, which sets the right margin of the legend panel. New default is leg_mar = 3
, again necessary so the label of the legend fits in the panel. Previous behaviors of leg_mar = NULL
and a full margin specification are retained.More improvements to function plot_popkin
:
oma
, which sets outer margins via par(oma)
but provides additional useful shortcuts and defaults. This changes the default behavior of plot_popkin
by setting the left outer margin to 1.5 (all other values are zero), whereas before plot_popkin
did not set any outer margins. This new default behavior makes the “Individuals” outer label appear automatically in plots (whereas before, simply calling plot_popkin
without setting outer margins resulted in this outer-margin y-axis label being hidden from view).mar
to accept various shortcuts (scalar values set only bottom and left margin, whereas the second value of a vector of length 2 sets the top margin, which is otherwise zero; in these two cases the right margin is zero). Default behavior remains to not change existing margins.inbrDiag
, neff
, plotPopkin
, rescalePopkin
, weightsSubpops
.
popkin
function: lociOnCols
, memLim
.class
usage now that matrices return a two-element array in R-devel (required by CRAN).calc_leg_width_min
internal function, though it is unfinished and unused.man/figures/