Fesc: Regresion coefficients for estimate the Correction Factors...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function provides those regression coefficients necesaries for estimate the correction factors for Overdispersion Estimations, which is used as argument of EMOOD1s function, of data sets by considering each row as a different experiment, where each row has nothing to do with the others rows.

Usage

1
Fesc(data, librarysize, condition)

Arguments

data

matrix where each row is a different experiment which has nothing to do with the other rows or experiments.

librarysize

each sample from a row belongs to a negative binomial distribution with a "n1" or library size, and j is the number of samples which belong to the same condition that sample 1, the column "j+1" is n1, column "j+2" is n2, and so on.

condition

Binary vector where 0 means control and 1 treatment

Details

Sometimes, data sets store several rows where each of them does not came from the same experiment, that is, each row has nothing to do with the other rows. Conversely, the rows from RNA-seq data sets are dependent to the other rows into the same column (sample), so other function has to be apply here, such as EMObuODlmTest().

Value

A data.frame is returned, which cointains tow columns, the first one with the correction factor from samples which belong to condition "0" and the second column with the correction fators from samples which belong to condition "1".

Author(s)

Enrique Perez_Riesgo

See Also

dEMOOD1sci for use dEMO::Fesc outcomes as argument for this function and test the differential expression for independents rows.

Other One sample functions: dEMOOD1sci

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#observations
obsev <- 100
#population parameters
p1 <- 0.2
p2 <- 0.5
r1 <- 10^7
r2 <- 10^7
#simulations
x21 <- rnbinom(prob = p2, obsev, size = r2)
n21 <- x21 + r2
x22 <- rnbinom(prob = p2, obsev, size = r2)
n22 <- x22 + r2
x23 <- rnbinom(prob = p2, obsev, size = r2)
n23 <- x23 + r2
q2p <- x21 + x22 + x23
n2s <- n21 + n22 + n23
x11 <- rnbinom(prob = p1, obsev, size = r1)
n11 <- x11 + r1
x12 <- rnbinom(prob = p1, obsev, size = r1)
n12 <- x12 + r1
x13 <- rnbinom(prob = p1, obsev, size = r1)
n13 <- x13 + r1
q1p <- x11 + x12 + x13
n1s <- n11 + n12 + n13
rp1 <- n1s - q1p
rp2 <- n2s - q2p
#data set with all above simulations
expressiondata <- matrix(c(x21, x22, x23, x11, x12, x13, n21, n22,
n23, n11, n12, n13), ncol = 12, byrow = FALSE)
#correction factors
Fescoefs <- Fesc( expressiondata[, 1:6], expressiondata[, 7:12],
condition = c(0, 0, 0, 1, 1, 1))

emodoro/dEMO documentation built on May 28, 2019, 12:57 p.m.