gapit2mashr: Convert GAPIT output to mashr input dataframes.

Description Usage Arguments Value Note Examples

Description

This function converts GAPIT output, saved as csv files to some path in the user's files, to four dataframes used in the R package mashr.

Usage

1
2
gapit2mashr(path = ".", phenotypes = NA, numSNPs = 1000,
  model = "CMLM", S_hat = c("Hedges' G", "ones"), saveoutput = FALSE)

Arguments

path

File path to the csv files that GAPIT has created, a character string. Defaults to the working directory.

phenotypes

A character vector of phenotype names used in GAPIT. If NA, will find these from the GAPIT Results files found in the path.

numSNPs

The number of most significant SNPs selected from each GWAS. Ideally this will give 1 million or fewer total cells in the resultant mash dataframes. Defaults to 1000. For most purposes this is far too few.

model

Model type used in GAPIT runs, a character string. Defaults to "CMLM".

S_hat

One of c("Hedge's G", "ones"). If too many standard errors have not been estimated in GAPIT, how should NA's be replaced? The default is to estimate standard errors using Hedges' G, which... (Hedges, Olkin 1985).

saveoutput

Logical. Should the function's output also be saved to RDS files?

Value

A list of the SNPs selected, and B_hat and S_hat matrices for your strong SNP set and a random SNP set of the same size.

Note

Hedges' g (Hedges & Olkin 1985 p. 86) is used here to calculate S_hat, or the standard error in the effect size difference between the reference and alternate allele, because it allows the calculation of both the effect size of the alternate allele, and the confidence interval around the effect size. This function uses the effect sizes provided by GAPIT to compute the confidence interval calculation. The calculations are: d = 2r/sqrt(1-r^2) d_unbiased = (1-(3/(4*(N-2)-1)))*d sigma^2_d_i = (n_i^e + n_i^c)/n_i^e*n_i^c + d_i^2 / 2*(n_i^e + n_i^c) where r is the effect size, scaled between -1 and 1; n's are the sample sizes of the two experimental groups; N is the total sample size.

To create a vector of phenotype names, use the gapit_phenotypes_in_folder function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: gapit2mashr(path = system.file("inst/extdata"), numSNPs = 20,
    S_hat = "Hedges' G")
## End(Not run)
## Not run: gapit2mashr(numSNPs = 10000, S_hat = "Hedges' G")
## Not run: gapit2mashr(numSNPs = 20000, S_hat = "Hedges' G", saveoutput = TRUE)
## Not run: phenotype_vector <- gapit_phenotypes_in_folder(path = system.file(
    "inst/extdata"))
## End(Not run)
## Not run: gapit2mashr(phenotypes = phenotype_vector, numSNPs = 5000,
S_hat = "Hedges' G", saveoutput = TRUE)
## End(Not run)

Alice-MacQueen/gapit2mashr documentation built on May 9, 2019, 2:32 p.m.