G: Ancestral allele frequencies from a snmf run

Description Usage Arguments Value Author(s) See Also Examples

Description

Return the snmf output matrix of ancestral allele frequency matrix for the chosen run with K ancestral populations. For an example, see snmf.

Usage

1
G(object, K, run)

Arguments

object

A snmfProject object.

K

The number of ancestral populations.

run

A chosen run.

Value

res

A matrix containing the ancestral allele frequencies for a run with K ancestral populations.

Author(s)

Eric Frichot

See Also

geno snmf Q cross.entropy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
### Example of analyses using snmf ###

# creation of a genotype file: genotypes.geno.
# The data contain 400 SNPs for 50 individuals.
data("tutorial")
write.geno(tutorial.R, "genotypes.geno")

################
# running snmf #
################


# Two runs for K = 1 to 5 
project.snmf = snmf("genotypes.geno", 
                K = 3, 
                repetitions = 2, 
                project = "new")

# get the ancestral genotype frequency matrix, G, for the 2nd run for K = 3. 
freq = G(project.snmf, K = 3, run = 2)

Example output

[1] "genotypes.geno"
The project is saved into :
 genotypes.snmfProject 

To load the project, use:
 project = load.snmfProject("genotypes.snmfProject")

To remove the project, use:
 remove.snmfProject("genotypes.snmfProject")

[1] "*************************************"
[1] "* sNMF K = 3  repetition 1      *"
[1] "*************************************"
summary of the options:

        -n (number of individuals)             50
        -L (number of loci)                    400
        -K (number of ancestral pops)          3
        -x (input file)                        /work/tmp/genotypes.geno
        -q (individual admixture file)         /work/tmp/genotypes.snmf/K3/run1/genotypes_r1.3.Q
        -g (ancestral frequencies file)        /work/tmp/genotypes.snmf/K3/run1/genotypes_r1.3.G
        -i (number max of iterations)          200
        -a (regularization parameter)          10
        -s (seed random init)                  94357744838119
        -e (tolerance error)                   1E-05
        -p (number of processes)               1
        - diploid

Read genotype file /work/tmp/genotypes.geno:		OK.


Main algorithm:
	[                                                                           ]
	[=================================]
Number of iterations: 88

Least-square error: 5655.567011
Write individual ancestry coefficient file /work/tmp/genotypes.snmf/K3/run1/genotypes_r1.3.Q:		OK.
Write ancestral allele frequency coefficient file /work/tmp/genotypes.snmf/K3/run1/genotypes_r1.3.G:	OK.

The project is saved into :
 genotypes.snmfProject 

To load the project, use:
 project = load.snmfProject("genotypes.snmfProject")

To remove the project, use:
 remove.snmfProject("genotypes.snmfProject")

[1] "*************************************"
[1] "* sNMF K = 3  repetition 2      *"
[1] "*************************************"
summary of the options:

        -n (number of individuals)             50
        -L (number of loci)                    400
        -K (number of ancestral pops)          3
        -x (input file)                        /work/tmp/genotypes.geno
        -q (individual admixture file)         /work/tmp/genotypes.snmf/K3/run2/genotypes_r2.3.Q
        -g (ancestral frequencies file)        /work/tmp/genotypes.snmf/K3/run2/genotypes_r2.3.G
        -i (number max of iterations)          200
        -a (regularization parameter)          10
        -s (seed random init)                  1076483116
        -e (tolerance error)                   1E-05
        -p (number of processes)               1
        - diploid

Read genotype file /work/tmp/genotypes.geno:		OK.


Main algorithm:
	[                                                                           ]
	[==================================]
Number of iterations: 92

Least-square error: 5655.566942
Write individual ancestry coefficient file /work/tmp/genotypes.snmf/K3/run2/genotypes_r2.3.Q:		OK.
Write ancestral allele frequency coefficient file /work/tmp/genotypes.snmf/K3/run2/genotypes_r2.3.G:	OK.

The project is saved into :
 genotypes.snmfProject 

To load the project, use:
 project = load.snmfProject("genotypes.snmfProject")

To remove the project, use:
 remove.snmfProject("genotypes.snmfProject")

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