Part I

General concepts and formulas

Q1. What is heredity?

  • Process responsible for the similarity between parents and offspring

    Q2. What is Closed population?

  • A population is said to be closed when the individuals within it only reproduce without the contribution of foreign breeders.

  • It is a population whose variations in numbers are subject only to births and deaths. There is therefore no emigration or immigration.

    Q3. What is pen population?

  • A population is said to be open if the introduction of external breeders is permittedGenotype frequency

Genotype frequency

  • Genotype (unvisible) RR RB BB

  • Phenotype (visible) Red Spotted White

  • The genotype frequency is the relative frequency of a genotype within a given population

  • To compute the genotypic frequency, we use the following formula

    n=900
    N=1500
    f_RR = n/N
    f_RR
    ## [1] 0.6

Gene frequency

Gene frequency:

The frequency of an allele in relation to all the alleles present in a population is referred to as gene frequency

numerator <- (2 * 900) + (1 * 450) + (0 * 150)

denominator <- 2 * (900 + 450 + 150)

R <- numerator / denominator

R
## [1] 0.75

In a simply way, the genetic frequency is the sum of the genotypic frequency of homozygotes and half that of heterozygotes.

  • 1. f (R) = f (RR) + 1 /2 f (RB)

    1. f (B) = f (BB) + 1 /2 f (RB)

Hardy-Weinberg law

Definition In an ideal population, gene and genotype frequencies remain constant from generation to generation and are linked by the relationship of Hardy-Weinber equilibrium. Ideal population:

A population is said to be ideal if the following conditions apply:

1 Infinite population size

2 Panmixie

3 Absence of migration

4 Absence of mutation

5 No genetic drift

Definition Given p and q the genic frequencies of alleles A1 and A2 in the parental generation, the genotypes A1A1, A1A2 and A2A2 appear in the filial generation with the ratio p2 : 2pq : q2 with p2 + 2pq + q2 = 1

Inbreeding coefficient

Definition

An individual is inbreed if his parents are related or if they have a common ancestor If the two parents are not related, the descendant will not be inbreed even if one or both parents are themselves inbreed

If one or both parents are unknown, it is conventionally assumed that the individual is not inbreed

The inbreeding coefficient of an individual Z, noted FZ is the probability that two genes at a given locus are identical per descendant

It varies from 0 (no inbreeding) to 1 (self-fertilisation or reproduction between clones)

How to minimize inbreeding

The best way to minimize inbreeding in herds is

  • to record the pedigree of the animals,

  • avoid matings between related animals and use artificial insemination where possible

  • it is especially recommended to avoid matings that result in an inbreeding coefficient of more than 15-20% in the offspring

# Check if the file exists
if (file.exists("inbreed_dataaa.csv")) {
  data <- read.csv("inbreed_dataaa.csv", header = TRUE)
  head(data)  # Display the first few rows to verify
} else {
  message("Error: File 'inbreed_dataaa.csv' not found in the working directory: ", getwd())
}
##   id father mother sex
## 1  1      0      0   1
## 2  2      0      0   2
## 3  3      1      2   1
## 4  4      3      2   1
## Construct and plot the pedigree
library(kinship2)
## Loading required package: Matrix
## Loading required package: quadprog
ped <- pedigree(data$id,data$father,data$mother,data$sex)
par(mar = c(1, 1, 1, 1))  # Smaller margins (bottom, left, top, right)
plot(ped, cex = 0.5)

plot(ped)

## Inbreeding coefficient
### Create a simple pedigree data frame
pedigree_data <- data.frame(
  sire = c(NA, NA, 1, 3),  # Father IDs (NA for no father)
  dam = c(NA, NA, 2, 2),  # Mother IDs (NA for no mother)
  label= 1:4
)
### Create a pedigree object using the kinship2 package
library(pedigreemm)
## Loading required package: lme4
## 
## Attaching package: 'pedigreemm'
## The following object is masked from 'package:kinship2':
## 
##     pedigree
ped <- pedigree(sire = pedigree_data$sire,
                dam = pedigree_data$dam, label=pedigree_data$label)
## Calculate inbreeding coefficients

inbreeding_coeffs <- inbreeding(ped)
print(inbreeding_coeffs)
## [1] 0.00 0.00 0.00 0.25
## Additive genetic relation
getA(ped)
## 'as(<dtTMatrix>, "dtCMatrix")' is deprecated.
## Use 'as(., "CsparseMatrix")' instead.
## See help("Deprecated") and help("Matrix-deprecated").
## 4 x 4 sparse Matrix of class "dsCMatrix"
##      1    2    3    4
## 1 1.00 .    0.50 0.25
## 2 .    1.00 0.50 0.75
## 3 0.50 0.50 1.00 0.75
## 4 0.25 0.75 0.75 1.25

Interpretation

Interpretation of both the inbreeding coefficients and the additive genetic relationship matrix ( A matrix).

0.00 0.00 0.00 0.25

This result tells you the inbreeding coefficient (F) for each individual in your pedigree.

Individual 1 : 0.00 → No inbreeding.

Individual 2 : 0.00 → No inbreeding.

Individual 3 : 0.00 → No inbreeding.

Individual 4 : 0.25 → 25% inbred , meaning there’s a 25% probability that two alleles at any locus are identical by descent (due to common ancestry of parents).

1 2 3 4

1 1.00 . 0.50 0.25

2 . 1.00 0.50 0.75

3 0.50 0.50 1.00 0.75

4 0.25 0.75 0.75 1.25

Diagonal elements :

Individual 1, 2, 3: 1.00 → F = 0 (1 + 0 = 1)

Individual 4: 1.25 → F = 0.25 (1 + 0.25 = 1.25)

Off-diagonal elements :

Value represents twice the kinship coefficient .

For example:

A[1,3] = 0.50→ Kinship between 1 & 3 = 0.25 → Possibly a parent-offspring or half-sibling relationship.

A[2,4] = 0.75→ Kinship = 0.375 → Indicates a very close relationship , likely parent-offspring with inbreeding or full siblings with a shared inbred parent.

END OF PEDIGREE AND INBREEDING