tess3Main
estimates spatial population structure using a graph based non
negative matrix factorization. After estimating the population structure is used to
compute a Fst statistic for each locus. See references for more details.
tess3Main(X, XProba = NULL, coord, K, ploidy, lambda = 1, W = NULL, method = "projected.ls", max.iteration = 200, tolerance = 1e-05, openMP.core.num = 1, Q.init = NULL, mask = 0, copy = TRUE, algo.copy = TRUE, verbose = FALSE)
X | a numeric matrix which corresponds to the genotype matrix. This matrix
must be of size \(n \times L\) where \(n\) is the number of individuals and
\(L\) is the number of loci. Values of this matrix are integers corresponding
to the number of variant alleles observed at a locus. If |
---|---|
XProba | a numeric matrix which corresponds to genotype likelihoods (probabilities).
This matrix must be of size \(n \times (ploidy + 1)L\) where
\(n\) is the number of individuals and \(L\) is the number of loci. Entries of
this matrix are numeric values between 0 and 1 corresponding
to genotype probability. If |
coord | a numeric matrix of size \(n \times 2\) where \(n\) is the number of individuals. It contains the geographic coordinates (Longitude, Latitude) of all sampled individuals. |
K | an integer corresponding to the number of ancestral populations. |
ploidy | an integer which corresponds to the ploidy of the number of copy of chromosomes. |
lambda | a nonnegative numeric which corresponds to the spatial regularization parameter. |
W | a numeric matrix which corresponds to the graph weight matrix.
If |
method |
|
max.iteration | the maximum number of iterations in the optimization algorithm. |
tolerance | a numeric value which corresponds to the tolerance paramter in the stopping criterion of the optimization algorithm. |
openMP.core.num | number of core used by the algorithm. It requires that openMP is installed. |
Q.init | a numeric matrix which corresponds to the initial value of
|
mask | if not |
copy | if TRUE data will be copied once. |
algo.copy | if TRUE, data will be copied in order to speed the algorithm. |
verbose | If |
An object of class tess3Main which is a list with the following attributes:
the number of loci
the number of individuals
the number of copies of chromosomes.
the number of ancestral populations.
the ancestral genotype frequency matrix.
the ancestry coefficient matrix.
Fst statistic computed at each locus.
Fscores computed from the Fst statistics.
pvalues computed from the Fscores.
The \(log(pvalue)\).
root square mean error between XProba
and
tcrossprod(Q, G)
.
cross-entropy error between XProba
and
tcrossprod(Q, G)
.
if masked is not NULL
, root square mean error
between XProba[masked]
and tcrossprod(Q, G)[masked]
.
if masked not NULL
,
the cross-entropy error between XProba[masked]
and
tcrossprod(Q, G)[masked]
.
https://hal.archives-ouvertes.fr/hal-01222555/ http://biorxiv.org/content/early/2016/10/12/080291
library(tess3r) # Arabidopsis thaliana data set data(data.at) genotype <- data.at$X coordinates <- data.at$coord # Run of tess3 main algorithm tess3.obj <- tess3Main(X = genotype, coord = coordinates, K = 3, method = "projected.ls", ploidy = 1)#> == Computing spectral decomposition of graph laplacian matrix: done #> ==Main loop with 1 threads: done# Run of tess3 main algorithm with cross validation errors computation. tess3.obj <- tess3Main(X = genotype, coord = coordinates, K = 3, method = "projected.ls", ploidy = 1, mask = 0.05)#> == Computing spectral decomposition of graph laplacian matrix: done #> ==Main loop with 1 threads: done