CalcMV: Calculate estimated mean and variance of RNA-Seq data

Description Usage Arguments Value Author(s) Examples

View source: R/CalcMV.R

Description

Calculate estimated mean and variance of RNA-Seq data

Usage

1
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

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

Oscope documentation built on Nov. 8, 2020, 7:12 p.m.