Skip to content

magnusdv/pedtools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

752b571 · Mar 30, 2024
Mar 30, 2024
Nov 5, 2023
Mar 17, 2024
Mar 12, 2024
Mar 17, 2024
Sep 5, 2023
Oct 15, 2022
Mar 30, 2024
Sep 5, 2023
Mar 12, 2024
Mar 30, 2024
Mar 17, 2024
Jan 4, 2023
Jun 23, 2018

Repository files navigation

pedtools

CRAN status

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 feature imports machinery 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.

Try the QuickPed app for building and analysing pedigrees here: https://magnusdv.shinyapps.io/quickped/

Installation

To get pedtools, install from CRAN as follows:

install.packages("pedtools")

Alternatively, fetch the latest development version from GitHub:

devtools::install_github("magnusdv/pedtools")

Example

The following example illustrates a step-by-step creation of a pedigree with a marker object.

library(pedtools)

# Start with two half brothers
x = halfSibPed(type = "paternal")

# Make 5 female
x = swapSex(x, 5)

# Add a sister to 5 (parents are 2 and 3)
x = addDaughter(x, parents = 2:3)

# Add inbred child
x = addSon(x, parents = 4:5)

# Create marker
x = addMarker(x, "7" = "a/b")

# Plot pedigree with genotypes
plot(x, marker = 1, hatched = 7)

The process of building pedigrees is perfectly suited for the pipe operator |> recently introduced in R. For example, the above pedigree could have been created as follows:

x = halfSibPed(type = "paternal") |>
  swapSex(5) |>
  addDaughter(parents = 2:3) |>
  addSon(parents = 4:5) |>
  addMarker("7" = "a/b")

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

About

Tools for working with pedigrees in R

Resources

License

Citation

Stars

Watchers

Forks

Packages

No packages published

Languages