Learn R Programming

⚠️There's a newer version (2.8.0) of this package.Take me there.

pedtools

Introduction

The goal of pedtools is to provide a lightweight, but comprehensive tool set for creating, manipulating and visualizing pedigrees with or without marker data. Common pedigree structures are quickly produced with tailor-made functions, while a range of utilities enable modifications like adding or removing individuals, extracting subsets, loop breaking, and merging pedigrees. The plotting functionality is imported from the kinship2 package.

pedtools is the hub of the ped suite, a collection of R packages for pedigree analysis, including applications in forensic and medical genetics. The ped suite has its own GitHub repository and a dedicated website offering more information.

Installation

To get pedtools, install from CRAN as follows:

install.packages("pedtools")

Alternatively, you can obtain the latest development version from GitHub:

# install.packages("devtools") # install devtools if needed
devtools::install_github("magnusdv/pedtools")

Example

The following example illustrates how pedigrees and markers may be built from scratch.

library(pedtools)

# Create pedigree
x = cousinPed(degree = 0, removal = 2)
x = addChildren(x, father = 3, nch = 2, sex = 2)

# Relabel according to plot order
x = relabel(x, "asPlot")

# Create marker and attach to pedigree
m = marker(x, "7" = "a/b", "11" = "b/b")

# Plot pedigree with genotypes
plot(x, marker = m, hatched = leaves(x))

For details about what pedtools can do, and many other examples, the vignette is the recommended place to start.

Copy Link

Version

Install

install.packages('pedtools')

Monthly Downloads

1,091

Version

1.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Magnus Vigeland

Last Published

December 8th, 2021

Functions in pedtools (1.1.0)

freqDatabase

Allele frequency database
founderInbreeding

Inbreeding coefficients of founders
marker_inplace

Set marker attributes
famid

Family identifier
marker_getattr

Get marker attributes
inbreedingLoops

Pedigree loops
is.marker

Test if something is a marker
ped_utils

Pedigree utilities
pedtools

pedtools: Tools for working with pedigrees in R
getComponent

Pedigree component
writePed

Write a pedigree to file
marker

Marker objects
newMarker

Internal marker constructor
plot.ped

Plot pedigrees with genotypes
getGenotypes

Genotype matrix
newPed

Internal ped constructor
marker_attach

Attach markers to pedigrees
plotPedList

Plot a collection of pedigrees.
marker_select

Select or remove attached markers
marker_prop

Marker properties
ped_complex

Complex pedigree structures
ped_internal

Internal ordering of pedigree members
randomPed

Random pedigree
connectedComponents

Connected pedigree components
as.ped

Conversions to ped objects
readPed

Read a pedigree from file
is.ped

Is an object a ped object?
as.data.frame.ped

Convert ped to data.frame
as.matrix.ped

Convert ped to matrix
nMarkers

The number of markers attached to a pedigree
mergePed

Merge two pedigrees
print.nucleus

S3 methods
locusAttributes

Get or set locus attributes
ped

Pedigree construction
ped_basic

Create simple pedigrees
marker_setattr

Set marker attributes
relabel

Get or modify pedigree labels
transferMarkers

Transfer marker data
print.ped

Printing pedigrees
validatePed

Pedigree errors
mendelianCheck

Check for Mendelian errors
sortGenotypes

Sort the alleles in each genotype
ped_subgroups

Pedigree subgroups
ped_modify

Add/remove pedigree members
getMap

Tabulate marker positions
getSex

Get or set the sex of pedigree members
getAlleles

Allele matrix manipulation