ibs.db: Counts IBS alleles between case profile and all database...

Description Usage Arguments Details Value See Also Examples

Description

Counts IBS alleles between case profile and all database profiles

Usage

1
ibs.db(x, db)

Arguments

x

case profile

db

database of profiles

Details

A profile consists of two alleles at each locus. When two profiles are compared at a locus, there can be 0, 1 or 2 alleles IBS (identical by state). The function compares a single profile with a database of N profiles and counts the number of IBS alleles.

Value

Data frame with three columns

  1. ibs: the number of alleles IBS of x and a db profile, ranges from 0 to 2*nloci

  2. full.matches: the number of loci for which 2 alleles are IBS, ranges from 0 to nloci

  3. partial.matches: the number of loci for which 1 allele is IBS, ranges from 0 to nloci

See Also

ibs.pairs for comparing many profile pairs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## monte-carlo simulation of number of IBS alleles for FS, PO and UN w.r.t a single case profile

data(freqsNLsgmplus)

#start with a single case profile
x <- sample.profiles(N=1,freqs=freqsNLsgmplus)

# sample siblings
x.fs <- sample.relatives(x,N=10^3,type="FS")
# sample parent/offspring
x.po <- sample.relatives(x,N=10^3,type="PO")
# sample unrelated profiles
x.unr <- sample.profiles(N=10^3,freqs=freqsNLsgmplus)

# make histograms of the number of ibs alleles
hist(ibs.db(x,x.fs)$ibs,xlim=c(0,20),main="FS",xlab="IBS")
hist(ibs.db(x,x.po)$ibs,xlim=c(0,20),main="PO",xlab="IBS")
hist(ibs.db(x,x.unr)$ibs,xlim=c(0,20),main="UN",xlab="IBS")

DNAprofiles documentation built on Jan. 15, 2017, 9:27 p.m.