Version: | 1.6-9 |
Date: | 2022-04-28 |
Title: | Software for Summarising and Evaluating STRUCTURE Output |
Author: | Michael G. Campana <campanam@si.edu> |
Maintainer: | Michael G. Campana <campanam@si.edu> |
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. |
License: | GPL (≥ 3) |
Depends: | methods, stats |
URL: | https://github.com/campanam/rCorrSieve |
BugReports: | https://github.com/campanam/rCorrSieve |
Contact: | <campanam@si.edu> |
NeedsCompilation: | no |
Packaged: | 2022-05-02 20:29:42 UTC; michaelcampana |
Repository: | CRAN |
Date/Publication: | 2022-05-02 22:52:30 UTC |
QmatrixFilt
Description
The S4 class QmatrixFilt lists for Q matrix correlation output
Objects from the Class
Objects can be created by calls of the form new("QmatrixFilt", ...)
.
Slots
- rowncol
A list listing filtered Q matrix correlations by the rows-and-columns method
- avmaxcorr
A table listing filtered Q matrix correlations by the rows-and-columns method
- rawcorr
A list listing raw Q matrix correlations
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
QmatrixFilt constructor
Description
Constructor for QmatrixFilt
objects
Usage
QmatrixFilt(rowncol = list(""), avmaxcorr = as.table(matrix(NA)), rawcorr = list(""))
Arguments
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 |
Value
Returns a S4 object of class QmatrixFilt listing Q matrix correlation results
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
Examples
test <- QmatrixFilt(rowncol = list(c("a", "b", "c")))
test@rowncol
Calc.delta
Description
Calculates delta Fst or delta K from the output of summarise.Fst
or summarise.lnPD
.
Usage
calc.delta(input, Fst = FALSE)
Arguments
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 |
Value
Returns a table listing K values and delta F or delta K statistics
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
Corr.Qmatrix
Description
Calculates Q matrix correlations from structure files in the folder specified in the filepath option
Usage
corr.Qmatrix(filepath = "./", instruct = FALSE, rowncol = TRUE,
avmax = TRUE, pvalue = FALSE, raw = TRUE, r = 0.99, p = 0.05)
Arguments
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 |
Value
Returns a S4 object of class QmatrixFilt listing Q matrix correlation results for all STRUCTURE results files in the designated folder
Author(s)
Michael G. Campana <mcampana63@gmail.com>
MatrixCorr
Description
The S4 class matrixCorr lists raw, unfiltered Q matrices between Structure runs
Objects from the Class
Objects can be created by calls of the form new("matrixCorr", ...)
.
Slots
- K
A numeric listing the K value of the runs correlated
- Run1
A numeric identifying the first of the runs correlated
- Run2
A numeric identifying the second of the runs correlated
- CorrMatrix
A matrix listing raw Q matrix correlations
- Pvalues
A matrix listing raw Q matrix correlation significances
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
MatrixCorr constructor
Description
Constructor for matrixCorr
objects
Usage
matrixCorr(K, Run1, Run2, CorrMatrix, Pvalues = matrix(NA))
Arguments
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 |
Value
Returns a S4 object of class matrixCorr listing raw Q matrix correlation results
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
Examples
test <- matrixCorr(K = 1, Run1 = 2, Run2 = 3, CorrMatrix = matrix(NA))
Read.struct
Description
Reads the K values, Fsts, lnPDs from structure files in the folder specified in the filepath option
Usage
read.struct(filepath = "./", instruct = FALSE)
Arguments
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 |
Value
Returns a table listing K values, lnPDs and Fsts for all STRUCTURE results files in the designated folder
Author(s)
Michael G. Campana <mcampana63@gmail.com>
RowncolMatrix
Description
The S4 class RowncolMatrix lists filtered Q matrix output by the row-and-column method
Objects from the Class
Objects can be created by calls of the form new("rowncolMatrix", ...)
.
Slots
- K
A numeric listing the K value of the runs correlated
- filterMatrix
A table listing filtered Q matrix correlations by the row-and-column method
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
RowncolMatrix constructor
Description
Constructor for rowncolMatrix
objects
Usage
rowncolMatrix(K, filtermatrix)
Arguments
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 |
Value
Returns a S4 object of class rowncolMatrix listing raw Q matrix correlation results
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
Examples
## 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)
Summarise.Fst
Description
Summarises Fst from structure output read by read.struct
.
Usage
summarise.Fst(input, stdevopt = 1)
Arguments
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 |
Value
Returns a table listing K values and summarised Fst statistics
Author(s)
Michael G. Campana <mcampana63@gmail.com>
See Also
Summarise.lnPD
Description
Summarises lnP(D) from structure output read by read.struct
.
Usage
summarise.lnPD(input)
Arguments
input |
a table containing lnPD data generated by |
Value
Returns a table listing K values and summarised lnPD statistics
Author(s)
Michael G. Campana <mcampana63@gmail.com>