LEA (version 1.4.0)

p.values: p-values from a lfmm run

Description

Return the lfmm output matrix of p-values for the chosen runs with K latent factors, the d-th variable and the all option. For an example, see lfmm.

Usage

p.values (object, K, d, all, run)

Arguments

object
A lfmmProject object.
K
The number of latent factors.
d
The d-th variable.
all
A Boolean option. If true, the run with all variables at the same time. If false, the runs with each variable separately.
run
A list of chosen runs.

Value

res
A matrix containing a vector of p.values for the chosen runs per column.

See Also

lfmm.data lfmm mlog10p.values adjusted.pvalues z.scores

Examples

Run this code
### Example of analyses using lfmm ###

data("tutorial")
# creation of the genotype file, genotypes.lfmm.
# It contains 400 SNPs for 50 individuals.
write.lfmm(tutorial.R, "genotypes.lfmm")
# creation of the environment file, gradient.env.
# It contains 1 environmental variable for 40 individuals.
write.env(tutorial.C, "gradients.env")

################
# runs of lfmm #
################

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

# Toy 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 the p-values for all runs for K = 3
p = p.values(project, K = 3)

# get the p-values for the 2nd run for K = 3
p = p.values(project, K = 3, run = 2)

Run the code above in your browser using DataLab