deseq_fn: Computes gene-wise p-values from DESeq2 method using...

Description Usage Arguments Examples

View source: R/deseq_fn.R

Description

Computes gene-wise p-values from DESeq2 method using observation-wise dispersion estimates

Usage

1
deseq_fn(y, x, phi, indiv)

Arguments

y

a numeric matrix of dim g x n containing the raw RNA-seq counts for g genes from n samples

x

a numeric design matrix of dim n x p containing the p covariates to be adjusted for

phi

a numeric design matrix of size n x K containing the K variables to be tested

indiv

a vector of length n containing the information for attributing each sample to one of the studied individuals. Coerced to be a factor

ind

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
#rm(list=ls())
set.seed(123)

##generate some fake data
########################
n <- 100
r <- 12
phi <- matrix(rep(1:3), 4, ncol=1, nrow=r)
sigma <- 0.4
b0 <- 1

#under the null:
b1 <- 0
#under the alternative:
b1 <- 0.7
y.tilde <- b0 + b1*phi + rnorm(r, sd = sigma)
y <- floor(exp(t(matrix(rnorm(n*r, sd = sqrt(sigma*abs(y.tilde))), ncol=n, nrow=r) +
      matrix(rep(y.tilde, n), ncol=n, nrow=r))))
x <- matrix(1:2, ncol=1, nrow=r/2)
indiv=rep(1:4, each=3)

#run test
temp <- deseq_fn(y, x, phi, indiv)

## End(Not run)

tcgsaseq documentation built on Sept. 13, 2020, 5:13 p.m.