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

View source: R/deseq_fn.R

deseq_fnR Documentation

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

Description

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

Usage

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

## 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)

denisagniel/tcgsaseq documentation built on May 7, 2022, 1:22 a.m.