Description Usage Arguments Value Author(s) See Also Examples
Return the lfmm
output matrix of zscores for the chosen runs with K
latent factors, the d-th variable and the all option. For an example, see
lfmm
.
1 | z.scores (object, K, d, all, run)
|
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. |
res |
A matrix containing a vector of z-scores for the chosen runs per column. |
Eric Frichot
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 | ### 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 z-scores for all runs for K = 3
z = z.scores(project, K = 3)
# get the z-scores for the 2nd run for K =3
z = z.scores(project, K = 3, run = 2)
# remove
remove.lfmmProject("genotypes_gradients.lfmmProject")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.