nbinomTestForMatrices: Perform row-wise tests for differences between the base means...

Description Usage Arguments Details Value Author(s) Examples

View source: R/core.R

Description

This function is called by nbinomTest. Call it directly only if the S4 interface is unsuitable for your task.

Usage

1
nbinomTestForMatrices(countsA, countsB, sizeFactorsA, sizeFactorsB, dispsA, dispsB )

Arguments

countsA

A matrix of counts, where each column is a replicate

countsB

Another matrix of counts, where each column is a replicate

sizeFactorsA

Size factors for the columns of the matrix 'countsA'

sizeFactorsB

Size factors for the columns of the matrix 'countsB'

dispsA

The dispersions for 'countsA', a vector with one value per gene

dispsB

The same for 'countsB'

Details

See the vignette for an exact description of the null hypothesis tested.

Value

A vector of unadjusted p values, one for each row in the counts matrices.

Author(s)

Simon Anders, sanders@fs.tum.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
cds <- makeExampleCountDataSet()
cds <- estimateSizeFactors( cds )
cds <- estimateDispersions( cds, method="per-condition" )
colsA <- conditions(cds) == "A"
colsB <- conditions(cds) == "B"
bmvA <- getBaseMeansAndVariances( counts(cds)[,colsA], sizeFactors(cds)[colsA] )
bmvB <- getBaseMeansAndVariances( counts(cds)[,colsB], sizeFactors(cds)[colsB] )
pvals <- nbinomTestForMatrices( 
   counts(cds)[,colsA],
   counts(cds)[,colsB],
   sizeFactors(cds)[colsA],
   sizeFactors(cds)[colsB],
   fitInfo(cds,"A")$dispFunc( rowMeans( counts( cds, normalized=TRUE ) ) ),
   fitInfo(cds,"B")$dispFunc( rowMeans( counts( cds, normalized=TRUE ) ) ) )
names( pvals ) <- row.names( counts(cds) )
head( pvals )

# This here should give the same results:
head( nbinomTest( cds, "A", "B" )$pval )

DESeq documentation built on April 28, 2020, 6:37 p.m.