Last data update: 2014.03.03

R: Count alleles identical by state
ibsCountR Documentation

Count alleles identical by state

Description

This function counts, for all pairs of subjects and across all SNPs, the total number of alleles which are identical by state (IBS)

Usage

ibsCount(snps)

Arguments

snps

An input object of class "snp.matrix" or "X.snp.matrix"

Details

For each pair of subjects the function counts the total number of alleles which are IBS. For autosomal SNPs, each locus contributes 4 comparisons, since each subject carries two copies. For SNPs on the X chromosome, the number of comparisons is also 4 for female:female comparisons, but is 2 for female:male and 1 for male:male comparisons.

Value

If there are N rows in the input matrix, the function returns an N*N matrix. The upper triangle contains the total number of comparisons and the lower triangle contains the number of these which are IBS. The diagonal contains the number of valid calls for each subject.

Note

In genome-wide studies, the SNP data will usually be held as a series of objects (of class "snp.matrix" or "X.snp.matrix"), one per chromosome. Note that the matrices produced by applying the ibsCount function to each object in turn can be added to yield the genome-wide result.

Author(s)

David Clayton david.clayton@cimr.cam.ac.uk

See Also

ibsDist which calculates a distance matrix based on proportion of alleles which are IBS

Examples

data(testdata)

ibs.A <- ibsCount(Autosomes[,1:100])
ibs.X <- ibsCount(Xchromosome)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(chopsticks)
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/chopsticks/ibsCount.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ibsCount
> ### Title: Count alleles identical by state
> ### Aliases: ibsCount
> ### Keywords: cluster
> 
> ### ** Examples
> 
> data(testdata)
> ibs.A <- ibsCount(Autosomes[,1:100])
> ibs.X <- ibsCount(Xchromosome)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>