Learn R Programming

LEA (version 1.4.0)

G: Ancestral allele frequencies from a snmf run

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

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 the chosen run with K ancestral populations.

See Also

geno snmf Q cross.entropy

Examples

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

# creation of the genotype file, genotypes.geno.
# It contains 400 SNPs for 50 individuals.
data("tutorial")
write.geno(tutorial.R, "genotypes.geno")

################
# runs of snmf #
################

# main options, K: (the number of ancestral populations), 
#        entropy: calculate the cross-entropy criterion, 
#        CPU: the number of CPUs.

# Runs with K between 1 and 5 with cross-entropy and 2 repetitions.
project = NULL
project = snmf("genotypes.geno", K = 3, repetitions = 2, project = "new")

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

Run the code above in your browser using DataLab