switch.alleles {snpMatrix} | R Documentation

## Switch alleles in columns of a snp.matrix or in test results

### Description

This is a generic function which can be applied to objects of class `"snp.matrix"` or `"X.snp.matrix"` (which hold SNP genotype data), or to objects of class `"snp.tests.single.score"` or `"snp.tests.glm"` (which hold association test results). In the former case, specified SNPs can be recoded as if the alleles were switched (so that AA genotypes become BB and vice-versa while AB remain unchanged). In the latter case, test results are modified as if alleles had been switched.

### Usage

    switch.alleles(x, snps)

### Arguments

`x` | The input object, of class `"snp.matrix"`, `"X.snp.matrix"`, `"snp.tests.single.score"`, or `"snp.tests.glm"`
`snps` | A vector of type integer, character or logical specifying the SNP to have its alleles switched

### Value

An object of the same class as the input object

### Note

Switching alleles for SNPs has no effect on test results. These functions are required when carrying out meta-analysis, bringing together several sets of results. It is then important that alleles line up in the datasets to be combined. It is often more convenient (and faster) to apply this process to the test result objects rather than to the genotype data themselves.

### Author(s)

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

### See Also

`snp.matrix-class`, `X.snp.matrix-class`, `snp.tests.single-class`, `snp.tests.glm-class`

### Examples

    library(snpMatrix)
    data(testdata)
    which <-  c("173774", "173811")
    Asw <- switch.alleles(Autosomes, which)
    summary(Autosomes)[which,]
    summary(Asw)[which,]

[Package snpMatrix version 1.6.1 Index]