BACKGROUND
over the last two decades, several methods for global quantitative profiling of gene expression have been developed  <cit> .
one of the most common uses of gene expression data is to identify differentially-expressed  genes between two groups of replicates collected from distinct experimental conditions, e.g.
stimulated vs unstimulated, mutant vs wild-type, or at separate time-points.
the goal of de analysis is to identify genes that underlie the phenotypical differences between the conditions.
the first method for genome-wide expression profiling was microarrays, but as sequencing costs have decreased, profiling by direct sequencing of the transcriptome  has become more popular.
initially, rna-seq experiments were carried out in bulk on samples of up to  <dig> cells.
consequently, only information about the mean expression of each gene in a sample could be extracted.
however, it has been known since the 1950s  <cit>  that gene expression varies from cell to cell, and more recently it has been shown that stochastic variation may play an important role in development, signaling and stress response  <cit> .
thus, recently developed single-cell rna-seq protocols  <cit> , could potentially provide a greater understanding of how the transcriptome varies between cells with the same genotype and cell-type.
the main advantage of single-cell rna-seq over bulk rna-seq is the fact that one obtains the full distribution of expression levels, rather than the population mean.
to take full advantage of single-cell data, for de analysis as well as for other types of investigation, e.g.
inference of gene regulatory networks, novel analysis methods are required.
single-cell de analysis is complicated by the fact that comparison of two probability distributions is an ambiguous task.
with the exception of scde  <cit> , most common tools for preforming single-cell de analysis - deseq <dig>  <cit> , cuffdiff  <cit> , limma  <cit>  and edger  <cit>  - are all adaptations of bulk rna-sequencing methods.
they mainly focus on filtration and normalisation of the raw data, and de genes are identified based on changes in mean expression levels.
the main drawback of using only the mean is that one ignores the gene expression heterogeneity, and will thus fail to detect situations where, for example, there is only a change in the variance of gene expression.
alternative methods for comparing probability distributions are the kolmogorov-smirnov test, the likelihood ratio test and the cramér-von mises test.
what these methods have in common is that they summarize the difference between two distributions as a single value, which can be used to test for significance.
gene expression at the single-cell level has been studied theoretically for almost three decades  <cit> , and the most widely used model is referred to as the transcriptional bursting model.
the transcriptional bursting model  <cit>  provides a mechanistic description of the stochastic switching of the promoter as well as the the production and degradation of transcripts at the single cell level .
the model makes it easy to generate synthetic data which closely resembles the experimental data.
since the model is analytically tractable it allows us to derive several other biologically relevant properties of gene expression   <cit> , which makes it easier to interpret results biologically.
despite its simplicity, the transcriptional bursting model enjoys strong experimental support  <cit> .
fig.
<dig> overview of d3e.
a graphical representation of the transcriptional bursting model.
b example of a realization of the transcriptional bursting model with parameters α= <dig> β= <dig>  γ= <dig>  and λ= <dig>  <cit> .
in this regime, the gene exhibits a bursty behavior with a bimodal stationary distribution.
c derivation of the biologically-relevant parameters from the parameters of the transcriptional bursting model.
d flowchart of the d3e algorithm
in this paper, we present d3e, a method based on the comparison of two probability distributions for performing differential gene expression analysis.
d3e consists of two separate modules: a module for comparing expression profiles using the cramér-von mises, the likelihood-ratio test, or the kolmogorov-smirnov test, and a module for fitting the transcriptional bursting model.
thus, d3e allows the user to go beyond merely identifying de genes and provides biological insight into the mechanisms underlying the change in expression.
we demonstrate the power of d3e to detect changes in gene expression using synthetic data.
finally, we apply d3e to experimental data to demonstrate its ability to detect significant changes which are not reflected by the mean.
RESULTS
algorithm and implementation
d3e takes a read-count table as an input, with rows and columns corresponding to transcripts and cells, respectively.
the user should split the columns into two or more groups by providing cell labels in the input file.
if there are more than two groups of cells, they must be compared one pair at a time.
d3e uses four steps to process the data.
first, input data is normalised using the same algorithm as deseq <dig>  and filtered by removing the genes that are not expressed in any of the cells.
second, the cramér-von mises test, the kolmogorov-smirnov  test, or the likelihood ratio test  <cit>  is used to identify the genes with a significant change in expression between the two samples of interest.
third, the transcriptional bursting model is fitted to the expression data for each gene in both samples using either the method of moments or a bayesian method  <cit> .
fourth, the change in parameters between the two samples is calculated for each gene .
a command-line version of d3e written in python can be downloaded from github , and the source code is available under the gpl licence.
furthermore, there is also a web-version available at http://www.sanger.ac.uk/sanger/generegulation_d3e.
due to the time required to run d3e, the web version limits the number of genes and cells that may be analyzed, and it can only use the method of moments for estimating parameters.
de analysis module
to compare distributions obtained from two different sets of cells, d3e uses either the cramér-von mises test, the ks test or the likelihood ratio test to quantify the difference in gene expression .
the first two tests are non-parametric which is advantageous since it allows us to apply d3e to any single-cell dataset, not just the ones collected using rna-seq.
the null hypothesis for all three tests is that the two samples are drawn from the same distribution.
the premise of d3e is that when two samples are drawn from the same population of cells, the test should result in a high p-value.
on the other hand, if the cells are drawn from two populations with different transcript distributions, then the resulting p-value should be low.
we first evaluated d3e using synthetic data.
fortunately, there is a widely used, experimentally validated stochastic model available for single-cell gene expression  <cit> .
we refer to this model as the transcriptional bursting model , and it is characterized by three parameters: α, the rate of promoter activation; β, the rate of promoter inactivation; γ, the rate of transcription when the promoter is in the active state; and a transcript degradation rate λ. the stationary distribution of the transcriptional bursting model takes the form of a poisson-beta mixture distribution  <cit>
pb=poi∧xbeta=γne−γ/λΓΓλnΓΓΓΦαλ,αλ+βλ+n;γλ,
where n is the number of transcripts of a particular gene, x is an auxiliary variable, Γ is the euler gamma function, and Φ is the confluent hypergeometric function.
an important feature of the poisson-beta distribution is that the three parameters α,β and γ are normalised by the rate of mrna degradation λ. consequently, when fitting the parameters for the poisson-beta distribution from a stationary sample, only three parameters can be estimated, and they are unique up to a common multiplicative factor, λ. since a single-cell rna-seq experiment corresponds to a snapshot of individual cells, it is often reasonable to assume that the samples are drawn from the stationary distribution.
the inability to uniquely identify all four parameters from single-cell rna-seq data means that it is only approprite to apply the transcriptional bursting model to de analysis when λs are constant between the compared samples, or when the degradation rates are known for both samples.
without knowledge of λ it is impossible to unambiguously determine how the parameters have changed.
to evaluate the sensitivity of the cramér-von mises, the ks and the likelihood ratio test to changes in the parameters, we selected triplets of parameters  from a range that is characteristic for single-cell rna-seq data  <cit> .
for each parameter triplet one of the parameters was varied, while fixing the remaining two, and a series of tests was carried out on the corresponding poisson-beta samples.
for each combination of parameters, we assumed that there were  <dig> cells from each condition when generating the data.
the results can be summarized by a set of matrices, where rows and columns correspond to values of the varied parameter, and the elements in the matrix are p-values from the tests .
ideally we would like to find high p-values on the diagonal and low p-values away from the diagonal.
we used a heuristic for characterizing the pattern of p-values, and for each matrix we obtained a single score, s .
when s= <dig>  high p-values are only found on the diagonal, suggesting that d3e has successfully identified genes where there was a change in one of the parameters.
fig.
<dig> de analysis for synthetic data.
a sensitivity to changes in parameters of the poisson-beta distribution for the cramér-von mises, ks and likelihood ratio tests.
a lighter color denotes a low sensitivity to changes of a particular parameter.
b average sensititivity scores for the panels in a as well as the run-times.
c an example of a matrix which was used to assign the colors in a. here, parameters α=.
<dig> and β=.
<dig>  while γ is varied from  <dig> to  <dig> on a log-scale.
each element in the matrix reflects a p-value of a ks test between two poisson-beta distributions with the corresponding parameters.
we expect to find high values along the diagonal, where the changes are smaller.
d de analysis for the scenario where the mean is fixed but the variance is changed.
d3e is able to reliably identify differentially expressed genes based on the change in the shape of distribution alone.
here, the color represents the p-value for the cramér-von mises test with dark colors indicating a low value
the results suggest that all three tests are capable of accurately detecting changes in the parameters in certain regions of the parameter space .
for all three tests, changes in β are the most difficult to detect while changes in γ are the easiest to identify.
the methods perform poorly when γ is small and either β is large or α is small.
in this regime, the poisson-beta distribution is similar to the poisson distribution with a mean close to zero, and it is challenging to identify which parameter has changed, and by how much.
from a biological perspective, when a transcription rate is small and a gene has a small duty cycle  there are almost no transcripts produced since the promoter spends most of its time in the inactive state.
therefore, changes in either of the three parameters will be difficult to distinguish.
the performance of each method can be summarized by the average score across all combination of parameters and we find that the likelihood ratio test is the most accurate, followed by the cramér-von mises test and the ks test .
the accuracy, however, is also mirrored by the computational costs; analyzing the data in fig.
2a takes about  <dig> s for the ks-test,  <dig> min for the cramér-von mises test and  <dig>  h for the likelihood ratio test using a macbook pro laptop with a  <dig>  ghz intel i <dig> processor and  <dig> gb of ram.
we also considered the scenario when the two distributions are different, but the mean is identical.
this is a situation where it is all but impossible for methods which only use the mean to reliably detect that there has been a change in the expression profile.
in contrast, d3e is able to reliably identify a change in expression.
our results show that a change of α and β by a factor of  <dig>  which is roughly equivalent to changing the variance by the same factor, is sufficient for the p-value to drop below.
<dig> for a sample of  <dig> cells .
a particular challenge for de analysis is to determine the p-value threshold for when a change can be considered significant.
the traditional approach is to use a fixed value, e.g.. <dig>  and then adjust for multiple hypothesis testing.
for d3e two different methods are offered for selecting the critical p-value.
on the one hand, the user can specify a false discovery rate, and the tool will use the benjamini-hochberg procedure  <cit>  to identify the critical p-value.
alternatively, one may take an empirical approach whereby one of the two samples is first split into two parts.
by definition, the two parts should have identical distributions for all genes, which means that it can be used as a negative control.
d3e applies one of the three tests to the negative control, and records the lowest p-value identified, p∗.
when comparing the two original distributions, only genes with a p-value below a×p∗ are considered significant, where the default value for the parameter a is.
<dig>  we advice the user that the reduced sample size of the negative control set is likely to result in a less stringent cut-off than what would be expected if the negative control had the same sample size as the original data.
to evaluate the heuristic strategy, we generated  <dig>  pair of samples with the same number of reads and cells, using identical parameter values for the samples in each pair.
using the cramér-von mises test we recorded the lowest observed p-value, p∗, and we used.1×p∗ as a threshold for when to call a test significant.
for both the method of moments and the bayesian method, we found that  <dig> % of the genes were detected as not de.
the control experiment demonstrates that d3e is capable of accurately distinguishing situations where the parameters are unchanged.
to further evaluate the performance of d3e relative to other de methods, we generated additional synthetic data sets where one of the three parameters was varied while the other two were fixed as before.
for each data set we designated genes as de where the parameter had changed by at least a factor of  <dig> ,  <dig> or  <dig>  the arbitrary decision of what constitutes a significant change allows us to define the calls of the de algorithms as either true positive, false positive, true negative or false negative.
the results can be summarized as a roc curve, and again we find that changes in β are more difficult to detect compared to the other two parameters .
importantly, we find that for larger parameter changes, d3e is always amongst the best performing methods .
fig.
<dig> comparison of de methods for synthetic data.
each panel shows the receiver operator characteristics  calculated for synthetic data using five different de algorithms.
the numbers below each panel indicate the area under the curve.
the rows correspond to different thresholds for when a gene is considered significantly changed.
deseq <dig> reports na for many genes.
since the na cannot be interpreted as either de or not de, we treat these calls as false, which explains the unusual shape of the roc curve and the fact that the auc value is below.5
parameter estimation module
the likelihood ratio test is a parametric test, and thus it requires estimates of the parameters α, β and γ. d3e has two approaches; the method of moments which is relatively fast and a more computationally costly bayesian inference method   <cit> .
we evaluated the accuracy of the parameter estimates, both assuming perfect sampling as well as in the scenario when some transcripts are lost due to low starting levels of mrna  <cit> .
in our simulations, we first generated parameters for the poisson-beta model by drawing from a distribution similar to the one for the data reported by islam et al.
<cit> .
we then assumed that the dropout probability scaled with the mean expression level as pdropout=1−e−μ2/b  <cit> , where the parameter b controls the rate of dropouts.
in our simulations we used b= <dig>  and  <dig>  our simulations show that the relative error for the estimates of the parameters α, β and γ are relatively robust to dropout events .
fig.
<dig> sensitivity to transcript dropout errors.
a errors for the estimates of the parameters for the synthetic data in fig.
2
a using the bayesian inference method.
each bar represents the geometric mean squared relative error for the parameter estimates b errors for the estimates of the correlations between the estimated changes in parameters for the synthetic data in fig.
2
a. each bar represents the estimated pearson correlation coefficient between the log-changes of the quantities
an important advantage of using the transcriptional bursting model  is that it is possible to derive other quantities - the average burst size, the burst frequency, the mean expression level, and the proportion of time in the active state  - which are easier to measure and interpret biologically than the parameters α, β and γ. importantly, the transcriptional bursting model allows us to learn more about how the expression level has changed between the two conditions.
in the transcriptional bursting model, there are three different ways to increase the mean expression level; by decreasing the degradation rate, by increasing the burst frequency, or by increasing the burst size.
by comparing the correlations between the change in mean expression levels and the change in burst size or burst frequency, it is possible to gain additional biological insights relating to what aspect has led to the change in gene expression.
in contrast to the estimates of the rate parameters the correlation estimates are sensitive to dropout events , and one must thus be careful when interpreting the results.
application to experimental data
the tests on synthetic data suggest that d3e can reliably identify differentially expressed genes.
a more useful test of the algorithm, however, involves experimental data which has been reliably validated.
unlike bulk data  <cit> , unfortunately there are no gold-standard datasets available.
nonetheless, to further evaluate d3e, we considered the single-cell rna-seq data from two and four-cell mouse embryos where qpcr data from the same cell-types was collected for  <dig> genes  <cit> .
unfortunately, the correlation of changes in gene expression between the qpcr and rna-seq data   is even worse than the correlation of the individual samples .
thus, it does not come as a surprise that the overlap between the genes which are considered de in the qpcr experiment has little overlap with genes which are considred de from rna-seq by any of the five algorithms that we compared .
even so, we find large differences in the number of genes identified as de, ranging from  <dig>  to  <dig> .
to further evaluate d3e, we applied it to the two datasets collected by islam et al.
<cit>  from  <dig> mouse embryonic stem cells and  <dig> mouse embryonic fibroblasts.
to establish the p-value threshold, we first separated the stem cells into two groups, and compared the expression .
we used this approach for determining the threshold for d3e, scde, edger and limma, while for deseq <dig>  we used the adjusted p-value reported by the software.
when comparing the two cell-types, d3e identified  <dig> genes as de, deseq <dig> identified  <dig> genes, limma-voom identified  <dig> genes, edger identified  <dig> genes, and scde identified  <dig> genes .
surprisingly, the agreement between the five methods is quite low with only a core set of  <dig> genes identified by all three methods.
if we require a gene to be identified of  <dig> out of  <dig> methods, then an additional  <dig> genes are idenitified as de, suggesting that there is a set of around  <dig> genes which can confidently considered de.
to further evaluate the set of genes identified as de by each method, we investigated the distiribution of fold-change values .
the distributions gives an indication of how large fold changes are required for detection, and we note most of the genes have a higher expression in fibroblasts compared to stem cells.
compared to deseq <dig>  scde and edger, we also notice that d3e is able to identify genes with a lower fold change.
indeed, there were several examples of genes where the change in mean expression was modest, but they were still identified by d3e as differentially expressed .
fig.
<dig> analysis of experimental data.
a histogram showing the fold-changes for the genes which were considered significantly changed  and not changed  for d3e, deseq <dig>  limma, edger and scde.
b histograms showing the distribution of parameter values for all cells from  <cit> .
from top to bottom, the panels represent the frequency, the burst size, the inferred rates for the transcriptional bursting model, and the duty cycle.
c examples of two genes, cdc42bpb in the top panel and hist1h2bb in the bottom panel, which were identified as de by d3e.
in both cases, the change in mean expression is less than  <dig> % whereas the variance increases by >10-fold.
d karnaugh table showing the number of genes identified as differentially expressed by d3e, scde, limma, edger, and deseq <dig> for the two datasets collected by islam et al.
<cit> .
e scatterplots showing the mean in mescs, and the fold-change, as well as the fold-change of the mean compared to the change in degradation rate, burst frequency and burst size.
in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e
next, we took advantage of the transcriptional bursting model underlying d3e, and we fitted the parameters α, β, and γ for all genes.
we found that for  <dig> % of the genes, at least one of the parameters changed by at least 2-fold, suggesting that there are substantial differences between the two cell-types.
the results show that all three parameters follow log-normal distributions, spanning approximately one or two orders of magnitude in both cell-types .
with the exception of the duty cycle which is constrained to be in the interval  <cit> , the derived quantities showed a similar distribution.
we calculated the three derived quantities for each condition for the  <dig> genes where we were able to obtain degradation rates for both cell-types  <cit> .
next, we compared the changes in degradation rate, burst frequency and burst size to the change in mean expression level .
the results clearly demonstrate that it is the change in burst size which underlies the change in mean expression levels , suggesting that altering the burst size is the driving mechanism behind differences in mean expression between conditions.
however, considering our simulation experiments , it is likely that the true correlation is lower.
another property of interest is the coefficient of variation , defined as the standard deviation divided by the mean, which is used to quantify the gene expression noise.
the cv is inversely correlated with the mean, and the transcriptional bursting model reveals that the change in cv is mainly correlated with the change in the duty cycle , while the effect of a change in burst size is considerably smaller .
to further demonstrate the use of the transcriptional bursting module, we also investigated changes in the auto-correlation times of each gene.
the auto-correlation provides information about the time-scale of the noise, i.e.
how quickly the gene expression level varies.
the expected value of the autocorrelation, τc, is given by
τc=σ2μλ+1α+β.
comparison of τc and the change in the mean for the islam et al.
data reveals that the two quantities are strongly correlated .
however, when investigating all the quantities on the right hand side of eq.
the comparison shows that it is the change in variance which is most strongly correlated with the change in autocorrelation times .
we also applied the methodology to cells from the early and late blastocyst from mouse embryos  <cit> .
since we do not have access to degradation rates for these cell-types, not all of the correlations can be explored.
nevertheless, the correlations that can be calculated are largely similar to the ones observed for the islam et al.
data .
taken together, these results demonstrate that it is possible to generate testable hypotheses about how changes in the property of a gene has come about.
discussion
de analysis is one of the most common uses of bulk rna-seq, and we expect that it will become an important application for single-cell rna-seq as well.
here, we have presented d3e, a tool for analyszing de for single-cell data.
the main difference between d3e and other methods is that d3e compares the full distribution of each gene rather than just the first moment.
therefore, it becomes possible to identify genes where the higher moments have changed, with the mean remaining constant.
to the best of our knowledge, d3e is the first method for de analysis which considers properties other than the first and second moment of the distribution.
using synthetic data, we demonstrate that d3e can reliably detect when only the shape, but not the mean is changed.
one of the main challenges in developing a de analysis method for single-cell rna-seq data is that, unlike for bulk data, there are no gold-standards available  <cit> .
comparison of qpcr and rna-seq data revealed only a modest correlation between the two methods, implying that the two methods are inconsistent.
thus, one must resort to synthetic data for evaluation.
fortunately, for single-cell gene expression, there is an analytically tractable transcriptional bursting model available which has been experimentally validated.
even with synthetic data, however, it is not obvious how one should define a change in expression.
consider the situation where one of the parameters changes by a small amount which is just sufficient to be detected given the limits of the technical noise, the read depth and the sample size.
then the question is whether or not the change is sufficient to be biologically meaningful.
another challenge stems from the difficulty of disentangling the technical and the biological noise.
the transcriptional bursting model does not account for the technical noise in single-cell experiments which can be considerable  <cit> .
since each cell can only be sequenced once, one cannot carry out technical replicates in the same way that can be done for bulk experiments.
given the lack of ground truth and the difficulties involved in rigorously defining change in gene expression at the single-cell level, we recommend that more than one algorithm is used to identify de genes.
if the aim is to identify the genes which are most likely to have changed significantly, we believe that a consensus approach is the best one to use.
such a strategy will minimize the number of false positives with the drawback of increasing the number of false negatives.
d3e implements two different non-parametric methods and one parametric method for comparing probability distributions.
the methods emphasize different aspects of the distributions, and they are also associated with different computational costs.
an important future research question is to determine what method is the most appropriate for single-cell de analysis.
since the results are sensitive to technical noise, such developments should ideally be carried out taking the specific details of the protocol into consideration.
we have shown that the transcriptional bursting model makes it possible to extract additional, biologically relevant results from the de analysis.
however, to be able to fully utilize the transcriptional bursting model, the mrna degradation rates must be known, or assumed to be constant.
determining degradation rates directly remains experimentally challenging, and today they are only available for a handful of cell-types.
however, alternative strategies have been proposed, whereby degradation rates are estimated from rna-seq data using distribution of reads along the length of a gene  <cit> .
the rna-seq based methods make it possible to estimate degradation rates without further experiments, and they could thus significantly expand the range of samples where the transcriptional bursting model can be applied.
another restriction of our method is that the groups of cells must be known in advance.
in many cases, e.g.
when comparing samples from a mutant and wild-type or when comparing different stages of development  <cit> , it is straightforward to assign labels to cells.
however, there are also situations, e.g.
when analyzing a tissue-sample, when the cell-labels are unknown and in these scenarios d3e is no longer applicable.
CONCLUSIONS
our work combines three important aspects of genomics - high-throughput sequencing technologies, computational data analysis, and systems biology modelling.
in the present study, we have combined single cell rna-seq, non-parametric comparison of distributions and an analytical model of stochastic gene expression which allows us to extract biologically meaningful quantities, providing insights not just about which genes have changed between two conditions, but also how the change has come about.
implementation
cramér-von mises criterion
to compare two empirical distributions of read counts from different cell samples, the cramér-von mises test was used.
let x <dig> x <dig> …xn and y <dig> y <dig> …ym be the observed read counts for the two samples.
given ranks qi and si of the read-counts from the first and the second samples, in the ordered pooled sample, the cramér-von mises criterion is given by  <cit> :
t=unm−4nm+ <dig>
where
u=n∑i=1nqi−i2+m∑j=1msi−j <dig>
the p-value associated with a null-hypothesis that two samples are drawn from the same distribution was calculated as  <cit> :
p=1−1πt∑j=0∞j− <dig> j <dig> exp−216tk <dig> t,
where
− <dig> j=jΓΓj!,
Γ is euler’s gamma function, and kν is a modified bessel function of the second kind.
the infinite sum in  converges fast after the first few terms.
in practice, the p-value was calculated using first  <dig> terms of the sum for values of t less or equal to  <dig>  for values of t greater than,  <dig> the p-value was set to zero.
parameter estimation
a fast but inaccurate method for estimating parameters of a poisson-beta distribution is a moments matching technique.
the parameters can be expressed through the sample exponential moments  <cit> :
α=2r1r1r2−2r1r3+r2r <dig>
β= <dig>
γ=−r1r2+2r1r3−r2r3r1−2r2+r <dig>
where ri is a successive ratio of exponential moments ei:
ri=eiei− <dig> e0= <dig>
for an i’th exponential moment: ei=e, where x is a sample of read counts.
the parameters of a poisson-beta distribution can also be estimated by a bayesian inference method  <cit> .
the bayesian method is more accurate, but it requires more computational power.
a gamma distribution was used as a prior for the parameters α, β and γ:
α∼gamma
β∼gamma
γ∼gamma,
where
kα=kβ=kγ= <dig>
θα=θβ= <dig>
θγ=max{x:x∈x},
the number of read counts, x, was drawn from a poisson-beta distribution:
x∼pois∧cbeta
parameter estimation was performed by a collapsed gibbs sampler, using slice sampling  <cit> .
conditional distributions for parameters during sampling were given by:
p∼betapoisson
p∼gamma∏i=1nbeta
p∼gamma∏i=1nbeta
p∼gamma∏i=1npois
likelihood ratio test
the likelihood ratio test provides a parametric test for differential expression.
one of the two conditions is designated as the control and the other is designated as the test conditions.
for each gene, the log-likelihood of the data from the test condition is calculated using the parameters estimated for both the control and the test.
we then test the null hypothesis that the ratio of the likelihoods calculated using the two parameters is not significantly different from  <dig>
calculating the likelihood using the poisson-beta distribution numerically is very challenging due to the presence of the confluent hypergeometric function  <cit> .
the methods available in python become unreliable for large values of the third argument.
to be able to evaluate the poisson-beta distribution we employ a monte carlo method whereby the pdf is estimated using n randomly generated samples.
n can be set by the user as a flag and the default value is  <dig> .
synthetic data
synthetic data was produced by sampling from a poisson-beta distribution, i.e.
first drawing an auxiliary variable c from beta distribution with parameters α and β: c∼beta and then drawing from a poisson distribution with parameter λ=cγ: x∼poisson.
analyis of the sensitivity
to evaluate how well d3e is capable of detecting changes in different regimes of the parameter space, we systematically varied the three parameters of the poisson-beta model across the range of values representative of the biological data, α∈,β∈, and γ∈ <cit> .
we fixed a pair of parameters and varied the third in  <dig> steps over its range, recording the p-value for one of the tests.
for each of the  <dig> different combinations, it was assumed that the sample consisted of  <dig> cells from each condition was generated.
close to the diagonal, the changes in the parameters are small, and we expect a high p-value in these positions.
to summarize the matrix of p-values, we calculate a composite score as
s=1−1100∑i=110i−10+1100∑i=110∑j= <dig> j≠i10i,
where i is the indicator function.
the score s ranges between  <dig> and  <dig>  and  <dig> is obtained when all of the p-values on the diagonal are greater than.
<dig> while the off-diagonal elements are smaller than.
<dig>  the score is mapped to a color and reported in fig.
<dig>
dropout analysis
to evaluate the effect of experimental noise, we considered the possibility of transcript dropout events.
dropouts are likely to occur either as a consequence of failure to isolate the transcript when lyzing the cell, failure of the rt reaction, or failure of the amplification.
the probability of failure is poorly understood, but it has been suggested that the dropout probability can be modeled as pdropout=1−e−μ2/b, where μ is the mean expression and b is a parameter  <cit> .
for our dropout experiments, we randomly generated  <dig>  parameter triplets based on the fitted data from islam et al.
<cit> .
for each triplet, we changed one parameter at a time and the change was allowed to be up to 4-fold.
next, we generated realizations from both distributions for  <dig> cells in each condition.
we used the parameter estimation module to evaluate the accuracy of the estimates for perfect samples as well as for three different values of the dropout parameter b= <dig> , <dig>
normalization
the normalization of the raw read counts was performed by the same method used by deseq <dig>  <cit> .
let xij represent the raw number of reads for i= <dig> ..n and j= <dig> ..m, where n is the number of genes, and m is the total number of cells in the experiment.
then, the size factor sj is found as
sj=medianixij∏k=1mxik1/m.
the corrected read counts are then calculated as xij∗=xijsj.
the size factors are calculated based on spike-ins data only if it is available.
determining p-value threshold
to determine the p-value threshold for d3e, we first take the sample which will be used as the control group , and split it into two non-overlapping subsets.
next, one of the tests is applied to the split sample, and the lowest p-value observed, p∗, is recorded.
when comparing the case and the control sets,  <dig> ∗p∗ is used as a threshold, and only genes with a p-value lower than  <dig> ∗p∗ are considered significant.
scde reports a z-score which we transform to a p-value using the formula p=2Φ, where Φ is the cumulative density of the standard normal distribution.
when choosing the threshold for scde, we used the same strategy as for d3e.
for deseq <dig> we used the adjusted p-value reported by the algorithm, and we required it to be <.
<dig> to be significant.
calculating auto-correlation times
the power spectral density, s, of the mrnas for the transcriptional bursting model is given by  <cit>
s=2λ2+ω2dγ+dαγ22−λ2−22+ω2dαγ22−λ <dig>
where d=α/.
by definition, the auto-correlation, r, is given by the inverse fourier transform of s,
r=e−λ|t|dγλ+2λ2−λ2)−e−|t|22−λ <dig>
the characteristic time of the auto-correlation is defined as τc=s/2r.
additional files
additional file  <dig>
figure s <dig>  sensitivity to changes in parameters of the poisson-beta distribution for the cramér-von mises, ks and likelihood ratio tests similar to fig.
<dig>  the range over which the parameters are varied is larger here.
the increased presence of lighter colors shows that for the most part it is easier to identify de genes for this set of parameters.
additional file  <dig>
figure s <dig>  change in expression levels for  <dig> genes from the 2-cell and 4-cell mouse embryos as quantified using either qpcr or rna-seq  <cit> .
additional file  <dig>
table s <dig>  expression levels for the  <dig> genes from the 2-cell and 4-cell mouse embryos as quantified using either qpcr or rna-seq  <cit> .
the last six columns indicate the genes that were identified as differentially expressed by different de algorithms as well as a t-test for the qpcr data.
additional file  <dig>
parameters for the islam et al.
data without degradation rates.
parameters for the  <dig>  genes that were expressed in both cell types.
additional file  <dig>
parameters for the islam et al.
data with degradation rates.
parameters for the  <dig>  genes that were expressed in both cell types, and where degradation rates were available.
additional file  <dig>
figure s <dig>  scatterplots showing the mean fold-change, as well as the fold-change of the cv compared to the change in degradation rate, burst frequency, duty cycle, burst size.
in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e.
additional file  <dig>
figure s <dig>  scatterplots showing the mean fold-change and the fold-change of the characteristic time, as well as the fold-change of the characteristic time compared to the change in degradation rate, variance and characteristic promoter time.
in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e.
additional file  <dig>
figure s <dig>  scatterplots showing the mean fold-change, as well as the fold-change of the mean compared to the change in burst frequency, duty cycle, burst size for early vs late blastocysts from deng et al.
<cit> .
in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e.
additional file  <dig>
figure s <dig>  scatterplots showing the mean fold-change, as well as the fold-change of the cv compared to the change in burst frequency, duty cycle, burst size for early vs late blastocysts from deng et al.
<cit> .
in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e.
competing interests
the authors declare that they have no competing interests.
authors’ contributions
mh conceived the study and supervised the research, md and mh carried out the research, md wrote the code, and md and mh jointly wrote the manuscript.
both authors read and approved the final manuscript.

 over the last two decades, several methods for global quantitative profiling of gene expression have been developed. one of the most common uses of gene expression data is to identify differentially-expressed genes between two groups of replicates collected from distinct experimental conditions, e.g. stimulated vs unstimulated, mutant vs wild-type, or at separate time-points. the goal of de analysis is to identify genes that underlie the phenotypical differences between the conditions. the first method for genome-wide expression profiling was microarrays, but as sequencing costs have decreased, profiling by direct sequencing of the transcriptome has become more popular. initially, rna-seq experiments were carried out in bulk on samples of up to cells. consequently, only information about the mean expression of each gene in a sample could be extracted. however, it has been known since the 1950s that gene expression varies from cell to cell, and more recently it has been shown that stochastic variation may play an important role in development, signaling and stress response. thus, recently developed single-cell rna-seq protocols, could potentially provide a greater understanding of how the transcriptome varies between cells with the same genotype and cell-type. the main advantage of single-cell rna-seq over bulk rna-seq is the fact that one obtains the full distribution of expression levels, rather than the population mean. to take full advantage of single-cell data, for de analysis as well as for other types of investigation, e.g. inference of gene regulatory networks, novel analysis methods are required. single-cell de analysis is complicated by the fact that comparison of two probability distributions is an ambiguous task. with the exception of scde, most common tools for preforming single-cell de analysis - deseq, cuffdiff, limma and edger - are all adaptations of bulk rna-sequencing methods. they mainly focus on filtration and normalisation of the raw data, and de genes are identified based on changes in mean expression levels. the main drawback of using only the mean is that one ignores the gene expression heterogeneity, and will thus fail to detect situations where, for example, there is only a change in the variance of gene expression. alternative methods for comparing probability distributions are the kolmogorov-smirnov test, the likelihood ratio test and the cramér-von mises test. what these methods have in common is that they summarize the difference between two distributions as a single value, which can be used to test for significance. gene expression at the single-cell level has been studied theoretically for almost three decades, and the most widely used model is referred to as the transcriptional bursting model. the transcriptional bursting model provides a mechanistic description of the stochastic switching of the promoter as well as the the production and degradation of transcripts at the single cell level. the model makes it easy to generate synthetic data which closely resembles the experimental data. since the model is analytically tractable it allows us to derive several other biologically relevant properties of gene expression, which makes it easier to interpret results biologically. despite its simplicity, the transcriptional bursting model enjoys strong experimental support. fig. overview of d3e. a graphical representation of the transcriptional bursting model. b example of a realization of the transcriptional bursting model with parameters α= β= γ= and λ=. in this regime, the gene exhibits a bursty behavior with a bimodal stationary distribution. c derivation of the biologically-relevant parameters from the parameters of the transcriptional bursting model. d flowchart of the d3e algorithm in this paper, we present d3e, a method based on the comparison of two probability distributions for performing differential gene expression analysis. d3e consists of two separate modules: a module for comparing expression profiles using the cramér-von mises, the likelihood-ratio test, or the kolmogorov-smirnov test, and a module for fitting the transcriptional bursting model. thus, d3e allows the user to go beyond merely identifying de genes and provides biological insight into the mechanisms underlying the change in expression. we demonstrate the power of d3e to detect changes in gene expression using synthetic data. finally, we apply d3e to experimental data to demonstrate its ability to detect significant changes which are not reflected by the mean.  algorithm and implementation d3e takes a read-count table as an input, with rows and columns corresponding to transcripts and cells, respectively. the user should split the columns into two or more groups by providing cell labels in the input file. if there are more than two groups of cells, they must be compared one pair at a time. d3e uses four steps to process the data. first, input data is normalised using the same algorithm as deseq and filtered by removing the genes that are not expressed in any of the cells. second, the cramér-von mises test, the kolmogorov-smirnov test, or the likelihood ratio test is used to identify the genes with a significant change in expression between the two samples of interest. third, the transcriptional bursting model is fitted to the expression data for each gene in both samples using either the method of moments or a bayesian method. fourth, the change in parameters between the two samples is calculated for each gene. a command-line version of d3e written in python can be downloaded from github, and the source code is available under the gpl licence. furthermore, there is also a web-version available at http://www.sanger.ac.uk/sanger/generegulation_d3e. due to the time required to run d3e, the web version limits the number of genes and cells that may be analyzed, and it can only use the method of moments for estimating parameters. de analysis module to compare distributions obtained from two different sets of cells, d3e uses either the cramér-von mises test, the ks test or the likelihood ratio test to quantify the difference in gene expression. the first two tests are non-parametric which is advantageous since it allows us to apply d3e to any single-cell dataset, not just the ones collected using rna-seq. the null hypothesis for all three tests is that the two samples are drawn from the same distribution. the premise of d3e is that when two samples are drawn from the same population of cells, the test should result in a high p-value. on the other hand, if the cells are drawn from two populations with different transcript distributions, then the resulting p-value should be low. we first evaluated d3e using synthetic data. fortunately, there is a widely used, experimentally validated stochastic model available for single-cell gene expression. we refer to this model as the transcriptional bursting model, and it is characterized by three parameters: α, the rate of promoter activation; β, the rate of promoter inactivation; γ, the rate of transcription when the promoter is in the active state; and a transcript degradation rate λ. the stationary distribution of the transcriptional bursting model takes the form of a poisson-beta mixture distribution pb=poi∧xbeta=γne−γ/λΓΓλnΓΓΓΦαλ,αλ+βλ+n;γλ, where n is the number of transcripts of a particular gene, x is an auxiliary variable, Γ is the euler gamma function, and Φ is the confluent hypergeometric function. an important feature of the poisson-beta distribution is that the three parameters α,β and γ are normalised by the rate of mrna degradation λ. consequently, when fitting the parameters for the poisson-beta distribution from a stationary sample, only three parameters can be estimated, and they are unique up to a common multiplicative factor, λ. since a single-cell rna-seq experiment corresponds to a snapshot of individual cells, it is often reasonable to assume that the samples are drawn from the stationary distribution. the inability to uniquely identify all four parameters from single-cell rna-seq data means that it is only approprite to apply the transcriptional bursting model to de analysis when λs are constant between the compared samples, or when the degradation rates are known for both samples. without knowledge of λ it is impossible to unambiguously determine how the parameters have changed. to evaluate the sensitivity of the cramér-von mises, the ks and the likelihood ratio test to changes in the parameters, we selected triplets of parameters from a range that is characteristic for single-cell rna-seq data. for each parameter triplet one of the parameters was varied, while fixing the remaining two, and a series of tests was carried out on the corresponding poisson-beta samples. for each combination of parameters, we assumed that there were cells from each condition when generating the data. the results can be summarized by a set of matrices, where rows and columns correspond to values of the varied parameter, and the elements in the matrix are p-values from the tests. ideally we would like to find high p-values on the diagonal and low p-values away from the diagonal. we used a heuristic for characterizing the pattern of p-values, and for each matrix we obtained a single score, s. when s= high p-values are only found on the diagonal, suggesting that d3e has successfully identified genes where there was a change in one of the parameters. fig. de analysis for synthetic data. a sensitivity to changes in parameters of the poisson-beta distribution for the cramér-von mises, ks and likelihood ratio tests. a lighter color denotes a low sensitivity to changes of a particular parameter. b average sensititivity scores for the panels in a as well as the run-times. c an example of a matrix which was used to assign the colors in a. here, parameters α=. and β=. while γ is varied from to on a log-scale. each element in the matrix reflects a p-value of a ks test between two poisson-beta distributions with the corresponding parameters. we expect to find high values along the diagonal, where the changes are smaller. d de analysis for the scenario where the mean is fixed but the variance is changed. d3e is able to reliably identify differentially expressed genes based on the change in the shape of distribution alone. here, the color represents the p-value for the cramér-von mises test with dark colors indicating a low value the results suggest that all three tests are capable of accurately detecting changes in the parameters in certain regions of the parameter space. for all three tests, changes in β are the most difficult to detect while changes in γ are the easiest to identify. the methods perform poorly when γ is small and either β is large or α is small. in this regime, the poisson-beta distribution is similar to the poisson distribution with a mean close to zero, and it is challenging to identify which parameter has changed, and by how much. from a biological perspective, when a transcription rate is small and a gene has a small duty cycle there are almost no transcripts produced since the promoter spends most of its time in the inactive state. therefore, changes in either of the three parameters will be difficult to distinguish. the performance of each method can be summarized by the average score across all combination of parameters and we find that the likelihood ratio test is the most accurate, followed by the cramér-von mises test and the ks test. the accuracy, however, is also mirrored by the computational costs; analyzing the data in fig. 2a takes about s for the ks-test, min for the cramér-von mises test and h for the likelihood ratio test using a macbook pro laptop with a ghz intel i processor and gb of ram. we also considered the scenario when the two distributions are different, but the mean is identical. this is a situation where it is all but impossible for methods which only use the mean to reliably detect that there has been a change in the expression profile. in contrast, d3e is able to reliably identify a change in expression. our results show that a change of α and β by a factor of which is roughly equivalent to changing the variance by the same factor, is sufficient for the p-value to drop below. for a sample of cells. a particular challenge for de analysis is to determine the p-value threshold for when a change can be considered significant. the traditional approach is to use a fixed value, e.g.. and then adjust for multiple hypothesis testing. for d3e two different methods are offered for selecting the critical p-value. on the one hand, the user can specify a false discovery rate, and the tool will use the benjamini-hochberg procedure to identify the critical p-value. alternatively, one may take an empirical approach whereby one of the two samples is first split into two parts. by definition, the two parts should have identical distributions for all genes, which means that it can be used as a negative control. d3e applies one of the three tests to the negative control, and records the lowest p-value identified, p∗. when comparing the two original distributions, only genes with a p-value below a×p∗ are considered significant, where the default value for the parameter a is. we advice the user that the reduced sample size of the negative control set is likely to result in a less stringent cut-off than what would be expected if the negative control had the same sample size as the original data. to evaluate the heuristic strategy, we generated pair of samples with the same number of reads and cells, using identical parameter values for the samples in each pair. using the cramér-von mises test we recorded the lowest observed p-value, p∗, and we used.1×p∗ as a threshold for when to call a test significant. for both the method of moments and the bayesian method, we found that % of the genes were detected as not de. the control experiment demonstrates that d3e is capable of accurately distinguishing situations where the parameters are unchanged. to further evaluate the performance of d3e relative to other de methods, we generated additional synthetic data sets where one of the three parameters was varied while the other two were fixed as before. for each data set we designated genes as de where the parameter had changed by at least a factor of, or the arbitrary decision of what constitutes a significant change allows us to define the calls of the de algorithms as either true positive, false positive, true negative or false negative. the results can be summarized as a roc curve, and again we find that changes in β are more difficult to detect compared to the other two parameters. importantly, we find that for larger parameter changes, d3e is always amongst the best performing methods. fig. comparison of de methods for synthetic data. each panel shows the receiver operator characteristics calculated for synthetic data using five different de algorithms. the numbers below each panel indicate the area under the curve. the rows correspond to different thresholds for when a gene is considered significantly changed. deseq reports na for many genes. since the na cannot be interpreted as either de or not de, we treat these calls as false, which explains the unusual shape of the roc curve and the fact that the auc value is below.5 parameter estimation module the likelihood ratio test is a parametric test, and thus it requires estimates of the parameters α, β and γ. d3e has two approaches; the method of moments which is relatively fast and a more computationally costly bayesian inference method. we evaluated the accuracy of the parameter estimates, both assuming perfect sampling as well as in the scenario when some transcripts are lost due to low starting levels of mrna. in our simulations, we first generated parameters for the poisson-beta model by drawing from a distribution similar to the one for the data reported by islam et al.. we then assumed that the dropout probability scaled with the mean expression level as pdropout=1−e−μ2/b, where the parameter b controls the rate of dropouts. in our simulations we used b= and our simulations show that the relative error for the estimates of the parameters α, β and γ are relatively robust to dropout events. fig. sensitivity to transcript dropout errors. a errors for the estimates of the parameters for the synthetic data in fig. 2 a using the bayesian inference method. each bar represents the geometric mean squared relative error for the parameter estimates b errors for the estimates of the correlations between the estimated changes in parameters for the synthetic data in fig. 2 a. each bar represents the estimated pearson correlation coefficient between the log-changes of the quantities an important advantage of using the transcriptional bursting model is that it is possible to derive other quantities - the average burst size, the burst frequency, the mean expression level, and the proportion of time in the active state - which are easier to measure and interpret biologically than the parameters α, β and γ. importantly, the transcriptional bursting model allows us to learn more about how the expression level has changed between the two conditions. in the transcriptional bursting model, there are three different ways to increase the mean expression level; by decreasing the degradation rate, by increasing the burst frequency, or by increasing the burst size. by comparing the correlations between the change in mean expression levels and the change in burst size or burst frequency, it is possible to gain additional biological insights relating to what aspect has led to the change in gene expression. in contrast to the estimates of the rate parameters the correlation estimates are sensitive to dropout events, and one must thus be careful when interpreting the results. application to experimental data the tests on synthetic data suggest that d3e can reliably identify differentially expressed genes. a more useful test of the algorithm, however, involves experimental data which has been reliably validated. unlike bulk data, unfortunately there are no gold-standard datasets available. nonetheless, to further evaluate d3e, we considered the single-cell rna-seq data from two and four-cell mouse embryos where qpcr data from the same cell-types was collected for genes. unfortunately, the correlation of changes in gene expression between the qpcr and rna-seq data is even worse than the correlation of the individual samples. thus, it does not come as a surprise that the overlap between the genes which are considered de in the qpcr experiment has little overlap with genes which are considred de from rna-seq by any of the five algorithms that we compared. even so, we find large differences in the number of genes identified as de, ranging from to. to further evaluate d3e, we applied it to the two datasets collected by islam et al. from mouse embryonic stem cells and mouse embryonic fibroblasts. to establish the p-value threshold, we first separated the stem cells into two groups, and compared the expression. we used this approach for determining the threshold for d3e, scde, edger and limma, while for deseq we used the adjusted p-value reported by the software. when comparing the two cell-types, d3e identified genes as de, deseq identified genes, limma-voom identified genes, edger identified genes, and scde identified genes. surprisingly, the agreement between the five methods is quite low with only a core set of genes identified by all three methods. if we require a gene to be identified of out of methods, then an additional genes are idenitified as de, suggesting that there is a set of around genes which can confidently considered de. to further evaluate the set of genes identified as de by each method, we investigated the distiribution of fold-change values. the distributions gives an indication of how large fold changes are required for detection, and we note most of the genes have a higher expression in fibroblasts compared to stem cells. compared to deseq scde and edger, we also notice that d3e is able to identify genes with a lower fold change. indeed, there were several examples of genes where the change in mean expression was modest, but they were still identified by d3e as differentially expressed. fig. analysis of experimental data. a histogram showing the fold-changes for the genes which were considered significantly changed and not changed for d3e, deseq limma, edger and scde. b histograms showing the distribution of parameter values for all cells from. from top to bottom, the panels represent the frequency, the burst size, the inferred rates for the transcriptional bursting model, and the duty cycle. c examples of two genes, cdc42bpb in the top panel and hist1h2bb in the bottom panel, which were identified as de by d3e. in both cases, the change in mean expression is less than % whereas the variance increases by >10-fold. d karnaugh table showing the number of genes identified as differentially expressed by d3e, scde, limma, edger, and deseq for the two datasets collected by islam et al.. e scatterplots showing the mean in mescs, and the fold-change, as well as the fold-change of the mean compared to the change in degradation rate, burst frequency and burst size. in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e next, we took advantage of the transcriptional bursting model underlying d3e, and we fitted the parameters α, β, and γ for all genes. we found that for % of the genes, at least one of the parameters changed by at least 2-fold, suggesting that there are substantial differences between the two cell-types. the results show that all three parameters follow log-normal distributions, spanning approximately one or two orders of magnitude in both cell-types. with the exception of the duty cycle which is constrained to be in the interval, the derived quantities showed a similar distribution. we calculated the three derived quantities for each condition for the genes where we were able to obtain degradation rates for both cell-types. next, we compared the changes in degradation rate, burst frequency and burst size to the change in mean expression level. the results clearly demonstrate that it is the change in burst size which underlies the change in mean expression levels, suggesting that altering the burst size is the driving mechanism behind differences in mean expression between conditions. however, considering our simulation experiments, it is likely that the true correlation is lower. another property of interest is the coefficient of variation, defined as the standard deviation divided by the mean, which is used to quantify the gene expression noise. the cv is inversely correlated with the mean, and the transcriptional bursting model reveals that the change in cv is mainly correlated with the change in the duty cycle, while the effect of a change in burst size is considerably smaller. to further demonstrate the use of the transcriptional bursting module, we also investigated changes in the auto-correlation times of each gene. the auto-correlation provides information about the time-scale of the noise, i.e. how quickly the gene expression level varies. the expected value of the autocorrelation, τc, is given by τc=σ2μλ+1α+β. comparison of τc and the change in the mean for the islam et al. data reveals that the two quantities are strongly correlated. however, when investigating all the quantities on the right hand side of eq. the comparison shows that it is the change in variance which is most strongly correlated with the change in autocorrelation times. we also applied the methodology to cells from the early and late blastocyst from mouse embryos. since we do not have access to degradation rates for these cell-types, not all of the correlations can be explored. nevertheless, the correlations that can be calculated are largely similar to the ones observed for the islam et al. data. taken together, these results demonstrate that it is possible to generate testable hypotheses about how changes in the property of a gene has come about. discussion de analysis is one of the most common uses of bulk rna-seq, and we expect that it will become an important application for single-cell rna-seq as well. here, we have presented d3e, a tool for analyszing de for single-cell data. the main difference between d3e and other methods is that d3e compares the full distribution of each gene rather than just the first moment. therefore, it becomes possible to identify genes where the higher moments have changed, with the mean remaining constant. to the best of our knowledge, d3e is the first method for de analysis which considers properties other than the first and second moment of the distribution. using synthetic data, we demonstrate that d3e can reliably detect when only the shape, but not the mean is changed. one of the main challenges in developing a de analysis method for single-cell rna-seq data is that, unlike for bulk data, there are no gold-standards available. comparison of qpcr and rna-seq data revealed only a modest correlation between the two methods, implying that the two methods are inconsistent. thus, one must resort to synthetic data for evaluation. fortunately, for single-cell gene expression, there is an analytically tractable transcriptional bursting model available which has been experimentally validated. even with synthetic data, however, it is not obvious how one should define a change in expression. consider the situation where one of the parameters changes by a small amount which is just sufficient to be detected given the limits of the technical noise, the read depth and the sample size. then the question is whether or not the change is sufficient to be biologically meaningful. another challenge stems from the difficulty of disentangling the technical and the biological noise. the transcriptional bursting model does not account for the technical noise in single-cell experiments which can be considerable. since each cell can only be sequenced once, one cannot carry out technical replicates in the same way that can be done for bulk experiments. given the lack of ground truth and the difficulties involved in rigorously defining change in gene expression at the single-cell level, we recommend that more than one algorithm is used to identify de genes. if the aim is to identify the genes which are most likely to have changed significantly, we believe that a consensus approach is the best one to use. such a strategy will minimize the number of false positives with the drawback of increasing the number of false negatives. d3e implements two different non-parametric methods and one parametric method for comparing probability distributions. the methods emphasize different aspects of the distributions, and they are also associated with different computational costs. an important future research question is to determine what method is the most appropriate for single-cell de analysis. since the results are sensitive to technical noise, such developments should ideally be carried out taking the specific details of the protocol into consideration. we have shown that the transcriptional bursting model makes it possible to extract additional, biologically relevant results from the de analysis. however, to be able to fully utilize the transcriptional bursting model, the mrna degradation rates must be known, or assumed to be constant. determining degradation rates directly remains experimentally challenging, and today they are only available for a handful of cell-types. however, alternative strategies have been proposed, whereby degradation rates are estimated from rna-seq data using distribution of reads along the length of a gene. the rna-seq based methods make it possible to estimate degradation rates without further experiments, and they could thus significantly expand the range of samples where the transcriptional bursting model can be applied. another restriction of our method is that the groups of cells must be known in advance. in many cases, e.g. when comparing samples from a mutant and wild-type or when comparing different stages of development, it is straightforward to assign labels to cells. however, there are also situations, e.g. when analyzing a tissue-sample, when the cell-labels are unknown and in these scenarios d3e is no longer applicable.  our work combines three important aspects of genomics - high-throughput sequencing technologies, computational data analysis, and systems biology modelling. in the present study, we have combined single cell rna-seq, non-parametric comparison of distributions and an analytical model of stochastic gene expression which allows us to extract biologically meaningful quantities, providing insights not just about which genes have changed between two conditions, but also how the change has come about. implementation cramér-von mises criterion to compare two empirical distributions of read counts from different cell samples, the cramér-von mises test was used. let x x …xn and y y …ym be the observed read counts for the two samples. given ranks qi and si of the read-counts from the first and the second samples, in the ordered pooled sample, the cramér-von mises criterion is given by: t=unm−4nm+ where u=n∑i=1nqi−i2+m∑j=1msi−j the p-value associated with a null-hypothesis that two samples are drawn from the same distribution was calculated as: p=1−1πt∑j=0∞j− j exp−216tk t, where − j=jΓΓj!, Γ is euler’s gamma function, and kν is a modified bessel function of the second kind. the infinite sum in converges fast after the first few terms. in practice, the p-value was calculated using first terms of the sum for values of t less or equal to for values of t greater than, the p-value was set to zero. parameter estimation a fast but inaccurate method for estimating parameters of a poisson-beta distribution is a moments matching technique. the parameters can be expressed through the sample exponential moments: α=2r1r1r2−2r1r3+r2r β= γ=−r1r2+2r1r3−r2r3r1−2r2+r where ri is a successive ratio of exponential moments ei: ri=eiei− e0= for an i’th exponential moment: ei=e, where x is a sample of read counts. the parameters of a poisson-beta distribution can also be estimated by a bayesian inference method. the bayesian method is more accurate, but it requires more computational power. a gamma distribution was used as a prior for the parameters α, β and γ: α∼gamma β∼gamma γ∼gamma, where kα=kβ=kγ= θα=θβ= θγ=max{x:x∈x}, the number of read counts, x, was drawn from a poisson-beta distribution: x∼pois∧cbeta parameter estimation was performed by a collapsed gibbs sampler, using slice sampling. conditional distributions for parameters during sampling were given by: p∼betapoisson p∼gamma∏i=1nbeta p∼gamma∏i=1nbeta p∼gamma∏i=1npois likelihood ratio test the likelihood ratio test provides a parametric test for differential expression. one of the two conditions is designated as the control and the other is designated as the test conditions. for each gene, the log-likelihood of the data from the test condition is calculated using the parameters estimated for both the control and the test. we then test the null hypothesis that the ratio of the likelihoods calculated using the two parameters is not significantly different from calculating the likelihood using the poisson-beta distribution numerically is very challenging due to the presence of the confluent hypergeometric function. the methods available in python become unreliable for large values of the third argument. to be able to evaluate the poisson-beta distribution we employ a monte carlo method whereby the pdf is estimated using n randomly generated samples. n can be set by the user as a flag and the default value is. synthetic data synthetic data was produced by sampling from a poisson-beta distribution, i.e. first drawing an auxiliary variable c from beta distribution with parameters α and β: c∼beta and then drawing from a poisson distribution with parameter λ=cγ: x∼poisson. analyis of the sensitivity to evaluate how well d3e is capable of detecting changes in different regimes of the parameter space, we systematically varied the three parameters of the poisson-beta model across the range of values representative of the biological data, α∈,β∈, and γ∈. we fixed a pair of parameters and varied the third in steps over its range, recording the p-value for one of the tests. for each of the different combinations, it was assumed that the sample consisted of cells from each condition was generated. close to the diagonal, the changes in the parameters are small, and we expect a high p-value in these positions. to summarize the matrix of p-values, we calculate a composite score as s=1−1100∑i=110i−10+1100∑i=110∑j= j≠i10i, where i is the indicator function. the score s ranges between and and is obtained when all of the p-values on the diagonal are greater than. while the off-diagonal elements are smaller than. the score is mapped to a color and reported in fig. dropout analysis to evaluate the effect of experimental noise, we considered the possibility of transcript dropout events. dropouts are likely to occur either as a consequence of failure to isolate the transcript when lyzing the cell, failure of the rt reaction, or failure of the amplification. the probability of failure is poorly understood, but it has been suggested that the dropout probability can be modeled as pdropout=1−e−μ2/b, where μ is the mean expression and b is a parameter. for our dropout experiments, we randomly generated parameter triplets based on the fitted data from islam et al.. for each triplet, we changed one parameter at a time and the change was allowed to be up to 4-fold. next, we generated realizations from both distributions for cells in each condition. we used the parameter estimation module to evaluate the accuracy of the estimates for perfect samples as well as for three different values of the dropout parameter b=, normalization the normalization of the raw read counts was performed by the same method used by deseq. let xij represent the raw number of reads for i=..n and j=..m, where n is the number of genes, and m is the total number of cells in the experiment. then, the size factor sj is found as sj=medianixij∏k=1mxik1/m. the corrected read counts are then calculated as xij∗=xijsj. the size factors are calculated based on spike-ins data only if it is available. determining p-value threshold to determine the p-value threshold for d3e, we first take the sample which will be used as the control group, and split it into two non-overlapping subsets. next, one of the tests is applied to the split sample, and the lowest p-value observed, p∗, is recorded. when comparing the case and the control sets, ∗p∗ is used as a threshold, and only genes with a p-value lower than ∗p∗ are considered significant. scde reports a z-score which we transform to a p-value using the formula p=2Φ, where Φ is the cumulative density of the standard normal distribution. when choosing the threshold for scde, we used the same strategy as for d3e. for deseq we used the adjusted p-value reported by the algorithm, and we required it to be <. to be significant. calculating auto-correlation times the power spectral density, s, of the mrnas for the transcriptional bursting model is given by s=2λ2+ω2dγ+dαγ22−λ2−22+ω2dαγ22−λ where d=α/. by definition, the auto-correlation, r, is given by the inverse fourier transform of s, r=e−λ|t|dγλ+2λ2−λ2)−e−|t|22−λ the characteristic time of the auto-correlation is defined as τc=s/2r. additional files additional file figure s sensitivity to changes in parameters of the poisson-beta distribution for the cramér-von mises, ks and likelihood ratio tests similar to fig. the range over which the parameters are varied is larger here. the increased presence of lighter colors shows that for the most part it is easier to identify de genes for this set of parameters. additional file figure s change in expression levels for genes from the 2-cell and 4-cell mouse embryos as quantified using either qpcr or rna-seq. additional file table s expression levels for the genes from the 2-cell and 4-cell mouse embryos as quantified using either qpcr or rna-seq. the last six columns indicate the genes that were identified as differentially expressed by different de algorithms as well as a t-test for the qpcr data. additional file parameters for the islam et al. data without degradation rates. parameters for the genes that were expressed in both cell types. additional file parameters for the islam et al. data with degradation rates. parameters for the genes that were expressed in both cell types, and where degradation rates were available. additional file figure s scatterplots showing the mean fold-change, as well as the fold-change of the cv compared to the change in degradation rate, burst frequency, duty cycle, burst size. in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e. additional file figure s scatterplots showing the mean fold-change and the fold-change of the characteristic time, as well as the fold-change of the characteristic time compared to the change in degradation rate, variance and characteristic promoter time. in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e. additional file figure s scatterplots showing the mean fold-change, as well as the fold-change of the mean compared to the change in burst frequency, duty cycle, burst size for early vs late blastocysts from deng et al.. in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e. additional file figure s scatterplots showing the mean fold-change, as well as the fold-change of the cv compared to the change in burst frequency, duty cycle, burst size for early vs late blastocysts from deng et al.. in all panels, black dots represent genes which did not change, red dots represent genes which were deemed significant by d3e. competing interests the authors declare that they have no competing interests. authors’ contributions mh conceived the study and supervised the research, md and mh carried out the research, md wrote the code, and md and mh jointly wrote the manuscript. both authors read and approved the final manuscript. 
one of the most widespread applications of rna-seq is to identify genes which are differentially expressed between two experimental conditions. we use synthetic data to evaluate d3e, demonstrating that it can detect changes in expression, even when the mean level remains unchanged. evaluation using synthetic data shows that d3e performs better than other methods for identifying differentially expressed genes since it is designed to take full advantage of the information available from single-cell rna-seq experiments. since d3e is based on an analytically tractable stochastic model, it provides additional biological insights by quantifying biologically meaningful properties, such as the average burst size and frequency. moreover, the analytical model underlying d3e makes it possible to gain additional biological insights. the advent of high throughput rna-seq at the single-cell level has opened up new opportunities to elucidate the heterogeneity of gene expression. we use d3e to investigate experimental data, and with the help of the underlying model, we directly test hypotheses about the driving mechanism behind changes in gene expression. we present a discrete, distributional method for differential gene expression, a novel algorithm specifically designed for single-cell rna-seq data. single-cell rna-seqdifferential gene expressionstochastic gene expressionsoftwaretranscriptional bursting modelhttp://dx.doi.org/ /100004440wellcome trust http://dx.doi.org/ /501100000268biotechnology and biological sciences research council issue-copyright-statement© the author 2016
 the advent of high throughput rna-seq at the single-cell level has opened up new opportunities to elucidate the heterogeneity of gene expression. one of the most widespread applications of rna-seq is to identify genes which are differentially expressed between two experimental conditions.  we present a discrete, distributional method for differential gene expression, a novel algorithm specifically designed for single-cell rna-seq data. we use synthetic data to evaluate d3e, demonstrating that it can detect changes in expression, even when the mean level remains unchanged. since d3e is based on an analytically tractable stochastic model, it provides additional biological insights by quantifying biologically meaningful properties, such as the average burst size and frequency. we use d3e to investigate experimental data, and with the help of the underlying model, we directly test hypotheses about the driving mechanism behind changes in gene expression.  evaluation using synthetic data shows that d3e performs better than other methods for identifying differentially expressed genes since it is designed to take full advantage of the information available from single-cell rna-seq experiments. moreover, the analytical model underlying d3e makes it possible to gain additional biological insights. electronic supplementary material the online version of this article contains supplementary material, which is available to authorized users. keywords single-cell rna-seqdifferential gene expressionstochastic gene expressionsoftwaretranscriptional bursting modelhttp://dx.doi.org/ /100004440wellcome trust http://dx.doi.org/ /501100000268biotechnology and biological sciences research council issue-copyright-statement© the author 2016 