Learn R Programming

snQTL (version 0.2)

single_exp_to_snQTL_stats: Generate one single snQTL test statistics from expression data

Description

Generate one single snQTL test statistics from a given list of expression data. This function takes a list of expression data, the choice of test statistics, the choice to permute or not, the choice of considering trans-correlation or not, and other computational tuning parameters as inputs. Outputs include the calculated statistics, recall of the choices, and the decomposition components associated with the statistics.

Usage

single_exp_to_snQTL_stats(
  seed = NULL,
  permute = FALSE,
  exp_list,
  method = c("sum", "sum_square", "max", "tensor"),
  rho = 1000,
  sumabs = 0.2,
  niter = 20,
  trace = FALSE,
  adj.beta = -1,
  tensor_iter = 20,
  tensor_tol = 10^(-3),
  trans = FALSE,
  location = NULL
)

Value

a list containing the following:

method

character, recall of the choice of test statistics

permute

logic variable, recall of the choice of permutation

stats

number, the calculated test statistics with given expression list and choices

decomp_result

list, if method = c("sum", "sum_square", "max"), the matrix decomposition components for all pairwise differential networks are recorded; if method = "tensor", the tensor decomposition components for the differential tensor are recorded

Arguments

seed

number, the random seed to shuffle the expression data if permute = TRUE and for SSTD() initialization if method = "tensor"

permute

logic variable, whether to shuffle the samples in expression data; see "details"

exp_list

list, a list of expression data from samples with different genotypes; see "details"

method

character, the choice of test statistics (see net_to_stats())

rho

number, a large positive constant adding to the diagonal elements to ensure positive definiteness in symmetric matrix spectral decomposition

sumabs

number, the number specify the sparsity level in the matrix/tensor eigenvector; sumabs takes value between \(1/sqrt(p)\) and 1, where \(p\) is the dimension; sumabs\(*sqrt(p)\) is the upperbound of the L1 norm of the leading matrix/tensor eigenvector (see symmPMD())

niter

integer, the number of iterations to use in the PMD algorithm (see symmPMD())

trace

logic variable, whether to trace the progress of PMD algorithm (see symmPMD())

adj.beta

number, the power transformation to the correlation matrices (see getDiffMatrix()); particularly, when adj.beta=0, the correlation matrix is used, when adj.beta<0, the covariance matrix is used.

tensor_iter

integer, the maximal number of iteration in SSTD algorithm (see max_iter in SSTD())

tensor_tol

number, a small positive constant for error difference to indicate the SSTD convergence (see tol in SSTD())

trans

logic variable, whether to only consider the trans-correlation (between genes from two different chromosomes or regions); see "details"

location

vector, the (chromosome) locations for genes if trans = TRUE

Details

In exp_list, the dimensions for data matrices are n1-by-p, n2-by-p, and n3-by-p, respectively. The expression data is usually normalized. We use expression data to generate the Pearson's correlation co-expression networks.

If permute = TRUE, we shuffle the samples in three expression matrices while keeping the same dimensions. The test statistics from randomly shuffled data are considered as the statistics from null distribution.

If trans = TRUE, we only consider the trans-correlation between the genes from two different chromosomes or regions in co-expression networks. The entries in correlation matrices \(N_{ij} = 0\) if gene i and gene j are from the same chromosome or region.

References

Hu, J., Weber, J. N., Fuess, L. E., Steinel, N. C., Bolnick, D. I., & Wang, M. (2025). A spectral framework to map QTLs affecting joint differential networks of gene co-expression. PLOS Computational Biology, 21(4), e1012953.