Last data update: 2014.03.03

R: Ancestral allele frequencies from a snmf run
GR Documentation

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.

Author(s)

Eric Frichot

See Also

geno snmf Q cross.entropy

Examples

### 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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LEA)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/LEA/G.Rd_%03d_medium.png", width=480, height=480)
> ### Name: G
> ### Title: Ancestral allele frequencies from a snmf run
> ### Aliases: G
> ### Keywords: snmf
> 
> ### ** Examples
> 
> ### 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")
[1] "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")
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)                    171
        -K (number of ancestral pops)          3
        -x (input file)                        /home/ddbj/DataUpdator-rgm3/target/genotypes.geno
        -q (individual admixture file)         /home/ddbj/DataUpdator-rgm3/target/genotypes.snmf/K3/run1/genotypes_r1.3.Q
        -g (ancestral frequencies file)        /home/ddbj/DataUpdator-rgm3/target/genotypes.snmf/K3/run1/genotypes_r1.3.G
        -i (number max of iterations)          200
        -a (regularization parameter)          10
        -s (seed random init)                  1176334316
        -e (tolerance error)                   1E-05
        -p (number of processes)               1
        - diploid

Error: Unknown element '-48' in the data file: /home/ddbj/DataUpdator-rgm3/target/genotypes.geno.
Error: 
Execution halted