Releases: magnusdv/pedtools
pedtools 2.7.1
New features
-
New function
swapGenotypes()
for swapping the genotypes of two individuals. -
New plot argument
line.main
for title placement. -
cousinPed()
andhalfCousinPed()
gain argumentsymmetric
, which if TRUE gives a symmetric shape when plotted (female line on the left side; male line of the right).
pedtools 2.7.0
New features
-
plot.ped()
gains a new argument,spouseOrder
, to specify the display order of spouses. -
readPed()
andas.ped()
now include aaddMissingFounders
argument, supporting pedigree files where (some or all) founders are not explicitly listed (i.e., entries in thefid
ormid
columns that do not appear in theid
column). -
readPed()
andas.ped()
now also feature asexCodes
argument, accommodating pedigree files where sex is indicated by codes other than the standard 0 (unknown), 1 (male), 2 (female). -
reorderPed()
has improved flexibility, allowing the reordering of a subset of the pedigree. -
selfingPed()
now accepts a vector of ID labels as the first argument. (Previously, only the number of selfings could be given.) -
The plotting argument
showEmpty
, controlling the appearance of missing genotypes, now accepts a function, e.g.leaves()
.
Other changes
-
getComponent()
behaves better when the pedigree has only one component. -
ped()
checks for illegalsex
entries earlier than before, thus avoiding certain (rare) problems. -
Brush up on code and documentation.
pedtools 2.6.0
This is a large release with several new features, including a few (relatively minor) breaking changes.
Breaking changes
-
In pedigree plots, long labels are now automatically folded to an approximate width of 12 characters by default. Use the new argument
foldLabs
to adjust the folding width, or to switch off folding (foldLabs = FALSE
). -
When adding children or parents to a pedigree, the default labelling of new individuals has been simplified. The new labels are now always the smallest integers not already in use. (Previous versions used "NN_1", "NN_2", etc for pedigrees with non-numeric labels.)
-
labels(x)
now always returns a character vector, also whenx
is a list of pedigrees. Uselabels(x, unlist = FALSE)
to retain the old behaviour.
New features
-
addChildren(x, ...)
, and its companionsaddSon()
andaddDaughter()
, now works across components ofx
, whenx
is a list of pedigrees. For instance, this now works as expected:singletons(1:2, sex = 1:2) |> addSon(1:2)
. -
New function
addChild()
is similar toaddSon()
andaddDaughter()
, but allows the sex to be set programmatically, also tosex = 0
. -
plot.ped()
gains argumenttextAnnot
allowing highly customisable text annotations around and inside pedigree symbols. -
ancestors()
,descendants()
,commonAncestors()
andcommonDescendants()
gain a new argumentmaxGen
limiting the analysis to the given number of generations. -
transferMarkers()
gains the argumentcheckAttrs
for checking consistency of marker attributes across pedigree components. -
New function
.setSNPfreqs()
for modifying allele frequencies when all markers are biallelic. (Experimental; not yet exported.)
Bug fixes
-
addSon()
andaddDaughter()
now fail more gracefully if a parent ID is duplicated. -
Fixed regression error in
selectMarkers()
.
pedtools 2.5.0
New features
-
New functions
maskPed()
andunmaskPed()
for anonymising pedigree data, and restoring them. -
New function
setAlleleLabels()
for changing the allele labels of a marker. -
The
.pedScaling()
gains argumentsautoScale
andminsize
. -
readPed()
gains argumentcolSkip
, useful e.g., when reading .ped files with an AFF column. -
The
relabel()
function for relabelling individuals now allows the argumentnew
to be a function, taking theold
labels as input. For instance,relabel(x, toupper)
gives upper-case labels for everyone.
Bug fixes
- Preserve the class attribute of
MARKERS
when subsetting.
pedtools 2.4.0
New features
-
The
plot()
method now handles general (unnested) lists ofped
objects. This means that, for instance, withx = list(nuclearPed(1), cousinPed(1), singleton(1))
, the commandplot(x)
simply works. Previously all ped lists had to be handled byplotPedList()
. (This is still needed for finer control of each component, and with nested lists.) -
nMarkers()
andhasMarkers()
have a new argumentcompwise
for more detailed output for ped lists. -
linearPed(0)
now produces a singleton (instead of an error). -
setAfreq()
now automatically updates the mutation model of the affected marker, if present. -
readFreqDatabase()
now accepts frequency files using the long format of MERLIN. -
readFreqDatabase()
gains a logical argumentscale1
, which, if TRUE, scales all vectors to sum 1.
pedtools 2.3.1
New features
-
New function
singletons()
for creating a list of singletons. -
New S3
summary()
method handling lists of (possibly disconnected) pedigrees. -
setGenotype()
can set the genotype of multiple individuals or markers in the same call. Also, individuals can be specified with selector functions likeleaves()
andfounders()
, as in:nuclearPed() |> addMarker() |> setGenotype(ids = founders, geno = "1/2")
. -
plot.ped()
gains argumenttrimLabs
, defaulting to TRUE, which removes line breaks at the start of ID labels. For example:nuclearPed() |> addMarker(geno = c("a/a", "b/b", NA)) |> plot(marker = 1, labs = "1")
. (Compare withplot(..., trimLabs = F)
.) -
The
showEmpty
argument ofplot.ped()
is more user friendly, allowing for instance:nuclearPed() |> addMarker() |> plot(marker = 1, showEmpty = "1")
. -
readFreqDatabase()
gains an optional argumentdf
, a data frame of allele frequencies in either "list" or "allelic ladder" format. This is useful in cases where the raw data must be read or modified manually for some reason. -
Add CITATION file.
Bug fixes
- Forgotten argument
strict
insetAfreq()
for pedlists. - Fix glitch affecting
textAbove
andtextInside
. - Fix
title
in (still experimental)plot.list()
. - Fixed interpretation of marker names in
setMarkers(x, alleleMatrix)
.
pedtools 2.2.0
New features
-
plot.ped()
gains new argumentsfill
,lty
,lwd
andhatchDensity
. -
The pedprobr function
setMutationModel()
has been moved to pedtools and renamed tosetMutmod()
. Unlike its predecessor, this has a new argumentupdate
, allowing to update existing models (i.e., leaving unspecified parameters unchanged) instead of creating new models from scratch. -
generations()
have been rewritten, with a new parameterwhat
controlling what the function computes: Possible values ofwhat
are "max" (default; return only the number of generations in the pedigree), "compMax" (if pedigree has several components, return the generation number of each), "indiv" (individual generation numbering as in the plot) or "depth" (individual generation numbering defined by length of the longest chain up to a founder). -
In
swapSex()
andsetSex()
, theids
parameter may now be the name of a selector function operating on the input pedigree. This is convenient when piping; for example,x |> setSex(ids = leaves, sex = 0)
sets unknown sex for all leaves ofx
. -
print.ped()
is more pipe-friendly, returning theped
object invisibly (not the data frame, as before). -
addMarker()
gains argumentlocusAttr
.
Bug fixes
-
Fixed a bug in
randomPed()
, which caused the function to run out of mating options sometimes. -
The pedigree plot alignment fails in some cases (see mayoverse/kinship2#13). When this happens the plot method reverts to DAG mode and gives a warning.
pedtools 2.1.1
New features
-
The
plot.ped()
method has been internally refactored into 5 functions. Three of these calculate various parameters:.pedAlignment()
,.pedScaling()
and.pedAnnotation()
. The remaining two,drawPed()
and.annotatePed()
actually draw stuff on the graphics device. As indicated by the dot prefixes, these functions are primarily intended for internal use. Nevertheless, they are documented and exported, to make them available for other packages requiring special plot methods. (For example, the latest version ofibdsim2::haploDraw()
use this to compute automatic margins.) -
The function
randomPed()
has been completely rewritten, ensuring that the output is always a connected pedigree. The new version takes as input the total pedigree size (n) and the number of founders (f). -
removeIndividuals()
gains an argumentremove
, taking as value either "ancestors" or "descendants" (possibly abbreviated. The default value ("descendants") behaves as the previous version. A typical application ofremove = "ancestors"
is to remove founders, as inlinearPed(2) |> removeIndividuals(1, remove = "anc")
. -
Both
relabel()
andremoveIndividuals()
gain an argumentreturnLabs
. If TRUE, the functions return a vector of the pedigree members about to be modified/removed, instead of actually performing any changes. -
Pedigree construction is generally faster, due to various code improvements. Also,
ped()
gains an argumentdetectLoops
, which if set to FALSE may cut runtime significantly in some cases. -
New function
setFounderInbreeding()
, which is more flexible (and pipe friendly!) than the previousfounderInbreeding<-()
. The latter will continue to exist. -
More informative
summary()
for pedigrees.
pedtools 1.3.0
New features
-
New function
avuncularPed()
for creating aunt/uncle - nephew/niece pedigrees. -
New function
addAllele()
for extending the allele set of a marker. -
addSon()
andaddDaughter()
are now more flexible. The previous argumentparent
has been renamed toparents
and accepts one or two parents in any order. -
mergePed()
has been overhauled. In particular the new argumentby
makes it much more user friendly. -
setAfreq()
gains argumentstrict
.
Other
-
Minor improvements of README and vignette.
-
Fixed bug in
setGenotype()
when setting multiple markers. -
Fixed bug ignoring alleles in
distributeMarkers()
.
pedtools 1.2.0
New features
-
pedtools now depends on R 4.1 (or later) because of the pipe operator
|>
. -
New function
setSNPs()
for creating and attaching a set of SNP markers with given positions and allele frequencies. -
New function
distributeMarkers()
for creating and attaching equal markers evenly across a set of chromosomes (by default, the human autosomes). -
New function
halfSibTriangle()
implementing an interesting breeding pattern.
Bug fixes
-
transferMarkers()
now ignores members of unknown sex when checking compatibility. -
Fixed bug in
addMarker()
when input is a list of pedigrees. -
Fixed glitches in
setMap()
.
Other
-
Various improvements in code and docs.
-
Added many tests.
-
Rewrite README example to show piping.