calculateMeans: Calculate the means and sum of squares for a SparseDataSet

Description Usage Arguments Author(s) Examples

Description

Calculate the means and sum of squares for a SparseDataSet. The means and sum of squares from samples within a condition are calculated and then added as a named list of sparse columns (dgCMatrix objects). An additional sparse column named 'global' is added to each which is the mean of the condition means and the sum of the condition sums of squares.

This function makes use of the mclapply function in the parallel package, to allow the user to distribute mean and sum of squares calculations across cores.

Usage

1
2
3
  ## S4 method for signature 'SparseDataSet'
calculateMeans( object, nzr=1, quiet=FALSE,
recalc=FALSE, ... )

Arguments

object

a SparseDataSet

nzr

the desired nonzero ratio: the means and sum of squares can be thresholded by sparseThreshold, to achieve a certain percent of nonzero elements. This might be useful as the row means of a sparse matrix can be much denser than the individual columns.

quiet

should the function not print out each condition name as it is calculated

recalc

should the function recalculate all means and sum of squares, or only those which are present in the conditions but missing from the means and sumSquares slots

...

extra arguments passed to mclapply of the parallel package

Author(s)

Michael Love

Examples

1
2
3
  sds <- simulateSparseDataSet(5, c(5,5))
  sds <- calculateMeans(sds)
  means(sds)

mikelove/SparseData documentation built on May 22, 2019, 10:52 p.m.