qmatrix: Get Q matrix estimate

Description Usage Arguments Value See Also Examples

View source: R/getter.R

Description

Get the Q ancestry coefficient matrix computed by the tess3 function.

Usage

1
qmatrix(tess3, K, rep = "best")

Arguments

tess3

a tess3 object.

K

number of ancestral populations.

rep

an integer indicating which run to display (default = lowest error run).

Value

a Q matrix of ancestry coefficients from a specified run.

See Also

tess3 barplot.tess3Q plot.tess3Q CreatePalette

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(tess3r)

# load Arabidopsis data
data(data.at)

# Running tess3
obj <- tess3(data.at$X, coord = data.at$coord, K = 5,
                 ploidy = 1, method = "projected.ls", openMP.core.num = 4)

# Get the ancestry matrix
Q.matrix <- qmatrix(obj, K = 5)

# Plot the barplot
barplot(Q.matrix, border = NA, space = 0, xlab = "Individuals",
        ylab = "Ancestry proportions", main = "Ancestry matrix") -> bp
axis(1, at = 1:nrow(Q.matrix), labels = bp$order, las = 3, cex.axis = .4)

cayek/TESS3_encho_sen documentation built on July 3, 2017, 4:26 p.m.