Title: | Software for Summarising and Evaluating STRUCTURE Output |
---|---|
Description: | Statistical summary of STRUCTURE output. STRUCTURE is a K-means clustering method for inferring population structure and assigning individuals to populations using genetic data. Pritchard JK, Stephens M, Donnelly PJ (2000) <DOI:10.1093/genetics/155.2.945>. <https://web.stanford.edu/group/pritchardlab/structure.html>. |
Authors: | Michael G. Campana <[email protected]> |
Maintainer: | Michael G. Campana <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.6-9 |
Built: | 2025-03-07 04:33:51 UTC |
Source: | https://github.com/campanam/rcorrsieve |
Calculates delta Fst or delta K from the output of summarise.Fst
or summarise.lnPD
.
calc.delta(input, Fst = FALSE)
calc.delta(input, Fst = FALSE)
input |
a table containing Fst or lnPD data generated by |
Fst |
when FALSE, data is lnPD data and calculates delta K. When true, data is Fst data and calculates delta Fst |
Returns a table listing K values and delta F or delta K statistics
Michael G. Campana <[email protected]>
Calculates Q matrix correlations from structure files in the folder specified in the filepath option
corr.Qmatrix(filepath = "./", instruct = FALSE, rowncol = TRUE, avmax = TRUE, pvalue = FALSE, raw = TRUE, r = 0.99, p = 0.05)
corr.Qmatrix(filepath = "./", instruct = FALSE, rowncol = TRUE, avmax = TRUE, pvalue = FALSE, raw = TRUE, r = 0.99, p = 0.05)
filepath |
a character string listing the folder's path from the current directory |
instruct |
when TRUE, data is in INSTRUCT format, else data is in STRUCTURE format |
rowncol |
when TRUE, calculates and returns filtered Q matrix correlations using the rows-and-columns criterion |
avmax |
when TRUE, calculates and returns filtered Q matrix correlations using the average maximum correlation criterion |
pvalue |
when TRUE, calculates and returns Q matrix correlations using permutation tests |
raw |
when TRUE, returns the raw unfiltered Q matrix correlations |
r |
the minimum r value to classify a correlation as significant |
p |
the maximum p value to classify a correlation as significant. Ignored unless pvalue = TRUE |
Returns a S4 object of class QmatrixFilt listing Q matrix correlation results for all STRUCTURE results files in the designated folder
Michael G. Campana <[email protected]>
The S4 class matrixCorr lists raw, unfiltered Q matrices between Structure runs
Objects can be created by calls of the form new("matrixCorr", ...)
.
A numeric listing the K value of the runs correlated
A numeric identifying the first of the runs correlated
A numeric identifying the second of the runs correlated
A matrix listing raw Q matrix correlations
A matrix listing raw Q matrix correlation significances
Michael G. Campana <[email protected]>
Constructor for matrixCorr
objects
matrixCorr(K, Run1, Run2, CorrMatrix, Pvalues = matrix(NA))
matrixCorr(K, Run1, Run2, CorrMatrix, Pvalues = matrix(NA))
K |
A numeric corresponding to the @K slot listing the K value of the runs correlated |
Run1 |
A numeric corresponding to the @Run1 slot identifying the first of the runs correlated |
Run2 |
A numeric corresponding to the @Run2 slot identifying the second of the runs correlated |
CorrMatrix |
A matrix corresponding to the @CorrMatrix slot listing raw Q matrix correlations |
Pvalues |
A matrix corresponding to the @Pvalues slot listing raw Q matrix correlation significances |
Returns a S4 object of class matrixCorr listing raw Q matrix correlation results
Michael G. Campana <[email protected]>
test <- matrixCorr(K = 1, Run1 = 2, Run2 = 3, CorrMatrix = matrix(NA))
test <- matrixCorr(K = 1, Run1 = 2, Run2 = 3, CorrMatrix = matrix(NA))
The S4 class QmatrixFilt lists for Q matrix correlation output
Objects can be created by calls of the form new("QmatrixFilt", ...)
.
A list listing filtered Q matrix correlations by the rows-and-columns method
A table listing filtered Q matrix correlations by the rows-and-columns method
A list listing raw Q matrix correlations
Michael G. Campana <[email protected]>
Constructor for QmatrixFilt
objects
QmatrixFilt(rowncol = list(""), avmaxcorr = as.table(matrix(NA)), rawcorr = list(""))
QmatrixFilt(rowncol = list(""), avmaxcorr = as.table(matrix(NA)), rawcorr = list(""))
rowncol |
A list corresponding to the @rowncol slot listing filtered Q matrix correlations by the rows-and-columns method |
avmaxcorr |
A table corresponding to the @avmaxcorr slot listing filtered Q matrix correlations by the rows-and-columns method |
rawcorr |
A list corresponding to the @rawcorr slot listing raw Q matrix correlations |
Returns a S4 object of class QmatrixFilt listing Q matrix correlation results
Michael G. Campana <[email protected]>
test <- QmatrixFilt(rowncol = list(c("a", "b", "c"))) test@rowncol
test <- QmatrixFilt(rowncol = list(c("a", "b", "c"))) test@rowncol
Reads the K values, Fsts, lnPDs from structure files in the folder specified in the filepath option
read.struct(filepath = "./", instruct = FALSE)
read.struct(filepath = "./", instruct = FALSE)
filepath |
a character string listing the folder's path from the current directory |
instruct |
when TRUE, data is in INSTRUCT format, else data is in STRUCTURE format |
Returns a table listing K values, lnPDs and Fsts for all STRUCTURE results files in the designated folder
Michael G. Campana <[email protected]>
The S4 class RowncolMatrix lists filtered Q matrix output by the row-and-column method
Objects can be created by calls of the form new("rowncolMatrix", ...)
.
A numeric listing the K value of the runs correlated
A table listing filtered Q matrix correlations by the row-and-column method
Michael G. Campana <[email protected]>
Constructor for rowncolMatrix
objects
rowncolMatrix(K, filtermatrix)
rowncolMatrix(K, filtermatrix)
K |
A numeric corresponding to the @K slot listing the K value of the runs correlated |
filtermatrix |
A table corresponding to the @filtermatrix slot listing filtered Q matrix correlations |
Returns a S4 object of class rowncolMatrix listing raw Q matrix correlation results
Michael G. Campana <[email protected]>
## Make a table of correlation determinations filtmat <- table(matrix(c("Y","Y","Y",NA,"Y","Y",NA,NA,"Y"),ncol = 3, byrow = TRUE)) ## Make a rowncolMatrix test <- rowncolMatrix(K = 3, filtermatrix = filtmat)
## Make a table of correlation determinations filtmat <- table(matrix(c("Y","Y","Y",NA,"Y","Y",NA,NA,"Y"),ncol = 3, byrow = TRUE)) ## Make a rowncolMatrix test <- rowncolMatrix(K = 3, filtermatrix = filtmat)
Summarises Fst from structure output read by read.struct
.
summarise.Fst(input, stdevopt = 1)
summarise.Fst(input, stdevopt = 1)
input |
a table containing lnPD Fst generated by |
stdevopt |
Chooses the optimisation procedure for the Fst summaries. 1: no optimisation, 2: order the clusters by value, 3: order the clusters by correlation coefficients |
Returns a table listing K values and summarised Fst statistics
Michael G. Campana <[email protected]>
Summarises lnP(D) from structure output read by read.struct
.
summarise.lnPD(input)
summarise.lnPD(input)
input |
a table containing lnPD data generated by |
Returns a table listing K values and summarised lnPD statistics
Michael G. Campana <[email protected]>