matrix_ls_trc_permutation: trcQTL with permutation in matrix form

Description Usage Arguments Value Examples

View source: R/rlib_matrix_ls_with_mask.R

Description

Perform trcQTL in matrix form with outcome permutated K times

Usage

1
2
3
4
5
6
7
8
matrix_ls_trc_permutation(
  trc,
  lib_size,
  x,
  cov,
  permutation_idx,
  trc_cutoff = 20
)

Arguments

trc

total read count (dimension = N x 1)

lib_size

library size (dimension = N x 1)

x

'genotype' used in trcQTL (which is defined as (x1 + x2) / 2) (dimension = N x P)

cov

effect of covariates on log(trc/2) (dimension = N x 1)

permutation_idx

permutation of samples in each column (dimension = N x K)

trc_cutoff

total read count cutoff to exclude observations with trc lower than the cutoff

Value

a list of summary statistics beta_hat: estimated log aFC (dimension = K x P, with kth row corresponding to the result under permutation defined in the kth column of permutation_idx) beta_se: standard deviation of log aFC (dimension = K x P) sample_size: number of observations used in regression

Examples

1
2
3
4
5
6
7
8
matrix_ls_trc_permutation(
  trc = rpois(100, 100),
  lib_size = rpois(100, 10000),
  x = matrix(sample(c(0, 0.5, 1), 200, replace = TRUE), ncol = 2),
  cov = rnorm(100),
  permutation_idx = matrix(c(sample(1:100), sample(1:100), sample(1:100)), ncol = 3, byrow = FALSE),
  trc_cutoff = 20
)

liangyy/mixqtl documentation built on Sept. 17, 2020, 11:36 a.m.