lfmm_pvalues: P-values from lfmm runs

Description Usage Arguments Value Author(s) See Also Examples

Description

Returns a vector of p-values computed from a combination of lfmm runs. For an example, see lfmm.

Usage

1
lfmm.pvalues (object, genomic.control, lambda, K, d, all, run)

Arguments

object

An lfmmProject object.

genomic.control

A Boolean value. If TRUE, the p-values are automatically calibrated using genomic control. If FALSE, the p-values are calculated by rescaling the chi-squared test statistics using the lambda parameter.

lambda

A numeric value. The lambda value is used as inflation factor to rescale the chi-squared statistics in the computation of p-values. This option requires that genomic.control = FALSE. The default value of lambda is equal to 1.0 (no rescaling).

K

An integer value. The number of latent factors used in the model.

d

An integer value. Computes the p-values for the d-th covariable in the model.

all

A Boolean value. Each variable is considered separately (Obscure parameter).

run

An integer vector representing a list of runs to be combined in the computation of p-values (by default, all runs).

Value

pvalues

A vector of combined p-values for each locus.

GIF

The inflation factor value used for correcting the test statistics.

Author(s)

Eric Frichot Olivier Francois

See Also

lfmm.data lfmm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
### Example of analyses using lfmm ###

data("tutorial")
# creation of a genotype file, "genotypes.lfmm".
# The data contain 400 SNPs for 50 individuals.
write.lfmm(tutorial.R, "genotypes.lfmm")
# creation of an environmental variable file, "gradient.env".
# The data contain one environmental variable measured for 50 individuals.
write.env(tutorial.C, "gradients.env")

################
# lfmm runs    #
################

# main options, K: (the number of latent factors), 
#           CPU: the number of CPUs.

# runs with K = 3 and 2 repetitions.
# around 15 seconds per run.
project = NULL
project = lfmm("genotypes.lfmm", "gradients.env", K = 3, repetitions = 2,
    iterations = 6000, burnin = 3000, project = "new")

# get adjusted p-values using the genomic control method
p = lfmm.pvalues(project, K = 3)

hist(p$pvalues, col = "yellow3")

# get adjusted p-values using lambda = 0.6
p = lfmm.pvalues(project, genomic.control = FALSE, 
    lambda = 0.6, K = 3)

hist(p$pvalues, col = "yellow3")

LEA documentation built on Nov. 8, 2020, 8:19 p.m.