knitr::opts_chunk$set(echo = FALSE, 
                      fig.align = "center",
                      dpi = 300,
                      collapse = TRUE,
                      comment = "#>")

::: { .greeting .message style="color: red; font-size: large;"} Try QuickPed here: https://magnusdv.shinyapps.io/quickped. :::

::: { .greeting .message style="color: orange; font-size: large;"} Paper in BMC Bioinformatics: https://doi.org/10.1186/s12859-022-04759-y. :::


What is QuickPed?

QuickPed is an interactive web application for drawing and analysing pedigrees. A created pedigree may be saved as an image or as a text file in ped format (see below). You may also obtain various information about the pedigree, including relatedness coefficients and verbal descriptions of relationships.

QuickPed is powered by the pedsuite and uses kinship2 for alignment calculations. The web app was built with Shiny.

Drawing pedigrees

Creating pedigrees with QuickPed is very intuitive: Select a suitable start pedigree and modify it as needed. You may also load an existing ped file (see below). Modifications are done by clicking on one or several individuals and then applying appropriate buttons, for instance to add children, siblings or parents. At any time you may change attributes like sex, affection status, twin status and ID labels.

Tips and tricks

Built-in pedigrees

In the left-most panel of QuickPed the user may choose among a selection of standard pedigrees, including trios, full/half siblings, avuncular and cousin pedigrees of different kinds. Also included are a variety of more complex pedigree structures like double cousins and quad half first cousins.

Finally, the following historic pedigrees are available:

Ped files

A useful feature of QuickPed is to produce text files describing pedigrees in so-called ped format. Such files are often required by software for pedigree analysis.

For a simple illustration, consider this pedigree:

df = data.frame(id = 1:3, fid = c(0,0,1), mid = c(0,0,2), sex = c(1,2,2), aff = c(1,1,2))
x = pedtools::as.ped(df[1:4])
plot(x, aff = which(df$aff == 2), margins = 0.5)

A text file describing this pedigree may contain the following.

print(df, row.names = F)

The columns are:

It should be noted that the ped format is not completely standardised, and different software may use slightly different versions. For example, a first column with Family ID is sometimes required. Also, the aff column may not be needed in non-medical applications. These and other details may be specified when using QuickPed.

Some pedigree information may be shown on the plot, but is not stored in the ped file. In the current version of QuickPed, this includes twin relationships, carrier status and deceased status.

Relatedness analysis

Overview

Under Relationships there are four buttons offering different analyses of relationships within the loaded pedigree. The buttons are, in order:

Coefficients of relatedness

QuickPed calculates a variety of different relatedness coefficients, which we briefly review here for convenience. For more details we recommend e.g. Thompson's book Statistical Inference from Genetic Data on Pedigrees or Lange's book Mathematical and Statistical Methods for Genetic Analysis.

For a given pedigree with members $A$ and $B$ we define the following:

A brief recap of identity states

Following Jacquard (1974) and subsequent authors, the 4 alleles carried by individuals $A$ and $B$ at an autosomal locus, can be drawn as dots in a square diagram:

knitr::include_graphics("jacquardSquare.png")

An identity state is a pattern of IBD between the alleles, represented by line segments connecting the alleles.

Detailed states

In total there are 15 possible patterns of IBD between 4 alleles. These are called the detailed identity states, and are shown below in the order used by QuickPed.

knitr::include_graphics("identity-states-detailed.png")

Condensed states

In most applications the paternal/maternal origin of alleles does not matter. The 15 detailed states are then reduced to 9, known as the condensed identity states:

knitr::include_graphics("identity-states-condensed.png")

X-chromosomal identity coefficients

X-chromosomal identity states and their coefficients are less studied than the autosomal ones, and there are fewer conventions regarding their order and how to draw them. The presentation here does not claim superiority over others; its main purpose is to act as a reference for understanding the output of QuickPed.

As in the autosomal case, the identity coefficients on X are the expected proportions of the possible IBD states involving the alleles at a random locus (on X). The challenge is that the set of states depends on the sex of the two individuals: F/F, F/M, M/F or M/M (where F = female and M = male).

Males are hemizygous on X, with only one allele at each locus (except in a few so-called pseudo-autosomal regions, which we ignore here). Hence, for pairs of individuals including a male, the total number of alleles is less than 4. However, to avoid having to memorise new states for each sex combination, we may re-use the autosomal pictograms by invoking a simple rule: Given an X-chromosomal identity state, replace any hemizygous allele with a pair of autozygous alleles. This rule guides the following table, which shows how to interpret the condensed X-chromosomal coefficients returned by QuickPed. The first row, corresponding to two females, is identical to the autosomal case.

knitr::include_graphics("identity-states-condensed-X.png")

In a similar fashion, the states corresponding to the detailed X-chromosomal coefficients, are as follows:

knitr::include_graphics("identity-states-detailed-X.png")

Note that for hemizygous males, the single allele is drawn on the right side, since it is maternally inherited. It should also be noted that QuickPed always outputs the same number of coefficients (9 condensed; 15 detailed), regardless of sex, but with NAs in all positions corresponding to undefined states.



magnusdv/pedsuite documentation built on Sept. 28, 2024, 1:21 a.m.