p.exact.binary: Exact p-values for genome-wide association analysis of...

Description Usage Arguments Value Note Author(s) References See Also Examples

Description

The function imports GenABEL (gwaa.data class) data format and calculates the exact dataset-specific p-values of a case-control phenotype for each variant or a given odds ratio and allele frequency.

Usage

1
2
3
p.exact.binary(pheno, gwaa.object, or = NULL, or.maf = NULL,
  low.maf = 0.05, high.ld = 1, method = "logOR", type = "two-sided",
  con.table = NULL)

Arguments

pheno

A string that gives the binary phenotype name in gwaa.object or a vector that gives phenotypic values match the order in gwaa.object.

gwaa.object

An object of gwaa.data-class to be analyzed.

or

An (optional) vector gives the odds ratios to be tested, and or.maf must also be given if not testing for the whole genome.

or.maf

An (optional) vector gives the minor allele frequencies in accordance with or, must be used together with or. If or.maf or or is missing, exact p-values will be calculated for the whole genome.

low.maf

A numeric value that gives the cut-off of the lowest minor allele frequency allowed in the analysis.

high.ld

A numeric value that gives the cut-off of the highest linkage disequilibrium R-square allowed in the analysis, i.e. LD pruning.

method

A string tells the method used, currently only "logOR" is available.

type

A string tells the statistical test type, can be 'one-sided' or 'two-sided'.

con.table

Genome-wide contingency tables. If NULL, to be calculated based on data. If a string tells the file name, load from the file or to be calculated and saved into the file. If an R matrix, regard as genome-wide contingency tables (see the saved R object for the format).

Value

The function returns a data frame of exact p-values ($p.exact) and corresponding odds ratios $or and MAFs $MAF.

Note

None.

Author(s)

Xia Shen

References

Xia Shen (2015). Flaw or discovery? Calculating exact p-values for genome-wide association studies in inbred populations. Submitted.

See Also

ccfast, glm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
## loading example gwaa.data of data from Atwell et al. (2010) Nature
data(arab)

## running a regular GWA analysis for AvrRPM1
cc1 <- ccfast('X33_.i.avrRpm1..i.', data = arab)

## check the top finding using the exact p-value
## con.table is calculated when running the first time
## rerunning for checking other markers will be fast
top <- which.min(cc1[,'P1df'])
ctab <- table(phdata(arab)$X33_.i.avrRpm1..i., as.double(arab[,top]))
ctab[ctab == 0] <- ctab[ctab == 0] + .5
or <- ctab[1,1]*ctab[2,2]/ctab[2,1]/ctab[1,2]
f <- summary(arab[,top])$Q.2
maf <- min(f, 1 - f)
exact <- p.exact.binary(pheno = 'X33_.i.avrRpm1..i.', gwaa.object = arab,
         or = or, or.maf = maf, con.table = 'tab.AvrRPM1.RData')

## End(Not run)

p.exact documentation built on May 2, 2019, 6:10 p.m.