Last data update: 2014.03.03

R: Calculate estimated mean and variance of RNA-Seq data
CalcMVR Documentation

Calculate estimated mean and variance of RNA-Seq data

Description

Calculate estimated mean and variance of RNA-Seq data

Usage

CalcMV(Data, Sizes=NULL, NormData=FALSE, MeanCutLow=100, MeanCutHigh=NULL, ApproxVal=10^-6, Plot=TRUE)

Arguments

Data

input data matrix; it should be a gene-by-sample or isoform-by sample matrix

Sizes

The library size factor for each sample. the number of values in Sizes is expected to be the same as the number of columns of Data. The library size factor will be estimated using the median normalization method implemented in EBSeq if Sizes is specified as NULL.

NormData

whether the data is already normalized. If NormData=TRUE, the specification of Sizes will be ignored and no normalization will be applied.

MeanCutLow,MeanCutHigh

we suggests the users to apply Oscope on genes with high mean and high variance. By default, MeanCutLow is specified as 100, consequently only genes with mean > 100 will be used. The CalcMV function will fit a linear regression on log(variance)~log(mean) on these genes. Genes with variance above this line are considered as the high mean high variance genes. The upper bound of mean may be specified using MeanCutHigh. If both are specified as NULL, all of the genes will be considered when fitting the regression.

ApproxVal

Default is 10^-6. It is used to approximate the estimate of parameter q for genes/isoforms whose estimated variance is less than estimated mean. q will be estimated using 1-ApproxVal

Plot

if Plot = T, a mean-variance plot will be shown. The fitted line will be shown and the selected genes will be marked in green.

Value

Output is a list with 6 sublists : Mean: estimated means of genes/isoforms; Var: estimated variances; Median: estimated medians; GeneToUse: the high mean high variance genes (suggested input for Oscope); Q: estimated q's (without apporximation); Q_mdf: estimated q's with approximations; Phi_mdf: estimated overdispersion parameter (phi), with approximations.

Author(s)

Ning Leng

Examples

exp=matrix(rnorm(100,1000,10),ncol=10)
rownames(exp)=paste0("g",1:10)
CalcMV(exp)

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(Oscope)
Loading required package: EBSeq
Loading required package: blockmodeling
Loading required package: gplots

Attaching package: 'gplots'

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

    lowess

Loading required package: testthat
Loading required package: cluster
Loading required package: BiocParallel
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Oscope/CalcMV.Rd_%03d_medium.png", width=480, height=480)
> ### Name: CalcMV
> ### Title: Calculate estimated mean and variance of RNA-Seq data
> ### Aliases: CalcMV
> 
> ### ** Examples
> 
> exp=matrix(rnorm(100,1000,10),ncol=10)
> rownames(exp)=paste0("g",1:10)
> CalcMV(exp)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>