Learn R Programming

relSim (version 1.0.0)

locusIBS: Identity by state at a locus

Description

Calculates the number of alleles that are shared by two profiles at a single locus. If the two profiles in question are indeed relatives then the matching alleles may be identical by descent, or by random chance alone, hence identity by state.

Usage

locusIBS(profMat)

Value

A vector of length N containing values 0, 1, or 2 depending on how many alleles each pair of profiles share at a locus.

Arguments

profMat

A matrix consisting of 4 columns and N rows. Each row in the matrix consists of the genotypes of two individuals.

Author

James M. Curran

Examples

Run this code

data(fbiCaucs)
G = randomSample(1, fbiCaucs, rel = 'FS', N = 1000)
ibs = locusIBS(G)
barplot(tabulate(ibs+1, nbins = 3))

Run the code above in your browser using DataLab