Description Details Author(s) References See Also Examples
Provides functions for calculating relatedness from codominant genetic data using any or all of seven estimators, and includes options for considering inbreeding and genotyping errors, and can estimate 95
Package: | related |
Type: | Package |
Version: | 0.7 |
Date: | 2014-03-03 |
License: | GPL (>=2) |
A complete walk-through of the package and available options are available as a tutorial vignette, accessible from the CRAN website.
Important functions are summarized below.
=== READING DATA INTO R ===
Genotype data can be read into R using the readgenotypedata
function. This will create an R data frame of the genotype data, and an R object with all of the allele frequency data, in a format appropriate for subsequent analyses. The genotype file should have one column of individual identifiers and then 2 columns for each locus (one for each allele). No other columns are allowed. Missing data should be formatted as zeros ("0"). The file should NOT contain a header row.
=== ESTIMATING RELATEDNESS ===
Pairwise relatedness can be estimated, based on 7 different estimators, using the coancestry
function. The input is a data frame of genotypes, as generated by the readgenotypedata
function. Relatedness estimation can include point estimates, 95% confidence intervals, inbreeding, and genotyping errors. The output will include a data frame of pairwise estimates, and separate data frames with data pertaining to confidence intervals and inbreeding coefficients, if selected.
===CONDUCTING SIMULATIONS ===
Simulations can be conducted in two different ways. First, users can generate simulated individuals of known relatedness (parent-offspring, full-sib, half-sib, and unrelated), based on their allele frequency data, to assess how much resolution they can expect with the characteristics of their data. This can be done using the familysim
function, which takes the allele frequency object generated by the readgenotypedata
function, as well as a whole number indicating the number of pairs to simulate for each relatedness value, as arguments. Pairwise relatedness can then be estimated for these simulated individuals using the coancestry
function. This will generate relatedness values for all pairs of individuals. However, we are only interested in the relatedness of specific pairs (i.e., those representing known relatedness values). Therefore, these results can be cleaned up using the cleanuprvals
function. The results will be a data frame of relatedness values of all simulated pairs of known relatedness, which can be subsequently analyzed or visualized using other R functions.
Second, users may want to know what relatedness estimator will perform best, given the characteristics of their data. We have created a function, called compareestimators
, that will: (1) create simulated individuals of known relatedness from your allele frequency file; (2) calculate relatedness using the 4 most commonly used estimators; and (3) create a box plot using the ggplot2
package so that the performance of each can be readily compared.
Original Fortran code: Jinliang Wang\ R code and functions: Jack Pew and Tim Frasier
Maintainer: Tim Frasier <timothy.frasier@smu.ca>
Pew J, Muir P, Wang J, Frasier TR (in prep) related: an R package for analyzing pairwise relatedness data based on codominant molecular markers.
Wang J (2011) COANCESTRY: a program for simulting, estimating and analysing relatedness and inbreeding coefficients. Molecular Ecology Resources 11: 141-145.
cleanuprvals
, coancestry
, compareestimators
, familysim
, readgenotypedata
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
data(GenotypeData)
#---Read data into R---#
input <- readgenotypedata(GenotypeData)
#---Compare relatedness estimators---#
compareestimators(input, 100)
#---Estimate relatedness---#
rel <- coancestry(input$gdata, lynchli=1, lynchrd=1, quellergt=1, wang=1)
#---Create simulated individuals of known relatedness---#
sim <- familysim(input$freqs, 100)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.