fnr

Inbreeding and Numerator Relationship Coefficients

https://github.com/nilforooshan/fnr

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.4%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Inbreeding and Numerator Relationship Coefficients

Basic Info
  • Host: GitHub
  • Owner: nilforooshan
  • License: gpl-3.0
  • Language: R
  • Default Branch: master
  • Size: 418 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Created about 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog License

README.md

FnR

R-CMD-check cran-version-last-release cran-downloads-total cran-downloads-month cran-downloads-week github-release github-license github-contributors

FnR ("F" stands for inbreeding coefficient and "R" stands for the numerator relationship coefficient) is an R package for the estimation of inbreeding coefficients of animals in the pedigree or their future progeny, and numerator relationship coefficients between pairs of individuals.

Installation

You can install the development version of FnR like so:

r devtools::install_github('nilforooshan/FnR')

Examples

Let's use the following example pedigree.

r (ped <- data.frame( ID = 1:12, SIRE = c(0, 0, 0, 2, 2, 0, 4, 6, 0, 6, 10, 10), DAM = c(0, 0, 0, 1, 1, 0, 3, 5, 7, 8, 9, 0) ))

ID SIRE DAM 1 1 0 0 2 2 0 0 3 3 0 0 4 4 2 1 5 5 2 1 6 6 0 0 7 7 4 3 8 8 6 5 9 9 0 7 10 10 6 8 11 11 10 9 12 12 10 0

Let's assume that previously, 9 of 12 animals were in the pedigree, and inbreeding (f) and d coefficients (diagonal elements of the diagonal matrix D in $\mathbf A = \mathbf{TDT}'$) were calculated and saved.

r oldped <- ped[1:9, ] (oldrun <- resume_inbreed(oldped, export_d = TRUE))

``` $f [1] 0 0 0 0 0 0 0 0 0

$d [1] 1.00 1.00 1.00 0.50 0.50 1.00 0.50 0.50 0.75 ```

Calculating inbreeding coefficients as if f and d coefficients from the previous analysis are not available:

r resume_inbreed(ped)

[1] 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.250000 0.015625 0.000000

Calculating inbreeding coefficients as if f coefficients from the previous analysis are available, but not d coefficients:

r resume_inbreed(ped, f = oldrun$f)

[1] 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.250000 0.015625 0.000000

Calculating inbreeding coefficients as if f and d coefficients from the previous analysis are available:

r resume_inbreed(ped, f = oldrun$f, d = oldrun$d)

[1] 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.250000 0.015625 0.000000

Let's calculate the numerator relationship coefficients between two groups of animals, one's members not among dams, and the members of the other not among sires.

r calcR(ped, set1 = c(12, 6), set2 = c(11, 8), type = "notdam-notsire")

Estimating inbreeding coefficients based on Meuwissen and Luo (1992) Calculating numerator relationship coefficients based on Van Vleck (2007) 11 8 12 0.3203125 0.375 6 0.3750000 0.500

What is the inbreeding coefficient of a future progeny of 11 and 12? It is half of the relationship coefficient between the two individuals (0.320312/2).

Since "notdam-notsire" is the default type, type = "notdam-notsire" might be omitted. Where relationship coefficients between dams and between sires are needed, type = "dam-dam" and type = "sire-sire" are used, respectively.

Let's calculate the numerator relationship coefficients between dam 7 and dams 8 and 9.

r calcR(ped, set1 = 7, set2 = 8:9, type = "dam-dam")

Estimating inbreeding coefficients based on Meuwissen and Luo (1992) Calculating numerator relationship coefficients based on Van Vleck (2007) 8 9 7 0.125 0.5

The relationship coefficients between sires 2 & 6 and sires 4 & 10 are calculated as:

r calcR(ped, set1 = c(2, 6), set2 = c(4, 10), type = "sire-sire")

Estimating inbreeding coefficients based on Meuwissen and Luo (1992) Calculating numerator relationship coefficients based on Van Vleck (2007) 4 10 2 0.5 0.125 6 0.0 0.750

If inbreeding coefficients of the population or previous inbreeding estimates with a smaller pedigree are available, those can be used via the argument f to speed up the procedure. Similarly, if d coefficients are available, those can be used alongside the inbreeding coefficients via the argument d.

r f <- rep(0, 12) f[10] <- 0.25 f[11] <- 0.015625 d <- c(1, 1, 1, 0.5, 0.5, 1, 0.5, 0.5, 0.75, 0.5, 0.4375, 0.6875) calcR(ped, set1 = c(2, 6), set2 = c(4, 10), type = "sire-sire", f = f, d = d)

Estimating inbreeding coefficients based on Meuwissen and Luo (1992) Calculating numerator relationship coefficients based on Van Vleck (2007) 4 10 2 0.5 0.125 6 0.0 0.750

For very large pedigree and small set1 and set2, one may consider extracting a sub-pedigree by tracing the pedigree upward from set1 and set2 (i.e., ggroups::pedup(ped, c(set1, set2))).

Owner

  • Name: Mohammad Ali Nilforooshan
  • Login: nilforooshan
  • Kind: user
  • Location: Hamilton, New Zealand
  • Company: LIC

Quantitative Geneticist

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 541 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: FnR

Inbreeding and Numerator Relationship Coefficients

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 541 Last month
Rankings
Dependent packages count: 27.8%
Forks count: 28.7%
Dependent repos count: 35.7%
Stargazers count: 35.8%
Average: 42.6%
Downloads: 84.9%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • ggroups * imports
  • knitr * suggests
  • rmarkdown * suggests