Last data update: 2014.03.03

R: Calculate mean and variance of expression samples
getMeanVarianceR Documentation

Calculate mean and variance of expression samples

Description

Calculate mean and variance of expression samples or log-expression samples

Usage

getMeanVariance(sampleFiles, outFile, log=NULL, type=NULL, verbose=NULL,
      norm=NULL, pretend=FALSE)

Arguments

sampleFiles

Vector of one or more files containing the expression samples.

outFile

Name of the output file.

log

Use logged values.

type

Type of variance, possible values: sample,sqDif for sample variance or squared difference.

verbose

Verbose output.

norm

Vector of (multiplicative) normalization constants for library size normalization of expression samples. Number of constants has to match the number of expression samples files.

pretend

Do not execute, only print out command line calls for the C++ version of the program.

Details

The getMeanVariance function computes means and variances of MCMC expression samples. These can be computed either from single file or from multiple files using sample variance. Variance of two experiments (i.e. technical or biological replicates) can be estimated also by using sqDif option for type which specify the computation of the average square distance between the samples from two sets.

Value

.means

File containing means (first column) and variance (second column) for each transcript (or row in the sample files)

Author(s)

Peter Glaus

See Also

estimateExpression

Examples

setwd(system.file("extdata",package="BitSeq"));
sampleFileNames = c("data-c1b0.rpkm","data-c1b1.rpkm")
getMeanVariance(sampleFiles=sampleFileNames, outFile="data-c1.Lmean", log=1,
      norm=c(1.0017, 0.9998))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BitSeq)
Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: stats4
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, xtabs

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

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, 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, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors

Attaching package: 'S4Vectors'

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

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: XVector
Loading required package: zlibbioc
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/BitSeq/getMeanVariance.Rd_%03d_medium.png", width=480, height=480)
> ### Name: getMeanVariance
> ### Title: Calculate mean and variance of expression samples
> ### Aliases: getMeanVariance
> ### Keywords: expression mean
> 
> ### ** Examples
> 
> setwd(system.file("extdata",package="BitSeq"));
> sampleFileNames = c("data-c1b0.rpkm","data-c1b1.rpkm")
> getMeanVariance(sampleFiles=sampleFileNames, outFile="data-c1.Lmean", log=1,
+       norm=c(1.0017, 0.9998))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>