Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sm.compare

Compare two SnpMatrix objects


Description

For quality control purposes, it is sometimes necessary to compare genotype data derived from different sources. This function facilitates this.

Usage

sm.compare(obj1, obj2, row.wise = TRUE, col.wise = TRUE)

Arguments

obj1

The first of the two SnpMatrix objects to be compared

obj2

The second SnpMatrix object

row.wise

Calculate comparison statistics aggregated in a row-wise manner

col.wise

Calculate column-wise comparison statistics

Details

Initially row and column names of the two objects are compared to identify subsets of subjects and SNPs which they have in common. Then, every instance of a SNP genotype in the two objects are compared and agreements and disagreements counted by row and/or by column.

Value

If only one of the row-wise and column-wise summaries are to be calculated, the return value is a matrix with rows defined by subjects or SNPs and columns giving counts of:

Agree

Agreements (all)

Disagree

Disgreements (all)

NA.agree

Genotype coded NA in both objects

NA.disagree

Genotype coded NA in only one object

Hom.agree

Objects agree and genotype is homozygous

Hom.switch

Genotype coded as homozygous in both objects, but alleles switched

Het.agree

Genotype coded as heterozygous in both objects

Het.Hom

Genotype coded as heterozygous in one object and homozygous in the other

If both row-wise and column-wise summaries are computed (the default behaviour) , the function returns a list containing two matrices of the form described above. These are named row.wise and col.wise

Note

No special provision is yet made for objects of class XSnpMatrix, in which haploid calls are coded as homozygous.

Author(s)

David Clayton dc208@cam.ac.uk

See Also

Examples

##
## No example yet available
##

snpStats

SnpMatrix and XSnpMatrix classes and methods

v1.40.0
GPL-3
Authors
David Clayton <dc208@cam.ac.uk>
Initial release
2019-10-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.