Description Usage Arguments Value Examples
View source: R/flexible_cfdr.R
parameters_in_locfdr
1 2 3 4 5 6 7 8 9 10 | parameters_in_locfdr(
p,
q,
indep_index,
res_p = 300,
res_q = 500,
maf = NULL,
check_indep_cor = TRUE,
enforce_p_q_cor = TRUE
)
|
p |
p values for principal trait (vector of length n) |
q |
continuous auxiliary data values (vector of length n) |
indep_index |
indices of independent SNPs |
res_p |
resolution for p |
res_q |
resolution for q |
maf |
minor allele frequencies for SNPs to which |
check_indep_cor |
check that sign of the correlation between |
enforce_p_q_cor |
if |
list of values used as input into locfdr::locfdr
function intrinsically in flexible_cfdr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # In this example, we generate some p-values (representing GWAS p-values)
# and some arbitrary auxiliary data values (e.g. representing functional genomic data).
# We use the parameters_in_locfdr() function to extract the parameters estimated by
# the locfdr function.
# generate p
set.seed(1)
n <- 1000
n1p <- 50
zp <- c(rnorm(n1p, sd=5), rnorm(n-n1p, sd=1))
p <- 2*pnorm(-abs(zp))
# generate q
mixture_comp1 <- function(x) rnorm(x, mean = -0.5, sd = 0.5)
mixture_comp2 <- function(x) rnorm(x, mean = 2, sd = 1)
q <- c(mixture_comp1(n1p), mixture_comp2(n-n1p))
n_indep <- n
parameters_in_locfdr(p, q, indep_index = 1:n_indep)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.