Learn R Programming

chopsticks (version 1.36.0)

ibs.stats: function to calculate the identity-by-state stats of a group of samples

Description

Given a snp.matrix-class or a X.snp.matrix-class object with $N$ samples, calculates some statistics about the relatedness of every pair of samples within.

Usage

ibs.stats(x)

Arguments

x
a snp.matrix-class or a X.snp.matrix-class object containing $N$ samples

Value

A data.frame containing $N (N-1)/2$ rows, where the row names are the sample name pairs separated by a comma, and the columns are:
Count
count of identical calls, exclusing no-calls
Fraction
fraction of identical calls comparied to actual calls being made in both samples

Warning

In some applications, it may be preferable to subset a (random) selection of SNPs first - the calculation time increases as $N (N-1) M /2$ . Typically for N = 800 samples and M = 3000 SNPs, the calculation time is about 1 minute. A full GWA scan could take hours, and quite unnecessary for simple applications such as checking for duplicate or related samples.

Details

No-calls are excluded from consideration here.

Examples

Run this code
data(testdata)
result <- ibs.stats(Autosomes[11:20,])
summary(result)

Run the code above in your browser using DataLab