waldTest: Perform gene-wise Wald test for two group comparisons for...

Description Usage Arguments Details Value Author(s) Examples

View source: R/waldTest.R

Description

The counts from two groups are modeled as negative binomial random variables with means and dispersions estimated. Wald statistics will be constructed. P-values will be obtained based on Gaussian assumption.

Usage

1
2
## S4 method for signature 'SeqCountSet'
waldTest(seqData, sampleA, sampleB, equal.var)

Arguments

seqData

An object of SeqCountSet class.

sampleA

The sample labels for the first sample to be compared in two-group comparison.

sampleB

The sample labels for the second sample to be compared in two-group comparison.

equal.var

A boolean to indicate whether to use the same or different means in two groups for computing variances in Wald test. Default is FALSE.

Details

The input seqCountData object Must have normalizationFactor and dispersion fields filled, e.g., estNormFactors and estDispersion need to be called prior to this. With group means and shrunk dispersions ready, the variances for difference in group means will be constructed based on Negative Binomial distribution. P-values will be obtained under the assumption that the Wald test statistics are normally distributed. Genes with 0 counts in both groups will be assigned 0 for test statistics and 1 for p-values.

Value

A data frame with each row corresponding to a gene. Rows are sorted according to wald test statistics. The columns are:

gene Index

index for input gene orders, integers from 1 to the number of genes.

muA

sample mean (after normalization) for sample A.

muB

sample mean (after normalization) for sample B.

lfc

log fold change of expressions between two groups.

difExpr

differences in expressions between two groups.

stats

Wald test statistics.

pval

p-values.

others

input gene annotations supplied as AnnotatedDataFrame when constructed the SeqCountData object.

Author(s)

Hao Wu <hao.wu@emory.edu>

Examples

1
2
3
4
5

Example output

Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: bsseq
Loading required package: GenomicRanges
Loading required package: stats4
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: DelayedArray
Loading required package: matrixStats

Attaching package: 'matrixStats'

The following objects are masked from 'package:Biobase':

    anyMissing, rowMedians


Attaching package: 'DelayedArray'

The following objects are masked from 'package:matrixStats':

    colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges

The following object is masked from 'package:base':

    apply

Loading required package: splines
Warning message:
In locfdr(normstat, plot = 0) :
  CM estimation failed, middle of histogram non-normal
    geneIndex        muA        muB        lfc    difExpr     stats
165       165  13.964424  28.972141 -0.7117533 -15.007717 -3.584430
299       299 306.184148 163.286823  0.6272527 142.897326  3.159799
118       118   6.846129   2.066025  1.0518155   4.780104  3.083686
392       392 314.858433 146.015276  0.7665802 168.843157  2.955587
466       466   5.040669   0.508681  1.7034718   4.531988  2.838698
357       357   7.501551  32.049841 -1.4031370 -24.548290 -2.693052
            pval local.fdr       fdr
165 0.0003378151 0.2263011 0.2263011
299 0.0015787779 0.3842447 0.3854766
118 0.0020445305 0.4384240 0.4068303
392 0.0031207498 0.6132164 0.4581201
466 0.0045298073 0.8136798 0.5181271
357 0.0070801244 0.5842737 0.4581201
Warning message:
system call failed: Cannot allocate memory 

DSS documentation built on Nov. 8, 2020, 7:44 p.m.