getBaseMeansAndVariances: Perform row-wise estimates of base-level means and variances...

Description Usage Arguments Details Value Author(s) Examples

View source: R/core.R

Description

This function is called internally by a number of other functions. You will need to call it directly only in very special cases.

Usage

1

Arguments

counts

a matrix of data frame of count data. All the columns of this matrix will be considered as replicates of the same condition.

sizeFactors

the size factors of the columns, as estimated e.g. with estimateSizeFactorsForMatrix

Details

This function is kept for backwards compatibility. See the example below for an alternative and more self-explanatory way to get the same data.

Value

A data frame with one row for each row in 'counts' and two columns:

baseMean

The base mean for each row. This is the mean of the counts after they have been divided by the size factors

comp2

The base variance for each row. This is the variance of the counts after they have been divided by the size factors

Author(s)

Simon Anders, sanders@fs.tum.de

Examples

1
2
3
4
5
6
7
cds <- makeExampleCountDataSet()
cds <- estimateSizeFactors( cds )
head( getBaseMeansAndVariances( counts(cds), sizeFactors(cds) ) )

# You can get the same as follows
head( rowMeans( counts( cds, normalized=TRUE ) ) )
head( genefilter::rowVars( counts( cds, normalized=TRUE ) ) )

Example output

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, basename, cbind, colMeans, colSums, colnames,
    dirname, 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

Loading required package: Biobase
Welcome to Bioconductor

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

Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: lattice
    Welcome to 'DESeq'. For improved performance, usability and
    functionality, please consider migrating to 'DESeq2'.
           baseMean      baseVar
gene_1_F 1471.26133 787098.35248
gene_2_F  482.01094  10924.08502
gene_3_F  432.17911  30891.48802
gene_4_F  245.62565   1079.02204
gene_5_F   77.85519   1051.08303
gene_6_F   17.65209     27.12447
  gene_1_F   gene_2_F   gene_3_F   gene_4_F   gene_5_F   gene_6_F 
1471.26133  482.01094  432.17911  245.62565   77.85519   17.65209 
    gene_1_F     gene_2_F     gene_3_F     gene_4_F     gene_5_F     gene_6_F 
787098.35248  10924.08502  30891.48802   1079.02204   1051.08303     27.12447 

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