Description Usage Arguments Value Note Author(s) See Also Examples
This is a generic function which can be applied to objects of class
"SnpMatrix"
or "XSnpMatrix"
(which hold SNP genotype
data), or to objects of class
"SingleSnpTestsScore"
or "GlmTests"
(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.
1 | switch.alleles(x, snps)
|
x |
The input object, of class |
snps |
A vector of type integer, character or logical specifying the SNP to have its alleles switched |
An object of the same class as the input object
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.
David Clayton dc208@cam.ac.uk
SnpMatrix-class
,
XSnpMatrix-class
,
SingleSnpTests-class
,
GlmTests-class
1 2 3 4 5 | data(testdata)
which <- c("173774", "173811")
Asw <- switch.alleles(Autosomes, which)
col.summary(Autosomes[,which])
col.summary(Asw[,which])
|
Loading required package: survival
Loading required package: Matrix
Calls Call.rate Certain.calls RAF MAF P.AA P.AB
173774 388 0.9797980 1 0.8569588 0.1430412 0.03092784 0.2242268
173811 343 0.8661616 1 0.1545190 0.1545190 0.71428571 0.2623907
P.BB z.HWE
173774 0.74484536 -1.6819712
173811 0.02332362 0.0783225
Warning message:
In col.summary(Autosomes[, which]) :
4 rows were empty - ignored when calculating call rates
Calls Call.rate Certain.calls RAF MAF P.AA P.AB
173774 388 0.9797980 1 0.1430412 0.1430412 0.74484536 0.2242268
173811 343 0.8661616 1 0.8454810 0.1545190 0.02332362 0.2623907
P.BB z.HWE
173774 0.03092784 -1.6819712
173811 0.71428571 0.0783225
Warning message:
In col.summary(Asw[, which]) :
4 rows were empty - ignored when calculating call rates
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.