High-throughput RNA-sequencing technologies have taken over the field of gene expression level estimation, previously dominated by microarray technologies. Some of the favorable characteristics of using high-throughput RNA-seq data is that there is no limit on the number of genes surveyed nor do the genes have to be pre-selected. Thus these technologies provide a wider dynamic range and also enable the possibility to discovering new sequence variants and transcripts. Since mRNA sequencing technology is not particularly target specific, up to tens of thousands of genes are "active" at different levels. While this is a fertile ground for functional discoveries, possibly of multiple pathways simultaneously, it is challenged by the onerous task of teasing apart thousands of genes based on their activity (expression) levels across assays. This requires the intervention of reliable computational techniques to make accurate and meaningful inferences from the massive data generated by the experiments. Also, the data is discrete i.e., in terms of read counts or number of read fragments rather than an intensity measurement in a continuous domain. As in all the other computational methods, the following assumptions are made:

1 Most of the genes are stable.

2 The DE genes are globally unbiased, i.e., some are over-expressed while some are under-expressed.

Let *x*_{
g
} be the observed abundance of gene *g*. This is the number of tags (reads) that map to gene *g* in the experiment. The length of the gene is absorbed in this value. Let *µ*_{
g
} be the true abundance. *M*_{
k
} is the library size and *S*_{
k
} represents the total RNA output of a sample. *S*_{
k
} is usually not available but relative RNA production fold change of two samples *S*_{
k
}/*S*_{
k
}′ may be [11].

### The mathematical framework

**Overview**. The primary objective is to compare the expression level of genes in high-throughput sequencing (HTS) data between a pair of biological samples. Due to the un-targeted nature of HTS, it is only natural to assume that the observed expression values of the genes are not independent. Second, the technologies produce data in terms of integer *read counts*. This is in contrast to earlier technologies which produced real-valued intensity measures. Also the total number of genes being simultaneously assayed earlier were determined by the technology while in the sequencing approaches, these read counts are a result of the application of mapping software pipeline, at whose core reside some sophisticated (parametric) string matching algorithms. Such a setting of read count computation is not naturally conducive to normalization processes. Hence the read count of a gene *g* is simply divided by the total number of reads (in millions) in the assay and by the length of the gene *g* (in kilobases) to yield a quantity called the RPKM value of *g*. Instead of directly working with the expression value of *g*, we define a character function {\varphi}_{g} for each gene *g*. The two most desirable properties of this function are (1) {\varphi}_{g} depend on the expression values of all the other genes in the assay and (2) {\varphi}_{g} are scale invariant. We also define another family of distributions, built on these functions (called *ψ*), to study the overall behavior of the changes captured by the two transcriptomes.

### Notation

Let *G* = {*g*_{1}, *g*_{2}, ..., *g*_{
L
}} be a set of *L* genes. Then let an *L*-tuple of random variables

\mathcal{T}=\left({X}_{{g}_{1}},{X}_{{g}_{2}},\dots ,{X}_{{g}_{L}}\right)={\left({X}_{g}\right)}_{g\in G}

(1)

represent a biological sample with *L* genes *G. X*_{
g
} is a random variable representing the observed expression or abundance of gene *g*. In this model-less framework, we make no assumptions about the distribution of each of the components *X*_{
g
}. Next, consider the *L*-tuple of random variables

\text{\Phi}\left(\mathcal{T}\right)=\left({\varphi}_{{g}_{1}}\left(\mathcal{T}\right),{\varphi}_{{g}_{2}}\left(\mathcal{T}\right),\phantom{\rule{2.77695pt}{0ex}}\dots ,{\varphi}_{{g}_{L}}\left(\mathcal{T}\right)\right)={\left({\varphi}_{g}\left(\mathcal{T}\right)\right)}_{g\in G},

(2)

whose components, {\varphi}_{g}, termed character functions, are defined below. In particular, these functions are scale invariant.

**Definition 1 (character functions)**

*For a fixed P > 1, we call a surjective map*

\varphi ={\left({\varphi}_{g}\right)}_{g\in G}:{\mathbb{R}}_{\ge 0}^{G}\to \left\{1,2,\dots ,P\right\},

(3)

*a character function if there exists a* {\left({\delta}_{p}\right)}_{1\le p\le P}\in {\mathbb{R}}_{\ge 0}^{P}, *satisfying the following conditions:*

*1 if*
{\varphi}_{g}\left(t\right)={\varphi}_{{g}^{\prime}}\left(t\right)=p
*then |t*
_{
g
}
*− t*
_{
g′
}
*| ≤ δ*
_{
p
}
*, and*

*2 if* {\varphi}_{g}\left(t\right)<{\varphi}_{{g}^{\prime}}\left(t\right), *then t*_{
g
} *< t*_{
g′
} ,

*for all g, g′ ∈ G, and* {\left({t}_{g}\right)}_{g\in G}\in {\mathbb{R}}_{\ge 0}^{G}.

Notice that such a character function satisfies the following additional properties.

1 {\varphi}_{g} is scale-invariant: {\varphi}_{g}\left(ct\right)={\varphi}_{g}\left(t\right) for all *c* > 0 and t\in {\mathbb{R}}_{\ge 0}^{G}.

This follows from the first condition of the definition of {\varphi}_{g}.

2 For all triplets, *g, g′, g″*, if *t*_{
g
} <*t*_{
g′
} <*t*_{
g″
} with {\varphi}_{g}\left(t\right)={\varphi}_{{g}^{\u2033}}\left(t\right) then {\varphi}_{g}\left(t\right)={\varphi}_{{g}^{\prime}}\left(t\right)={\varphi}_{{g}^{\u2033}}\left(t\right).

This property follows from the second condition of the definition. In fact this property leads to the algorithms for actually computing the scale-invariant maps.

For two samples *a* and *b* defined on the same gene set *G*, let a pair of *L*-tuples of random variables, {\mathcal{T}}^{a} and {\mathcal{T}}^{b}, represent the two samples. Let the corresponding scale-invariant character maps be \text{\Phi}\left({\mathcal{T}}^{a}\right)={\text{\Phi}}^{a} and \text{\Phi}\left({\mathcal{T}}^{b}\right)={\text{\Phi}}^{b}. Recall from Eqn (3) that the image of \varphi is {1, 2, .., *p*, .., *P*}. Next, consider the *P*-tuple of random variables

\Psi \left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)=\left({\psi}_{1}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right),{\psi}_{2}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right),\dots ,{\psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right),\dots ,{\psi}_{P}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)\right),

(4)

whose components {\psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right), termed *dispersion* functions, are defined below.

**Definition 2 (dispersion function)**

For samples a and b (with possibly a = b), {\psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right) is defined by the following distribution:

Pr\left({\psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)=q\right)=Pr\left(\underset{g\in G}{\mathsf{\text{V}}}\left(\left({\varphi}_{g}^{a}\left({\mathcal{T}}^{a}\right)=p\right)\text{\Lambda}\left({\varphi}_{g}^{b}\left({\mathcal{T}}^{b}\right)=q\right)\right)\right),

(5)

where *q* ∈ {1, 2, .., *P*}.

Informally speaking, {\Psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right) is the dispersion of image *p* in sample *b* with respect to that of *a*. Also, {\Psi}_{p}\left({\text{\Phi}}^{a}|{\text{\Phi}}^{a}\right) specifies the variance of image *p* in sample *a*. Based on Eqn (5), for each *p*, probability measures of over-expression (*O*) and under-expression (*U*) are defined as follows:

\begin{array}{c}{\mathsf{\text{O}}}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)=Pr\left({\psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)\ge p+1\right),\\ {\mathsf{\text{U}}}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)=Pr\left({\psi}_{p}\left({\text{\Phi}}^{b}|{\text{\Phi}}^{a}\right)\le p-1\right),\end{array}

Along similar lines, the dispersion within *a*, for each *p*, is

{\stackrel{~}{\mathsf{\text{O}}}}_{p}\left({\text{\Phi}}^{a}\right)=Pr\left({\psi}_{p}\left({\text{\Phi}}^{a}|{\text{\Phi}}^{a}\right)\ge p+1\right),

(6)

{\stackrel{~}{\mathsf{\text{U}}}}_{p}\left({\text{\Phi}}^{a}\right)=Pr\left({\psi}_{p}\left({\text{\Phi}}^{a}|{\text{\Phi}}^{a}\right)\le p-1\right),

(7)

Thus a natural measure of neutrality, for each *p*, is

{\stackrel{~}{\mathsf{\text{N}}}}_{p}\left({\text{\Phi}}^{a}\right)=1-\left({\stackrel{~}{\mathsf{\text{O}}}}_{p}\left({\text{\Phi}}^{a}\right)+{\stackrel{~}{\mathsf{\text{U}}}}_{p}\left({\text{\Phi}}^{a}\right)\right).

(8)

This intrinsic measure can be used to evaluate the accuracy of the estimation of distributions of random variable {\text{\Phi}}^{a}, based on single or multiple replicates. In practice, we have used {\stackrel{~}{\mathsf{\text{N}}}}_{p}\left({\text{\Phi}}^{a}\right) to evaluate the character functions \varphi (and thus estimate parameter *P* as well).

### Estimating distributions of random variables \text{\Phi}\left(\mathcal{T}\right) and \text{\Psi}\left(\text{\Phi}\right)

Critical to the computations of \text{\Phi} and \text{\Psi} functions, is the estimation of the distribution of the random variables *X*_{
g
} of Eqn (1). Our model is influenced by the observation that the total number of genes (*L*) in the RNA-Seq experiment is based on the biological sample and not the technology and that this also renders the observed abundances of each gene to be not quite independent of each other. This is reflected in the details of the computations discussed here.

Let c=\left({c}_{{g}_{1}},{c}_{{g}_{2}},\dots ,{c}_{{g}_{L}}\right) be the observed abundances in the experiment. Without loss of generality, let *c*_{
g
} be the number of reads (read-counts) of gene *g*, and Σ_{
g∈G
}*c*_{
g
} = *M*. To estimate the distribution we use a Bernoulli process with parameters *c*_{
g
}/*M*, for *g* ∈ *G*, and *M*. This is a natural extension of the method for the single replicate. Let {\left({c}_{g}^{1}\right)}_{g\in G},{\left({c}_{g}^{2}\right)}_{g\in G},\dots ,{\left({c}_{g}^{K}\right)}_{g\in G} be the observed abundances in the *K* experiments under identical conditions. As before, let {c}_{g}^{k} be the number of reads (read-counts) of gene *g* in the *k*th replicate, for 1 ≤ *k* ≤ *K*. Let {M}^{k}={\sum}_{g}{c}_{g}^{k}. We use *K* Bernoulli processes each with parameters {c}_{g}^{k}/{M}^{k}, for *g* ∈ *G*, and *M*^{k}, as in the single replicate case. Let {c}_{g}={\sum}_{k=1}^{K}{c}_{g}^{k} and let M={\sum}_{g}{c}_{g}. We estimate the probability, *p*_{
g
}, of gene *g* to be *c*_{
g
}/*M*.

Thus, modeling the experiment, with *K* ≥ 1 replicates, as a Bernoulli process, \mathcal{T}={\left({X}_{g}\right)}_{g\in G} of Eqn (1) follows a multinomial distribution with parameters *M* and (*p*_{
g
})_{
g∈G
}. A closed form of the distribution of {\varphi}_{g} or {\psi}_{g} is not straightforward to estimate and moreover, the argument to {\varphi}_{g} is an *L*-tuple t\in {\mathbb{R}}_{\ge 0}^{G}. Hence we simulate the Bernoulli process in our implementation. Then based on Defn (1), for a fixed *P*, {\varphi}_{g} is evaluated for each *g* using the *L*-tuple, *t*_{
i
}, of trial *i*. Similarly, based on Defn (2), {\psi}_{p} is evaluated for each *p* using the *L*-tuples of the two experiments. The details are discussed below.

### Simulating the character functions {\varphi}_{g}

Simulating the Bernoulli process for one experiment with *n* genes is described below, for some number of iterations *I* (e.g., *I* = 10^{3}), and some number of reads *R* (e.g., *R* = 10^{6}), using a fixed *P* (e.g., *P* = 20). Consider iteration i:

1 Repeat for each read *r* ∈ *R*: Assign the read to gene *g* ∈ *G* with probability {p}_{g}=\mathsf{\text{log}}\phantom{\rule{2.77695pt}{0ex}}{c}_{g}/{\sum}_{i=1}^{n}\mathsf{\text{log}}\phantom{\rule{2.77695pt}{0ex}}{c}_{i}.

2 Order genes according to decreasing assigned read count. Assign {\varphi}_{g}^{i}=1 for genes *g* with no reads.

3 Apply linear (regression) segmentation with *P* − 1 segments to the cumulative sum of the ordered read counts; assign {\varphi}_{g}^{i}=P for genes *g* in the first segment, *P* − 1 for the second segment, and so forth. Least-squares linear segmentation can be performed in time *O*(*n*^{2}*P*), see [12]. In practice when *n* is large one may want to subsample the genes, e.g., only use every 10th gene for the segmentation.

The values {\varphi}_{g}^{i} are stored in each iteration *i* and together make up the distribution {\varphi}_{g}. The values of the dispersion function *ψ*_{
p
} are computed from {\varphi}_{g}. In practice, to compute Pr\left({\Psi}_{p}\right({\text{\Phi}}^{b}\left|{\text{\Phi}}^{a}\right)=q), one counts the number of pairs of iterations (*i, i*′) ∈ (1...*I*, 1...*I*) where {\varphi}_{g}^{{a}_{i}}=p and {\varphi}_{g}^{{b}_{{i}^{\prime}}}=q, where {\varphi}_{g}^{{a}_{i}} denotes the bin of gene *g* in iteration *i* in dataset *a*. The probability *Pr* is the frequency of pairs \left({\varphi}_{g}^{{a}_{i}}=p,{\varphi}_{g}^{{b}_{{i}^{\prime}}}=q\right) among all the pairs \left({\varphi}_{g}^{{a}_{i}}=p,{\varphi}_{g}^{{b}_{{i}^{\prime}}}={p}^{\prime}\right)|{p}^{\prime}\in 1\dots P.

*An example* We compute the different distributions for a dataset with 10,000 genes and their (observed) abundances *c*. Figure 6 (a) shows {\varphi}_{g} for all the genes *g* (as defined in Eqn 3) and Figure 6 (b) shows the {\Psi}_{p}\left({\text{\Phi}}^{b}\right|{\text{\Phi}}^{a}) and {\Psi}_{p}\left({\text{\Phi}}^{a}\right|{\text{\Phi}}^{b}), for each *p* (according to Eqn 5), while (c) summarizes the Ψ distributions as {\stackrel{~}{\mathsf{\text{O}}}}_{p}\left(\text{\Phi}\right), {\stackrel{~}{\mathsf{\text{U}}}}_{p}\left(\text{\Phi}\right), and {\stackrel{~}{\mathsf{\text{N}}}}_{p}\left(\text{\Phi}\right) (according to Eqns 6-8).

### Comparison across a pair {\mathcal{T}}^{a} and {\mathcal{T}}^{b}

Instead of directly studying {\mathcal{T}}^{a} and {\mathcal{T}}^{b}, we observe instead the behavior of the scale-invariant maps \text{\Phi}\left({\mathcal{T}}^{a}\right) and \text{\Phi}\left({\mathcal{T}}^{b}\right). We also distinguish two classes of genes: one whose members are *differentially expressed* (DE) the others whose members are *stable* across the two samples *a* and *b* with sufficient confidence (based on a threshold on some measure). The definition of stable genes in this context, and detecting them via the combinatorial problem of longest increasing subsequence is discussed in Additional file 1. Unfortunately, these two which appear complementary in their characteristics do not exactly partition the genes *G* into two because of the need to meet the confidence thresholds.

### Differentially expressed (DE) genes

Character functions {\varphi}_{g}\left({\mathcal{T}}^{a}\right) and {\varphi}_{g}\left({\mathcal{T}}^{b}\right) are used to estimate the DE genes. We define a real-valued distance, *dis*(·, ·) ≥ 0, between the two functions as discussed below. For some fixed *δ* > 0, if dis\left({\varphi}_{g}\left({\mathcal{T}}^{a}\right),\phantom{\rule{2.77695pt}{0ex}}{\varphi}_{g}\left({\mathcal{T}}^{b}\right)\right)>\delta, then *g* is estimated to be differentially expressed. It is important to note that the mathematical framework discussed here is agnostic to the underlying models in the diverse read count simulators prevalent in literature.

To define the amount of differential expression between datasets *a* and *b*, we rank each gene according to the differences in their distributions {\varphi}_{g}\left({\mathcal{T}}^{a}\right) and {\varphi}_{g}\left({\mathcal{T}}^{b}\right). The ranking process is described below.

The estimated character functions are essentially histograms on *P* ordered bins *x* = 1, ... , *P*, denoted {\varphi}_{g}\left(\mathcal{T},x\right). We adopt *maximum norm* as the DE measurement between treatments, denoting the largest difference between the cumulative distributions for gene *g* in experiments *a, b*:

dis{(\varphi}_{g}\left({\mathcal{T}}^{a}\right),{\varphi}_{g}\left({\mathcal{T}}^{b}\right))=\underset{x}{\mathsf{\text{max}}}\left|C\left({\varphi}_{g}\left({\mathcal{T}}^{a}\right),x\right)-C\left({\varphi}_{g}\left({\mathcal{T}}^{b}\right),x\right)\right|,

(9)

where *C* denotes the cumulative distribution, C\left({\varphi}_{g}\left({\mathcal{T}}^{a}\right),x\right)={\sum}_{i=1}^{x}{\varphi}_{g}\left({\mathcal{T}}^{a},i\right). This is the test statistic in the Kolmogorov-Smirnov test. However, the character functions are discrete, so the K-S test is not applicable. Due to the finite numbers of iterations when estimating the distributions, two genes often have the same maximum norm distance. Then we further compare the genes by the distance between their modes in {\varphi}_{g}\left({\mathcal{T}}^{a}\right),\phantom{\rule{2.77695pt}{0ex}}{\varphi}_{g}\left({\mathcal{T}}^{b}\right). In the case of *K* replicates, {\varphi}_{g,i}\left({\mathcal{T}}^{a},x\right), is calculated for the *i*th replicate, and we perform DE analysis on the average character functions, \overline{{\varphi}_{g}}\left(\mathcal{T},x\right):

\overline{{\varphi}_{g}}\left({\mathcal{T}}^{a},x\right)=\frac{{\sum}_{i=1}^{K}{\varphi}_{g,i}\left({\mathcal{T}}^{a},x\right)}{K}.

(10)

The genes are ordered by decreasing maximum norm, then by decreasing mode distance, and the genes at the top of the list are the most likely DE candidates.

### Comparison with existing methods

We compare RoDEO against existing methods baySeq [13], edgeR [14], and sSeq [15] for identifying differentially expressed genes. In an effort to avoid biases often associated with generating simulated data using the exact distribution assumed by the methods (negative binomial in this case), we only used real data. Specifically, we used read counts and quantitative expression data from the MAQC human tissue samples, for which DE genes have been experimentally validated by qRT-PCR [1, 2]. The aim here is to detect differentially expressed genes between human reference RNA and brain RNA samples.

The methods were run on all 33k genes for which there were reads sequenced with Ion Torrent Proton technology (MAQC PRO dataset), while the DE results were evaluated only on those 17k genes with available qRT-PCR quantification. We used log-fold change cutoff > 1.5 to define DE genes and < 1.0 to define non-DE genes (other genes remained unassigned). Each method was run with default parameters (if any), RoDEO was run with *P* = 20 bins, *I* = 100 iterations, and *R* = 10^{7} reads. Each compared method provides a list of genes ordered by extent of their DE, and this list is used in the evaluation.

Figure 7 shows the DE methods' performance on the this MAQC PRO data consisting of two treatments, each with three replicates. Results on a single-replicate case using the first replicate only are shown in Figure 8. The four panels illustrate (i) For the number of top DE candidates on the x-axis, how many are false positives, (ii) False positive rate vs. true positive rate, including AUC (Area Under the Curve) measurement, (iii) For the top up to *x* = 500 true DE genes, how many are included in the method's DE list of size *x* (ideally *x* = *y*), (iv) AUC when varying the threshold for calling DE genes from the qRT-PCR results (threshold 1.5 is used in panels i-iii).

RoDEO outperforms all the other DE methods on this dataset, based on the AUC measurement at varying levels of the PCR DE threshold (panel iv), both on the multiple replicate and single replicate cases.