The Jacquard package"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
knitr::opts_chunk$set(fig.align = "center")
knitr::opts_chunk$set(warnings = FALSE)
knitr::opts_chunk$set(message = FALSE)
knitr::opts_chunk$set(fig.width = 6, fig.height = 6) 

Introduction

This document explains the basic functionality of the **Jacquard** package which provides functions for the estimation of the nine condensed Jacquard coefficients (@Jacquard) for biallelic genetic marker data using a constrained least squares approach (@Graffelman2024). Outline: 1. [Installation](#installation) 2. [Estimation of the Jacquard coefficients](#coefficients) 3. [Estimation of derived relatedness parameters](#derived) 4. [Alternative estimation procedures](#mom) 5. [References](#refs) ## 1. Installation The package can be installed from CRAN with the instructions wzxhzdk:1 ## 2. Estimation of Jacquard the coefficients We illustrate the estimation of the Jacquard coefficients using (0,1,2) coded genotype data available in the data set `SimulatedPedigree`, of which we show a small part wzxhzdk:2 This matrix contains `r formatC(nrow(SimulatedPedigree), digits=0, format = "f")` individuals, spanning seven generations, in its rows and pedigree information plus genotype data of 20,000 SNPs in its columns. We first separate the pedigree information from the genotype information. wzxhzdk:3 We next determine the nine joint genotype counts for all pairs of individuals, storing these counts in a list object with nine lower triangular matrices, using function `JointGenotypeCounts`. For efficiency, we here load the precalculated joint counts. wzxhzdk:4 E.g., the counts of the major homozygote pairs for the first five individuals are wzxhzdk:5 We create a vector with the minor allele frequency of each SNP. wzxhzdk:6 We proceed to estimate the Jacquard coefficients by constrained least squares with function `Jacquard.cls`. For the sake of illustration, we take the first three founders of the pedigree, and subset their joint genotype counts wzxhzdk:7 We set random initial values for the Jacquard coefficients wzxhzdk:8 And estimate the pairwise Jacquard coefficients of the three pairs. wzxhzdk:9 Convergence of the solver can be checked by looking at the field `convergence`, where 0 indicates proper convergence. wzxhzdk:10 Particular estimates of Jacquard coefficients can be extracted from the `Delta.cls` list object, which is a list of nine matrices. E.g., $\Delta_9$ of the first pair of individuals (1,2) can be extracted by wzxhzdk:11 All nine estimates of the Jacquard coefficients can be obtained with function `DeltaPair` wzxhzdk:12 A pairwise list of the nine Jacquard coefficients of each pair can be obtained with the function `PairwiseList`. wzxhzdk:13 The full set of all pairwise Jacquard coefficients can be calculated with the instructions below. This result is also available in the precalculated data object `DeltaSimulatedPedigree`. wzxhzdk:14 Boxplots of the estimated Jacquard coefficients can be obtained with function `BoxplotDelta`. Separate boxplots are shown for the diagonals of $\Delta_1$ and $\Delta_7$. wzxhzdk:15 ## 3. Estimation of derived relatedness parameters The set of five identifiable relatedness parameters dicussed by @Csuros, among them coancestry and inbreeding coefficients, can be calculated with the function `CalculateTheta`. wzxhzdk:16 E.g., estimates of the kinship coefficients of the first five (founder) individuals are obtained by wzxhzdk:17 Individual inbreeding coefficients can be obtained from ... wzxhzdk:18 Boxplots of identifiable relatedness parameters can be made with `BoxplotTheta` wzxhzdk:19 ## 4. Alternative estimation procedures There are many estimators for coancestry and inbreeding. Function `CalculateThetaMom` calculates moment estimators for the five identifiable relatedness parameters defined by @Csuros. wzxhzdk:20 E.g., moment estimators of the kinship coefficients of the first five individuals are given by wzxhzdk:21

5. References



Try the Jacquard package in your browser

Any scripts or data that you put into this service are public.

Jacquard documentation built on Sept. 17, 2024, 5:09 p.m.