Learn R Programming

⚠️There's a newer version (2.8.1) 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 a rewritten and improved version of one part of the paramlink package, which is no longer actively developed. The functionality of paramlink dealing with basic manipulation of pedigrees and markers has been moved to pedtools, in many cases using the same function names. Under the hood, however, many things are changed, including a new S3 class ped for basic pedigree objects and many new utility functions.

Installation

To get pedtools, install from GitHub as follows:

 # First install devtools if needed
if(!require(devtools)) install.packages("devtools")

# Install pedtools from github
devtools::install_github("magnusdv/pedtools")

If you want to include the detailed user manual, you should add the option build_vignettes = TRUE when you install:

devtools::install_github("magnusdv/pedtools", build_vignettes = TRUE)

Then after installation you can view the vignette by running

vignette("pedtools")

Example

We create a pedigree with a consanguineous mating between half siblings. The child has genotype A/B at a SNP marker.

library(pedtools)

x = halfSibPed(sex1 = 1, sex2 = 2)
x = addChildren(x, father = 4, mother = 5, nch = 1)

m = marker(x, "6" = c("A", "B"))
plot(x, m, skip.empty.genotypes = TRUE)

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

707

Version

0.9.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Magnus Vigeland

Last Published

October 11th, 2019

Functions in pedtools (0.9.0)

getAlleles

Allele matrix manipulation
is.ped

Is an object a ped object?
ped_basic

Create simple pedigrees
is.marker

Test if something is a marker
ped

Pedigree construction
mergePed

Merge two pedigrees
mendelianCheck

Check for Mendelian errors
marker

Marker objects
isXmarker

Test if a marker is on the X chromosome
locusAttributes

Get or set locus attributes
getComponent

Pedigree component
ped_modify

Add/remove pedigree members
relabel

Get or modify pedigree labels
sortGenotypes

Sort the alleles in each genotype
ped_subgroups

Pedigree subgroups
inbreedingLoops

Pedigree loops
ped_utils

Pedigree utilities
getSex

Get or modify pedigree genders
marker_attach

Attach markers to pedigrees
nAlleles

Number of marker alleles
ped_complex

Complex pedigree structures
ped_internal

Internal ordering of pedigree members
plot.ped

Plot pedigrees with genotypes
plotPedList

Plot a collection of pedigrees.
randomPed

Random pedigree
nMarkers

The number of markers attached to a pedigree
readPed

Read a pedigree from file
pedtools

pedtools: Tools for working with pedigrees in R
writePed

Write a pedigree to file
getMap

Tabulate marker positions
marker_select

Select or remove attached markers
marker_getset

Get/set marker attributes
print.nucleus

S3 methods
print.ped

Printing pedigrees
transferMarkers

Transfer marker data
validatePed

Pedigree errors
founderInbreeding

Inbreeding coefficients of founders
deprecated

Deprecated functions
as.ped

Conversions to ped objects
as.matrix.ped

Convert ped to matrix
connectedComponents

Connected pedigree components
famid

Family identifier
freqDatabase

Allele frequency database
allowsMutations

Check if a marker allows mutations
as.data.frame.ped

Convert ped to data.frame