readZscore: Read the output files of 'lfmm'

Description Usage Arguments Value Author(s) See Also Examples

Description

Read the output file from lfmm. This is an internal function. Zscores of a run can be accessed using the function z.scores.

Usage

1
read.zscore(input.file)

Arguments

input.file

a character string containing a path to the output of lfmm.

Value

R

A matrix containing the lfmm results with one line per SNP. The first column is the zscore. The second column is the -log10(p-value). The third column is the p-value.

Author(s)

Eric Frichot

See Also

zscore.format 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
### 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,
        iterations = 6000, burnin = 3000, project = "new")

res = read.zscore("./genotypes_gradients.lfmm/K3/run1/genotypes_r1_s1.3.zscore")

Example output

[1] "genotypes.lfmm"
[1] "gradients.env"
The project is saved into :
 genotypes_gradients.lfmmProject 

To load the project, use:
 project = load.lfmmProject("genotypes_gradients.lfmmProject")

To remove the project, use:
 remove.lfmmProject("genotypes_gradients.lfmmProject")

[1] "********************************"
[1] "* K = 3  repetition 1  d = 1   *"
[1] "********************************"
Summary of the options:

        -n (number of individuals)      50
        -L (number of loci)             400
        -K (number of latent factors)   3
        -o (output file)                genotypes_gradients.lfmm/K3/run1/genotypes_r1
        -i (number of iterations)       6000
        -b (burnin)                     3000
        -s (seed random init)           1386086602
        -p (number of processes (CPU))  1
        -x (genotype file)              genotypes.lfmm
        -v (variable file)              gradients.env
        -D (number of covariables)      1
        -d (the dth covariable)         1

Read variable file:
 	gradients.env		OK.

Read genotype file:
 	genotypes.lfmm		OK.

<<<<
	 Analyse for variable 1

		Start of the Gibbs Sampler algorithm.

	[                                                                           ]
	[===========================================================================]

		End of the Gibbs Sampler algorithm.

	ED:20000.13739	 DIC: 19999.46653 

	The statistics for the run are registered in:
 		genotypes_gradients.lfmm/K3/run1/genotypes_r1_s1.3.dic.

	The zscores for variable 1 are registered in:
 		genotypes_gradients.lfmm/K3/run1/genotypes_r1_s1.3.zscore.
	The columns are: zscores, -log10(p-values), p-values.

	-------------------------
	The execution for variable 1 worked without error.
>>>>

The project is saved into :
 genotypes_gradients.lfmmProject 

To load the project, use:
 project = load.lfmmProject("genotypes_gradients.lfmmProject")

To remove the project, use:
 remove.lfmmProject("genotypes_gradients.lfmmProject")

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