matrix_ls_asc_permutation: ascQTL with permutation in matrix form

Description Usage Arguments Value Examples

View source: R/rlib_matrix_ls_with_mask.R

Description

Perform ascQTL in matrix form with outcome permutated K times

Usage

1
2
3
4
5
6
7
8
9
matrix_ls_asc_permutation(
  asc1,
  asc2,
  x,
  permutation_idx,
  asc_cutoff = 5,
  weight_cap = 100,
  asc_cap = 5000
)

Arguments

asc1

allele-specific read count for haplotype 1 (dimension = N x 1)

asc2

allele-specific read count for haplotype 2 (dimension = N x 1)

x

'genotype' used in ascQTL (which is defined as x1 - x2) (dimension = N x P)

permutation_idx

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

asc_cutoff

allele-specific read count cutoff to exclude observations with asc1 or asc2 lower than asc_cutoff

weight_cap

the maximum weight difference (in fold) is min(weight_cap, floor(sample_size / 10)). The ones exceeding the cutoff is capped.

asc_cap

exclude observations with asc1 or asc2 higher than asc_cap

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
9
matrix_ls_asc_permutation(
  asc1 = rpois(100, 100),
  asc2 = rpois(100, 100),
  x = matrix(sample(c(0, 0.5, 1), 200, replace = TRUE), ncol = 2),
  permutation_idx = matrix(c(sample(1:100), sample(1:100), sample(1:100)), ncol = 3, byrow = FALSE),
  asc_cutoff = 20,
  weight_cap = 10,
  asc_cap = 1000
)

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