Package 'corrsieve'

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

Help Index


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 summarise.Fst or summarise.lnPD.

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 <[email protected]>

See Also

summarise.Fst summarise.lnPD


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 <[email protected]>


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 <[email protected]>

See Also

matrixCorr


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 <[email protected]>

See Also

matrixCorr

Examples

test <- matrixCorr(K = 1, Run1 = 2, Run2 = 3, CorrMatrix = matrix(NA))

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 <[email protected]>

See Also

QmatrixFilt


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 <[email protected]>

See Also

QmatrixFilt

Examples

test <- QmatrixFilt(rowncol = list(c("a", "b", "c")))
test@rowncol

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 <[email protected]>


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 <[email protected]>

See Also

rowncolMatrix


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 <[email protected]>

See Also

rowncolMatrix

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 read.struct

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 <[email protected]>

See Also

read.struct calc.delta


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 read.struct

Value

Returns a table listing K values and summarised lnPD statistics

Author(s)

Michael G. Campana <[email protected]>

See Also

read.struct calc.delta