-
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
.
-
Minor improvements of README and vignette.
-
Fixed bug in
setGenotype()
when setting multiple markers. -
Fixed bug ignoring alleles in
distributeMarkers()
.
-
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.
-
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()
.
-
Various improvements in code and docs.
-
Added many tests.
-
Rewrite README example to show piping.
The main theme of this version is to make pedtools
more adapted to piping, e.g., allowing chains of commands like nuclearPed() |> addSon(1) |> addMarker(alleles = 1:2)
.
-
New functions
setAfreq()
,setChrom()
,setGenotype()
,setMarkername()
,setPosition()
for modifying marker attributes. These are alternatives to the previous in-place modifiersafreq<-()
a.s.o.. -
New function
addMarker()
which simplifies that common task of creating and attaching a single marker. The commandaddMarker(x, ...)
is equivalent toaddMarkers(x, marker(x, ...))
. -
The new
addMarker()
accepts ped lists, so that one can write e.g.list(singleton(1), singleton(2)) |> addMarker("1" = "a/b", alleles = c("a", "b"))
-
readPed()
gains the argumentcolSep
, which fixes the previous inability to handle names with spaces. -
New function
descentPaths()
, mostly intended for use in other ped suite packages. -
relabel(x, new = "generations")
now gives automatic, generation-aware labelling: I-1, I-2, II-1, ... -
generations()
gains argumentmaxOnly
, by default TRUE. If FALSE, the function returns the generation number of each individual.
-
New function
generations()
for counting generations in pedigrees. -
New function
newMarker()
(mostly for internal use). -
plot.ped()
gains a new parametertwins
. -
father()
andmother()
now accepts ped lists as input. -
Added info and links to ped suite in README.
-
Fixed bug in
getGenotypes()
affecting pedigrees with numerical labels. -
Fixed bug in
doubleCousins()
.
- The rarely-used function
cousins()
(not to be confused withcousinPed()
) is temporarily retracted, since it did not work as intended.
-
New constructor
newPed()
(mainly for internal use). -
New function
foundersFirst()
, moved from the ribd package. -
In
addChildren()
, unspecifiednch
is now allowed, and defaults tolength(ids)
orlength(sex)
. -
transferMarkers()
has a new argumentcheckSex()
, and has been made more efficient by skipping redundant validation steps. -
The functions
swapSex()
,alleles()
andinternalID()
now work for lists of pedigrees. -
getComponent()
gained a new argumenterrorIfUnknown()
.
-
unrelated()
andsiblings()
have been improved and cleaned of bugs. -
Fixed an obscure bug in
plot.singleton()
.
-
getMap(na.action = 1)
is re-implemented and now behaves slightly differently. (This was necessary to improve the handling of linked markers inpedprobr::merlin()
.) -
The order of individuals in
linearPed()
now always follows the "asPlot" pattern, as for the other basic pedigrees. (Missed this in the previous version.)
-
plot.ped()
gains argumentstextInside
,textAbove
andcarrier
. -
transferMarkers()
has new argumentsfromIds
andtoIds
enabling transfer between differently-named individuals. -
In
setMarkers()
and friends, the shortcutlocusAttributes = "snp-12"
may be used to indicate that all supplied markers are SNPs with alleles 1 and 2. Further shortcuts are "snp-ab" and "snp-AB". -
setMap()
is extended to ped lists.
-
Built-in pedigree structures are now labelled according to default plotting order. In particular, this means that pedigrees made by
halfSibPed()
,cousinPed()
andhalfCousinPed()
are ordered differently than before. -
In
plot.ped()
, the parameterskipEmptyGenotypes
is replaced byshowEmpty
, with default valueFALSE
. -
Function
xxxFrequencyDatabase()
have been renamed toxxxFreqDatabase()
-
The marker attribute
posCm
has been removed, to avoid confusion with the physical position. -
marker()
now checks for duplicated allele labels. -
setMarkers()
now checks for duplicated marker names (and allele labels, throughmarker()
; see previous point).
-
readPed()
and friends now automatically recognises allele separator "/" when genotypes are written like "a/b". Other separators must be indicated withsep
as before, e.g.,readPed(..., sep = ",")
. -
New function
getGenotypes()
, which is similar togetAlleles()
, but returns a matrix of genotypes written as "a/b". -
More flexible conversion of pedigrees to data frames, with new arguments
sep
andmissing
inas.data.frame.ped()
. -
New function
setMap()
, facilitating setting chromosome and physical position attributes. -
marker()
has a new argumentgeno
, allowing commands likemarker(nuclearPed(1), geno = c("a/a", NA, "a/b"))
. -
print.marker()
has been overhauled and gives a more coherent output. -
halfSibPed()
has a new argumenttype
, either "paternal" (default) or "maternal". -
reorderPed()
by default orders by numerical value, if all labels are numeric. -
plot.ped()
has a new argumenthint
, which is forwarded tokinship2::plot.pedigree()
. This is necessary in some cases where the automatic plotting fails to give a nice pedigree. An example is given in?plot.ped
. -
plot.ped()
gains argumenthatched
, which will eventually replaceshaded
. -
Added default values allows executing
singleton()
andnuclearPed()
with no input. -
Parts of
plotPedList()
have been restructured. In particular, the new argumentgroups
makes it easier to control grouping and frames. Previous argumentframetitles
has been renamed totitles
, because it also works without frames.
-
The
plot.ped()
argumentid.labels
is now deprecated in favour of the newlabs
. This works almost as before, with some exceptions documented here. Thelabs
argument should be thought of as who should be labelled rather than what are the labels. For example, withx = singleton(1)
, the previousplot(x, id.labels = "2")
would rename the singleton to "2". In contrast,plot(x, labs = "2")
will not show any label (sincex
doesn't have a member named "2"). In generalintersect(labs, labels(x))
determines who gets a label.Another change is that if
labs
is a function, it is now applied to the pedigreex
, not tolabels(x)
. This makes it very easy to apply standard pedigree functions likefemales()
,nonfounders()
andtypedMembers()
, since they can be referred to simply by name:plot(x, labs = females)
. -
The implementation of
doubleCousins()
is improved, and some edge cases smoothed out, but the final ordering of individuals may be different in some cases now. -
writePed()
has been partially rewritten, to make it more similar toreadPed()
. By default, only the "ped" file is written. New logical arguments "famid" and "header" provide further control of this file.Writing files in merlin format (indicated by
merlin = TRUE
) is internally now done in a separate function. This option is rarely needed by end users, but is called by e.g.pedprobr::likelihoodMerlin()
.
-
Genotype assignment in
marker()
is more user-friendly now, allowing inputs likemarker(singleton("s"), s = "A/B")
. Previously, heterozygous genotypes had to be provided allele-wise, e.g.,marker(singleton("s"), s = c("A", "B"))
. The character "/" must be used as allele separator and will always be interpreted as such.
Given the simplicity of the new syntax I recommend that homozygous genotypes are also written out fully, e.g.s = "B/B"
instead of the previous (but still functional)s = "B"
. -
New functions
commonAncestors()
andcommonDescendants()
for finding common ancestors/descendants of members in a pedigree. -
The functions
ancestors()
anddescendants()
have a new logical argument,inclusive
, indicating if the person itself should be included. -
New function
setSex()
. This is inverse togetSex()
in the sense thatsetSex(x, sex = getSex(x, named = T))
is identical tox
, whetherx
is a singleped
object or a list of such (with unique ID labels).
The oldswapSex()
is often more convenient in practise, since it automatically deals with spouses. One situation wheresetSex()
is the only option, is when one wants to assign unknown sex (sex = 0
) to someone. -
New function
setMap()
, which can be used for assigning chromosome and position attributes to marker objects.
-
New function
readFrequencyDatabase()
reads databases. Both list formats and allelic ladders are supported. -
Marker attributes "chrom" and "name" are now easier to get/set in ped lists.
-
The
relabel()
function now also works for ped lists.
-
relabel()
now works correctly in pedigrees with broken loops -
mendelianCheck()
didn't always print as intended
- The
labels()
function now also works for ped lists (returning a list of vectors).
- The previous version of
getSex()
was buggy; this has been rewritten and made more efficient.
-
New functions for extracting marker properties:
emptyMarkers()
andnTyped()
. These are generic, with methods formarker
,ped
andlist
. -
The functions
allowsMutations()
,isXmarker()
andnAlleles()
are now generic, with methods formarker
,ped
andlist
. -
plot.ped()
now accepts functional forms of the argumentsid.labels
,shaded
andstarred
. This simplifies certain plotting tasks, allowing calls likeplot(cousinPed(1), shaded = founders, starred = leaves)
. -
mutmod<-()
now allows to set the same mutation model for multiple markers in one call. -
Many utility functions now operate not only on single pedigrees but also on lists of pedigrees. These include
chrom()
,name()
,selectMarkers()
,setMarkers()
,typedMembers()
anduntypedMembers()
, -
selectMarkers()
and friends now accepts boolean marker selection, meaning that themarkers
argument may be a logical vector (of length equal to the number of attached markers).
readPed()
is now more careful regarding marker names. In particular, it should now preserve all names exactly as given, and raise an error if encountering duplicated names.
- Initial CRAN release.