BACKGROUND
understanding biological systems regulation is one of the main challenges of systems biology.
in particular, gene expression regulation is an intrinsically dynamic phenomenon, whose characteristics can be investigated using dynamic expression data.
in this context, time series high-throughput data provide a powerful approach to identify characteristic temporal profiles of specific biological processes and to understand the transcriptional response to stimuli.
in the last years, as the sequencing costs decrease, techniques for measuring transcriptome have rapidly changed from microarray to rna sequencing .
rna-seq allows both determining transcript sequences and quantifying their abundance at the same time; thus, compared to the microarray technique, rna-seq avoids the design of specific probes, enabling a higher number of transcripts to be measured on a wider dynamic range.
there are several issues to be considered when rna-seq is used with a time series experimental design  <cit> .
current time series datasets have few biological replicates available, in general no more than three replicates  <cit> .
even if sequencing data avoid several noise issues related to microarray data, as background and cross-hybridization noise, they still need an estimate of the biological variability within the groups, otherwise there is no statistical basis for inference of differences across time and between different experimental conditions  <cit> .
once the transcript counts are generated, another important issue to be considered is data normalization, which is particularly critical for rna-seq time series data since gene expression has to be monitored on the same scale in every time point in order to correctly identify temporal patterns of gene expression.
in fact, given a transcript having the same expression level in two different samples, the probability that a read measured in a sample comes from that specific transcript depends on both the relative abundance of the transcript with respect to all the other transcripts and the total number of reads in the sample  <cit> .
to remove these biases, several normalization methods are considered in the literature.
among others, trimmed mean of m-values   <cit>  provides scaling factors to correct the library sizes calculated as a weighted mean of log ratios after filtering out the most expressed genes and the genes with the largest log ratios.
this approach has been recently shown to prevent loss of statistical power in the analysis of rna-seq data when high-count genes are present  <cit> .
once data are pre-processed, the typical workflow to analyze time series expression data includes: i) the selection of the differentially expressed  genes; ii) a clustering step to summarize the information using a limited number of representative profiles; iii) the functional analysis to associate each cluster of genes to meaningful biological annotations.
in the context of de gene selection, most of the approaches available for rna-seq data, such as edger  <cit> , deseq  <cit> , bayseq  <cit>  and the recent distribution-free method proposed by li and tibshirani  <cit> , are focused on the comparison among different groups of samples and do not take into account the inherent dependencies among samples that are characteristic of time series data.
edger  <cit>  and deseq  <cit> , have recently enabled multifactor comparison performed using a generalized linear model, but, as pointed out in a recent review  <cit> , this kind of approach is independent from the order of the time points, thus ignoring the overall dynamics.
moreover, a general issue, common to both static and dynamic high-throughput expression studies, is the control of the type i error rate.
in order to control this error rate in a multiple-testing fashion, e.g.
using false discovery rate , stringent thresholds need to be applied, thus leading to a high number of false negatives with a consequent loss of information.
this problem has become even more evident with rna-seq data, due to the higher number of monitored transcripts with respect to the previous technologies.
as regards the clustering step, classical algorithms such as k-means and hierarchical clustering are usually applied also to rna-seq data.
these methods, however, do not account for technical and biological noise and require to set, either a priori or a posteriori, the number of clusters, the distance metric or the linkage method.
alternatively, model-based methods such as bayesian clustering are able to overcome these drawbacks, but require a probabilistic model of data generation and are usually computationally demanding.
recently, a model-based clustering method specifically designed for rna-seq data was proposed by si et al.
<cit> .
specifically, this method assumes that data are generated by a mixture of probability distributions, either poisson or negative binomial, and defines a likelihood function of the mixture models representing each gene.
functional analysis is usually performed at the end of the entire analysis workflow using annotations from genomic databases such as gene ontology   <cit> , either by simply mapping the genes to known functional terms or identifying the most enriched terms, using approaches such as the recent version of gene set enrichment analysis for rna-seq data   <cit> .
keeping the functional analysis as the last step, however, may introduce a bias in itself due to both false negative genes in the selection step and wrong clustering.
moreover, the organization of functional terms in genomic databases is usually structured according to different levels of specificity of the associated biological concepts, as it happens for example for the go terms, introducing redundancy of information in the related annotations.
in this work, we address the above issues by integrating selection, clustering and functional analysis into a single analysis framework, implemented in the r package funpat.
in particular, we focus on the identification of groups of de genes characterized by both a common temporal pattern and a common biological function.
intuitively, if a gene characterized by a significant nominal p-value is excluded by the multiple tests correction but it shares the same temporal expression pattern and the same functional annotation with a set of genes selected as differentially expressed, the gene is likely to be a false negative.
as a consequence, recovering it in the pool of de genes might increase the recall without negatively affecting the precision.
funpat exploits the functional annotations of genomic databases, organizing them into gene sets, e.g.
go terms, and performing an integrated selection-clustering analysis in each gene set.
in particular, when a hierarchical structure of the functional annotations is available, as in go database, funpat searches for temporal patterns starting from the most specific gene sets and, whenever present, removes the genes selected as de from the gene sets representing more general biological concepts.
the output of funpat is a list of gene sets, each characterized by different temporal patterns and the corresponding lists of de genes.
to the best of our knowledge, there are few approaches in the literature that have been implemented for or applied to time series rna-seq data.
recently, wu and wu  <cit>  proposed a unified approach to model gene profiles based on functional principal component analysis  technique.
the method was originally tested on microarray data, but it was recently applied to rna-seq data  <cit> .
another approach originally designed to model temporal gene expression from microarray data, masigpro , was recently updated to handle time series rna-seq data and it is based on two steps of modelling based on generalized linear regression  <cit> .
both fpca and masigpro do not use any prior information from functional databases.
in the following, we present funpat and assess gene selection and clustering performance on a number of simulated datasets with known de genes and dynamic profiles, in comparison with masigpro, fpca, edger and the hierarchical, k-means and model-based clustering proposed in  <cit> .
we also consider edger in the analysis because, although not explicitly designed for time series data, the generalized linear model  allows analyzing complex experimental designs such as dynamic experiments.
to better appreciate the various facets of funpat and compare it with the other methods also on real data, we consider two different datasets, one describing the temporal response of b cell samples from different vaccinated subjects  <cit>  and the other one representing the pancreatic endocrine differentiation of human embryonic stem cells at defined developmental stages  <cit> .
methods
funpat pipeline
funpat takes as input the expression data and the functional annotations organized according to gene sets, which can be defined as go terms, pathways or other sets depending on the annotation database used as input.
a summary of funpat analysis pipeline is displayed in figure  <dig>  first, funpat assigns a p-value to each gene based on the bounded-area method described in di camillo et al.
<cit> .
for each gene, the area a of the region bounded by the gene transcriptional expression profiles in two experimental conditions , or in a single condition vs. a baseline, is calculated .
a p-value is assigned to a by evaluating its statistical significance against a null hypothesis distribution.
to do that, the available replicates are exploited to model the biological-plus-technical variability and its dependency on the mean gene expression level.
this model is then used to build the null hypothesis distribution of a, named ah <dig>  by a monte carlo resampling approach.
this method requires only at least two replicates for a single time point, thus addressing lack of fully replicated time series experiments, typical of currently available rna-seq data.
finally, different distribution models  are used to fit the entire set of ah <dig> values and the best model is chosen according to the goodness of fit and the parameter precision.
quantiles of the empirical distribution can be also used as an alternative to the above models.
exploiting the p-values assigned by the bounded-area method, funpat performs a gene selection simultaneously to a gene set-specific clustering.
first, two sets of genes are defined: seeds, i.e.
genes passing a fdr threshold chosen by the user, and candidates, i.e.
genes passing a soft-threshold applied to not-adjusted p-values .
alternatively, seeds and candidates can be provided as input by the user.
to identify the main transcriptional dynamics characterizing the expression data, funpat searches for the common temporal patterns on groups of genes belonging to the same gene set .
the core of this analysis is a linear model-based clustering  <cit> , which searches for a cluster of genes whose time series expression profile x = <x,..., x>with m time points can be modelled by the following equation:
x=k⋅p+q+Σ
where p = <p,..., p>is the characteristic temporal pattern, k and q are the gene-specific parameters of the model and Σ is the error covariance matrix.
the clustering algorithm iteratively performs an identification step of the gene-specific parameters and a temporal pattern search using an expectation-maximization approach.
a cluster is considered significant if it contains at least one seed gene and passes both a goodness of fit and a runs test.
further details of the clustering algorithm are reported in additional file  <dig>
at the end of the analysis, funpat considers a gene as significantly differentially expressed if either it is a seed gene or it belongs to a significant pattern.
intuitively, since each pattern is required to contain at least one seed gene, all genes associated to the same pattern are likely to be differentially expressed because they are highly correlated to the same temporal profile and, since the clustering is specific for each gene set, they share a common biological function or pathway.
gene sets used in funpat pipeline can be organized according to a hierarchical structure, such as the direct acyclic graph  in go database.
structured annotations provide further useful information: relationships between the biological terms in a hierarchical structure codify for the specificity of some terms with respect to others and can help to associate genes to the most informative terms avoiding redundant annotations.
when structured information is available, funpat assumes that genes annotated to a gene set are also annotated to all its ancestors and that the farther the gene set is from the root node, the more specific information it conveys.
funpat performs the clustering starting from the gene sets associated to the most specific terms and then removes all the genes belonging to a significant pattern from the ancestor nodes, similarly to what has been proposed by alexa et al.
<cit>  in the context of the functional enrichment analysis.
since similar temporal patterns can be identified for different gene sets, funpat applies a second clustering step to identify the main patterns characterizing the data.
each main pattern thus represents groups of gene sets characterized by highly-correlated temporal patterns of de genes .
funpat implementation
funpat is provided in r/bioconductor with the related documentation, it is open source under the gpl- <dig> license and it requires r version  <dig> .
<dig> or higher to perform the analyses.
as output, funpat reports the selected genes and gene sets into simple tab delimited .txt files and plots the temporal patterns on separate .pdf files.
the package allows the user to easily display the results into html tables with sortable and filterable columns, plots and hyperlinks to other data sources such as ncbi and go databases.
figure  <dig> shows an example of the final report summarizing the information on the identified main patterns.
other two html reports are generated by funpat displaying the output of the bounded-area method and the temporal pattern profiles associated to each gene set .
rna-seq time series data simulation
in order to assess funpat pipeline performance in terms of selection of de genes and correct identification of the temporal patterns, its application to simulated time series data was tested.
<dig> time series datasets were generated, simulating a dynamical response measured in two different conditions: treatment and control.
each dataset is characterized by n =  <dig> genes monitored over m =  <dig> time samples.
<dig> genes were simulated as differentially expressed, belonging to s =  <dig> different temporal patterns , representing the log fold-changes of expression levels over time induced by the treatment with respect to the control.
in particular, the expression profile θf of a given gene f was modelled on log scale as follows:
log)=kf⋅pj+qft= <dig> ...,m- <dig>
where pj  is the temporal pattern reflecting the changes in gene expression levels in response to treatment and kf , qf are gene-specific parameters.
qf was sampled from a normal distribution n and kf was sampled from a uniform distribution in the interval .
each pattern pj was used to simulate the expression profiles of  <dig> de genes, for a total of  <dig> de genes.
the log fold-changes of the remaining  <dig> genes were simulated as:
log)=qft= <dig> ...,m- <dig>
assuming that the genes are single-isoform and have the same length for all the simulated transcripts, the probability that a read comes from a gene f can be computed, for each time point t, as:
πf= θf∑f=1nθft= <dig> ...,m- <dig>
πf was used to obtain the final transcripts counts, using a negative binomial distribution nb, φ), where r is the sequencing depth and φ is the dispersion parameter.
the sequencing depth of each sample was sampled from a uniform distribution in the interval  <cit>  and the dispersion parameter was set to φ =  <dig> .
three replicates were generated for each time point.
simulated data were finally normalized according to the tmm method  <cit> .
in particular, the normalization factors were re-scaled by the median of the normalized library sizes and then used to obtain the normalized read counts.
finally, each cluster of de genes was associated to a common specific go term.
to each of these go terms, a random number of non-de genes was also associated, ranging between  <dig> and  <dig>  the remaining not-de genes were randomly associated to other randomly chosen go terms.
r packages go.db and org.hs.eg.db were used to define the dag structure of go terms and the go annotations, respectively.
performance evaluation
funpat was tested to evaluate its ability to: 1) recover false negatives in the selection of de genes without decreasing the false discovery rate; 2) correctly cluster the genes associated to the same temporal pattern; 3) give reproducible results on independent replicates.
the statistical significance of all the comparisons done was evaluated using two-sided wilcoxon signed-rank test.
selection of de genes
selection performance was assessed in terms of precision  and recall  in detecting the  <dig> simulated de genes.
funpat selection performance was compared to edger and two existing methods specifically designed for time series expression data: masigpro, using the new generalize linear model for the rna-seq data  <cit> , and the fpca-based approach proposed in wu and wu  <cit> .
in the comparison, we also considered the stand-alone application of the bounded-area method in order to evaluate if the integration of gene selection with the clustering step and the functional annotation is able to improve the recall without loss in precision.
edger was applied to the data using the glm application, by defining two factors for the model: one indicating the treatment/control samples, and the other indicating the corresponding time point, as suggested in  <cit> .
masigpro applies two generalized linear regression steps to model gene expression in time series expression data.
in particular, the former generates for each gene an anova table and the related p-values; the latter is a stepwise regression analysis applied only to the genes with significant p-value.
the goodness of fit of the obtained models, namely r <dig>  can optionally be used to perform an additional gene selection step.
in the evaluation of masigpro on our simulated data we used the latest version adapted for rna-seq data  <cit> , considering the results obtained by both the first regression step  and setting a threshold on r <dig> equal to  <dig>  .
in both regression steps the same two factors defined for edger were considered for the generalized linear model.
differently from the above methods, the fpca-based approach  <cit>  integrates principal component analysis into an hypothesis testing framework, identifying data-driven eigenfunctions representing the expression trajectories.
the related test, publicly available at the immune modeling community web portal repository  <cit>  was used to perform the gene selection on our data.
identification of temporal patterns
the ability to correctly associate the expression profiles to the corresponding simulated patterns was assessed in terms of clustering precision  and recall , defined as described in figure  <dig>  the two scores were calculated by matching each identified profile to one of the simulated patterns looking at the maximum intersection between the groups of genes identified by the clustering method and those assigned to a cluster by the simulation, respectively.
c-precision was calculated as true positives, i.e.
the number of genes in the intersection, divided by the number of genes associated to the identified profile; the c-recall was calculated as true positives divided by the number of genes  associated to the simulated pattern.
figure  <dig> provides a toy example.
in addition to c-precision and c-recall, we also considered the normalized mutual information  to quantify the shared information between the simulated partition and the clustering results.
specifically, mutual information was calculated using the contingency table obtained by the true partition and the clustering results; since the mutual information has no upper bounds, its normalized version, ranging between  <dig> and  <dig>  was used  <cit> .
funpat clustering performance was compared to the hierarchical and k-means clustering approaches and to a model-based method recently adapted for rna-seq data  <cit> .
the number of clusters obtained as output by funpat was used to set the number of clusters for all the other methods.
reproducibility of de gene lists
as a further evaluation, we considered the reproducibility of the results to assess the ability of each method to detect the same de genes when it is applied independently on available independent replicates.
we applied funpat and the other selection methods to each single replicate and evaluated the reproducibility of the resulting lists of de genes in terms of intersection across the three replicates divided by the minimum list size, i.e.
the smallest list size among the lists of de genes identified for each replicate.
the same evaluation was also applied to two different real datasets  <cit> , focusing also on the ability of funpat to obtain biologically interpretable results.
RESULTS
selection of de genes
the ability of funpat and the other selection methods to select the simulated de genes is displayed in figure  <dig>  funpat is able to significantly increase the average recall with respect to the stand-alone application of the bounded-area method from  <dig>  to  <dig>  , without changing the false discovery rate .
in terms of recall, funpat outperforms also all the other selection methods considered.
edger shows the same average precision of funpat , but the recall is significantly lower .
without any thresholds on r <dig>  masigpro obtains a precision equal to  <dig>  and an average recall equal to  <dig> , both significantly lower than those obtained by funpat .
when the default  <dig>  threshold on r <dig> is applied, the number of genes selected by masigpro drastically drops , obtaining an average precision equal to  <dig>  but at the expense of the recall, equal to  <dig>  on average.
a similar result is obtained by fpca, showing an average precision and recall equal to  <dig>  and  <dig> , respectively .
identification of temporal patterns
the correct identification of the simulated patterns was tested against the hierarchical , the k-means , implemented in masigpro, and the model-based clustering  method described in si et al.
<cit> .
in order to evaluate the clustering performance independently from the selection step, we assigned the genes selected by funpat as input to the hierarchical, the k-means and the model-based clustering.
the number of clusters obtained as output by funpat was used to set the number of clusters for all the other methods.
boxplots in figure  <dig> summarizes the obtained results.
funpat shows high c-precision  and c-recall  in cluster detection, both significantly higher with respect to hc .
kc and mbc show significantly higher c-precision , but at the expense of the c-recall, on average  <dig>  and  <dig>  respectively, compared to an average of  <dig>  of funpat, with p-values always lower than 1e- <dig>  moreover, funpat shows the best nmi with average  <dig> , compared to  <dig> ,  <dig>  and  <dig>  obtained by hc, kc and mbc, respectively , reflecting that the de genes selected by funpat are well-distributed across the clusters.
reproducibility of de gene lists
considering the analysis applied to each single time series replicate, we wanted to assess, for each simulated dataset, whether the lists are also reproducible across the replicates.
figure  <dig> reports the boxplots of the intersection divided by the minimum list size for the  <dig> simulated datasets, comparing the three lists of de genes obtained from the three replicates of each dataset.
the best performing method is funpat .
edger shows a lower reproducibility  as well as masigpro , with p-values always below 4e- <dig> with respect to funpat.
compared to all the other methods, the reproducibility of fpca drastically drops, since in many datasets it does not select any genes.
application to real datasets
in order to better appreciate the various facets of the presented approach, funpat and the other selection methods considered in the performance evaluation on the simulated data were also applied to two publicly available datasets.
the first dataset represents the time varying b cell vaccine responses  analyzed by rna-seq in five different subjects  <cit> .
the study focuses on the identification of both common genes and patient-specific dynamics, since, on one hand, a number of immune response features should be common across subjects, on the other, it is known that influenza vaccines produce highly variable b cell responses among different individuals.
in the original study, each gene was tested for differential expression using the fpca-based approach  <cit> , using a 5% fdr threshold to account for multiple testing.
the authors reported a union set of  <dig> de genes across the five subject, of which less than 1% belongs to the intersection set.
interestingly, three subjects that, differently from the other two, were vaccinated within the previous three years show much higher similarity with a union set of  <dig> genes, of which around 13%  are in common.
funpat was applied to each subject independently, using a fdr threshold equal to 5% to define the seeds.
go annotations and go dag derived from r packages org.hs.eg.db and go.db respectively were considered.
<dig> genes resulted differentially expressed across the five subjects.
of these, only  <dig> % are in common among all the subjects, consistently with the original study .
however, when considering the three previously vaccinated individuals, funpat identified a union set of  <dig> genes of which 21%  are in common across the subjects, in comparison with the 13% obtained in the original study.
considering the list of  <dig> genes in common, about 60%  were selected in the same three subjects also in  <cit> .
applied to the same dataset, masigpro selected  <dig> and  <dig> genes without thresholds on r <dig> and with the default threshold of  <dig> , respectively.
these results are characterized by a very low intersection between the gene lists, with no more than  <dig> % in common among all the subjects, and no more than 2% considering the three subjects previously vaccinated.
the high overlap observed with both funpat and fpca among the three subjects is not achieved by masigpro, which provides a signature of  <dig> and  <dig> genes in the intersection of the gene lists for r2> <dig> and r2> <dig> , respectively.
in the former list, only  <dig> genes are in common with the signature reported in  <cit> .
the selected gene in the latter list, cdca <dig>  results selected also in  <cit> .
differently from the simulated data, for which we have a defined list of true de genes as a benchmark to compare the methods, here we do not know the real truth.
however, in the original study the signature of  <dig> genes in common among the three previously vaccinated subjects were shown in strong correlation with migrating plasma cells.
in a memory response to influenza vaccination, resting memory b cells are induced to differentiate through several stages into plasmablast and long-lived plasma cells, thus a higher overlap among the three subjects previously vaccinated is expected.
compared to masigpro, funpat is able to describe a better correspondence among these subject, in accordance with the validation made in the original study.
as a further support to this result, funpat is also able to indentify subject-specific patterns in common gene sets across the five subjects.
as an example, the biological process cell differentiation and the associated dynamic patterns are shown in figure  <dig>  cell differentiation is an important process in vaccination, since b cells are induced to differentiate through several stages into long-lived plasma cells.
subjects  <dig>   <dig> and  <dig>  vaccinated within the previous three years, share a similar dynamic response with respect to the other two subjects in this gene set.
interestingly, these patterns are characterized by different timing of peaks of expression level and by less or more gradual changes in gene expression, showing subject-specific temporal responses highlighted also in the original study.
compared to fpca and masigpro, which do not use prior information, funpat is able to automatically associate these patterns to their common functional annotation, thus allowing an easier interpretation of the results.
unfortunately, it was not possible to test edger in this dataset since un-normalized count data, required by this method, are not provided.
as a further assessment of the reproducibility of the gene lists, we considered a second real dataset representing the gene expression changes at defined stages during pancreatic endocrine differentiation of human embryonic stem cells  <cit> .
the authors kindly provided us the count data in order to use also edger.
experiments were performed on two independent biological replicates, monitoring the temporal differentiation pattern from human embryonic stem cells  towards the pancreatic fate.
here, we focused on the first five developmental stages, comparing the temporal expression profiles with respect to a reference ground state, set to the hescs population.
we applied funpat, edger, masigpro and fpca to both biological replicates independently, normalizing the count data using the tmm approach.
since for the time series based on developmental stages the number of resulting de genes and biological mechanisms involved is usually high, here we wanted to focus on the most important processes characterizing the temporal patterns observed.
therefore, we decided to use bonferroni correction on p-values of edger, fpca and those used to define the seed genes in funpat.
masigpro was applied using the  <dig>  threshold on r <dig> in order to deal with the most differentially expressed genes.
go annotations and go dag derived from r packages org.hs.eg.db and go.db respectively were used in funpat.
as done for the simulated data, the overlap between the lists was calculated in terms of intersection divided by the minimum list size, i.e.
the smallest list size among the lists of de genes identified for each replicate.
comparing for each method the two lists of de genes resulted from the replicates, both funpat and edger show the highest overlap  with respect to masigpro  and fpca .
results confirm what observed in the simulated data and, considering also the results obtained in the first real dataset, it seems that, differently from masigpro and fpca, funpat is able to provide more stable lists of de genes, thus increasing the biological interpretability of the results.
discussion
a novel analysis framework, implemented in the r package funpat, was developed to search for the main temporal patterns in classes of functional gene sets and to improve the gene selection by integrating the statistical evidence of differential expression with the information on the temporal profiles and the functional annotations.
in particular, funpat implements a differential expression analysis able to consider differences between two experimental conditions, taking into account the entire temporal expression profiles.
the method is based on a model of the biological-plus-technical variability and of its dependence on the average gene expression; it is not constrained by any specific statistical distributions, thus allowing its application to rna-seq data pre-processed in different ways and, in general, to different technologies.
it is important to note that, although the method is robust to different data pre-processing approaches, data need to be normalized before using funpat in order to correct for differences in sequencing depth and guarantee an accurate estimate of the biological-plus-technical variability after the removal of systematic biases.
in a conventional analysis, the user selects the genes using some correction method to adjust the p-values for multiple testing and then applies the clustering independently with respect to the selection step.
a side effect of this approach is that the clustering is too constrained by the results obtained in the selection step, where the need to control the type i error rate in a multiple testing condition leads to very small significant thresholds, thus increasing the number of false negatives.
to overcome this drawback, funpat combines the information on p-values with both functional annotations and characteristic temporal pattern associations, thus decreasing the number of false negatives without significantly increasing the false discovery rate.
the clustering method is based on a linear model, does not require the user to fix the number of clusters and is not computationally demanding.
since the model is purely based on a least squares method, the algorithm is flexible for applications to data from different platforms and/or processed in different ways.
finally, significant genes are associated to the most informative gene sets, avoiding the redundancy of information on gene sets representing general biological functions.
in particular, funpat exploits, when available, the hierarchical structure of the annotations starting the search of the temporal patterns from the most specific functional terms and removing the selected genes from the ancestors, as originally proposed by alexa et al.
<cit>  in the context of functional enrichment.
however, it is worth noting that funpat does not perform any enrichment analysis on the selected genes, but only exploits annotations to select de genes characterized by both a common temporal pattern and a common biological function.
considering the application to the simulated data, both selection and clustering performance confirm that funpat is able to provide, with respect to all the other methods considered in this study, the best trade-off between precision vs. recall and c-precision vs. c-recall, respectively.
moreover, funpat shows the best reproducibility of the identified lists of de genes with respect to the other methods.
more specifically, funpat shows almost comparable precision with respect to edger, but it outperforms this latter in terms of recall.
funpat also outperforms masigpro in terms of both precision and recall when no thresholds on r <dig> are imposed.
on the other hand, the choice of the default setting  leads to a precision equal to  <dig> at the expense of a marked drop in recall, consistently below or equal to  <dig>  for all the simulated datasets.
compared to funpat, edger and masigpro, fpca shows the worst performance in terms of recall and reproducibility, selecting few de genes, although with good precision.
even if both fpca and masigpro with r2> <dig>  show a higher precision with respect to funpat and edger , the reproducibility assessment shows that these methods tend to select different lists of true positive genes across different biological replicates of the same dataset.
as regards the identification of the temporal patterns, funpat outperforms in terms of c-recall with respect to all the other methods.
even if k-means and the model-based method show a higher c-precision, they present the lowest average recall, thus not providing the same trade-off between c-precision and c-recall of funpat.
as a further support of this result, funpat outperforms all the methods also in terms of nmi score, thus highlighting the ability of funpat to provide more well-distributed clusters with respect to k-means and the model-based method, characterized by the lowest average nmi scores.
finally, focusing on the definition of seeds and candidates defined by funpat using the p-values obtained by the bounded-area method, one may wonder if the selection performance would be affected by a selection method different from the bounded-area.
considering the simulated data, when three replicates are available, the performance obtained using either edger or the bounded-area method are almost comparable .
when the two methods are applied to a single replicate, the bounded-area method, which was specifically designed for time series in data-poor conditions, is able to select a higher number of genes  than edger , maintaining, as edger, good precision, not statistically different with respect to a required false discovery rate equal to 5%, but showing a higher recall .
our conclusion is that different methods can be used to assign the input p-values to the list of analyzed transcripts and to define seeds and candidates, but it is advisable to base the choice on the dataset characteristics.
in particular, it is worth noting that funpat outperforms the other methods also when data suffers from missing replicates.
obtained results, illustrated in additional file  <dig>  show a pattern similar to that observed in figure  <dig> and emphasize the higher gain in recall of funpat with respect to all the other methods.
this result is also supported by the application of funpat to the two real datasets considered in this study, for which the methods were always applied to single replicates.
CONCLUSIONS
funpat is an r package that integrates gene selection, clustering and functional annotations into a single analysis framework, providing clusters of de genes associated to temporal patterns and specific biological terms.
tested on simulated time series data, funpat shows better performance with respect to both the selection and the clustering step.
the integration of the selection and the clustering step is able to improve the recall without altering the false discovery rate with respect to a stand-alone selection step.
moreover, the ability to identify different time series expression patterns is higher than that observed using hierarchical, k-means or model-based clustering approaches specifically designed for rna sequencing data.
finally, when data are characterized by missing experimental replicates, funpat is able to provide highly reproducible lists of de genes.
the application to two real datasets confirms the ability of funpat to select differentially expressed genes with high reproducibility on different time series expression data, thus indirectly confirming the ability of funpat to select genes with high precision and recall.
competing interests
the authors declare that they have no competing interests.
authors' contributions
ts helped in conceiving the study, designed funpat pipeline code and prepared the r package, did the analyses on simulated and real data and wrote the manuscript.
ff designed the simulation code and generated the normalized simulated datasets.
bdc conceived and supervised the study, designed funpat pipeline code and wrote the manuscript.
all authors have read and approved the manuscript in its current form.
supplementary material
additional file 1
funpat linear model-based clustering algorithm.
detailed description of the clustering method used in funpat pipeline for searching the temporal patterns, including the pseudo-code of the algorithm.
click here for file
additional file 2
output examples of html reports.
html reports generated by funpat displaying the output of the bounded-area method and the temporal pattern profiles associated to each gene set.
click here for file
additional file 3
results of selection and clustering performance on single replicate.
description of the selection and clustering performance of the methods when they are applied independently on the available replicates.
click here for file
acknowledgements
we thank jonathan schug and maike sander for kindly providing us the count data of the study on the pancreatic endocrine differentiation of human embryonic stem cells.
declarations
publication of this article has been funded by prat  <dig> cpda <dig> .
this article has been published as part of bmc genomics volume  <dig> supplement  <dig>  2015: proceedings of the italian society of bioinformatics : annual meeting 2014: genomics.
the full contents of the supplement are available online at http://www.biomedcentral.com/bmcgenomics/supplements/16/s <dig>

 understanding biological systems regulation is one of the main challenges of systems biology. in particular, gene expression regulation is an intrinsically dynamic phenomenon, whose characteristics can be investigated using dynamic expression data. in this context, time series high-throughput data provide a powerful approach to identify characteristic temporal profiles of specific biological processes and to understand the transcriptional response to stimuli. in the last years, as the sequencing costs decrease, techniques for measuring transcriptome have rapidly changed from microarray to rna sequencing. rna-seq allows both determining transcript sequences and quantifying their abundance at the same time; thus, compared to the microarray technique, rna-seq avoids the design of specific probes, enabling a higher number of transcripts to be measured on a wider dynamic range. there are several issues to be considered when rna-seq is used with a time series experimental design. current time series datasets have few biological replicates available, in general no more than three replicates. even if sequencing data avoid several noise issues related to microarray data, as background and cross-hybridization noise, they still need an estimate of the biological variability within the groups, otherwise there is no statistical basis for inference of differences across time and between different experimental conditions. once the transcript counts are generated, another important issue to be considered is data normalization, which is particularly critical for rna-seq time series data since gene expression has to be monitored on the same scale in every time point in order to correctly identify temporal patterns of gene expression. in fact, given a transcript having the same expression level in two different samples, the probability that a read measured in a sample comes from that specific transcript depends on both the relative abundance of the transcript with respect to all the other transcripts and the total number of reads in the sample. to remove these biases, several normalization methods are considered in the literature. among others, trimmed mean of m-values provides scaling factors to correct the library sizes calculated as a weighted mean of log ratios after filtering out the most expressed genes and the genes with the largest log ratios. this approach has been recently shown to prevent loss of statistical power in the analysis of rna-seq data when high-count genes are present. once data are pre-processed, the typical workflow to analyze time series expression data includes: i) the selection of the differentially expressed genes; ii) a clustering step to summarize the information using a limited number of representative profiles; iii) the functional analysis to associate each cluster of genes to meaningful biological annotations. in the context of de gene selection, most of the approaches available for rna-seq data, such as edger, deseq, bayseq and the recent distribution-free method proposed by li and tibshirani, are focused on the comparison among different groups of samples and do not take into account the inherent dependencies among samples that are characteristic of time series data. edger and deseq, have recently enabled multifactor comparison performed using a generalized linear model, but, as pointed out in a recent review, this kind of approach is independent from the order of the time points, thus ignoring the overall dynamics. moreover, a general issue, common to both static and dynamic high-throughput expression studies, is the control of the type i error rate. in order to control this error rate in a multiple-testing fashion, e.g. using false discovery rate, stringent thresholds need to be applied, thus leading to a high number of false negatives with a consequent loss of information. this problem has become even more evident with rna-seq data, due to the higher number of monitored transcripts with respect to the previous technologies. as regards the clustering step, classical algorithms such as k-means and hierarchical clustering are usually applied also to rna-seq data. these methods, however, do not account for technical and biological noise and require to set, either a priori or a posteriori, the number of clusters, the distance metric or the linkage method. alternatively, model-based methods such as bayesian clustering are able to overcome these drawbacks, but require a probabilistic model of data generation and are usually computationally demanding. recently, a model-based clustering method specifically designed for rna-seq data was proposed by si et al.. specifically, this method assumes that data are generated by a mixture of probability distributions, either poisson or negative binomial, and defines a likelihood function of the mixture models representing each gene. functional analysis is usually performed at the end of the entire analysis workflow using annotations from genomic databases such as gene ontology, either by simply mapping the genes to known functional terms or identifying the most enriched terms, using approaches such as the recent version of gene set enrichment analysis for rna-seq data. keeping the functional analysis as the last step, however, may introduce a bias in itself due to both false negative genes in the selection step and wrong clustering. moreover, the organization of functional terms in genomic databases is usually structured according to different levels of specificity of the associated biological concepts, as it happens for example for the go terms, introducing redundancy of information in the related annotations. in this work, we address the above issues by integrating selection, clustering and functional analysis into a single analysis framework, implemented in the r package funpat. in particular, we focus on the identification of groups of de genes characterized by both a common temporal pattern and a common biological function. intuitively, if a gene characterized by a significant nominal p-value is excluded by the multiple tests correction but it shares the same temporal expression pattern and the same functional annotation with a set of genes selected as differentially expressed, the gene is likely to be a false negative. as a consequence, recovering it in the pool of de genes might increase the recall without negatively affecting the precision. funpat exploits the functional annotations of genomic databases, organizing them into gene sets, e.g. go terms, and performing an integrated selection-clustering analysis in each gene set. in particular, when a hierarchical structure of the functional annotations is available, as in go database, funpat searches for temporal patterns starting from the most specific gene sets and, whenever present, removes the genes selected as de from the gene sets representing more general biological concepts. the output of funpat is a list of gene sets, each characterized by different temporal patterns and the corresponding lists of de genes. to the best of our knowledge, there are few approaches in the literature that have been implemented for or applied to time series rna-seq data. recently, wu and wu proposed a unified approach to model gene profiles based on functional principal component analysis technique. the method was originally tested on microarray data, but it was recently applied to rna-seq data. another approach originally designed to model temporal gene expression from microarray data, masigpro, was recently updated to handle time series rna-seq data and it is based on two steps of modelling based on generalized linear regression. both fpca and masigpro do not use any prior information from functional databases. in the following, we present funpat and assess gene selection and clustering performance on a number of simulated datasets with known de genes and dynamic profiles, in comparison with masigpro, fpca, edger and the hierarchical, k-means and model-based clustering proposed in. we also consider edger in the analysis because, although not explicitly designed for time series data, the generalized linear model allows analyzing complex experimental designs such as dynamic experiments. to better appreciate the various facets of funpat and compare it with the other methods also on real data, we consider two different datasets, one describing the temporal response of b cell samples from different vaccinated subjects and the other one representing the pancreatic endocrine differentiation of human embryonic stem cells at defined developmental stages. methods funpat pipeline funpat takes as input the expression data and the functional annotations organized according to gene sets, which can be defined as go terms, pathways or other sets depending on the annotation database used as input. a summary of funpat analysis pipeline is displayed in figure first, funpat assigns a p-value to each gene based on the bounded-area method described in di camillo et al.. for each gene, the area a of the region bounded by the gene transcriptional expression profiles in two experimental conditions, or in a single condition vs. a baseline, is calculated. a p-value is assigned to a by evaluating its statistical significance against a null hypothesis distribution. to do that, the available replicates are exploited to model the biological-plus-technical variability and its dependency on the mean gene expression level. this model is then used to build the null hypothesis distribution of a, named ah by a monte carlo resampling approach. this method requires only at least two replicates for a single time point, thus addressing lack of fully replicated time series experiments, typical of currently available rna-seq data. finally, different distribution models are used to fit the entire set of ah values and the best model is chosen according to the goodness of fit and the parameter precision. quantiles of the empirical distribution can be also used as an alternative to the above models. exploiting the p-values assigned by the bounded-area method, funpat performs a gene selection simultaneously to a gene set-specific clustering. first, two sets of genes are defined: seeds, i.e. genes passing a fdr threshold chosen by the user, and candidates, i.e. genes passing a soft-threshold applied to not-adjusted p-values. alternatively, seeds and candidates can be provided as input by the user. to identify the main transcriptional dynamics characterizing the expression data, funpat searches for the common temporal patterns on groups of genes belonging to the same gene set. the core of this analysis is a linear model-based clustering, which searches for a cluster of genes whose time series expression profile x = <x,..., x>with m time points can be modelled by the following equation: x=k⋅p+q+Σ where p = <p,..., p>is the characteristic temporal pattern, k and q are the gene-specific parameters of the model and Σ is the error covariance matrix. the clustering algorithm iteratively performs an identification step of the gene-specific parameters and a temporal pattern search using an expectation-maximization approach. a cluster is considered significant if it contains at least one seed gene and passes both a goodness of fit and a runs test. further details of the clustering algorithm are reported in additional file at the end of the analysis, funpat considers a gene as significantly differentially expressed if either it is a seed gene or it belongs to a significant pattern. intuitively, since each pattern is required to contain at least one seed gene, all genes associated to the same pattern are likely to be differentially expressed because they are highly correlated to the same temporal profile and, since the clustering is specific for each gene set, they share a common biological function or pathway. gene sets used in funpat pipeline can be organized according to a hierarchical structure, such as the direct acyclic graph in go database. structured annotations provide further useful information: relationships between the biological terms in a hierarchical structure codify for the specificity of some terms with respect to others and can help to associate genes to the most informative terms avoiding redundant annotations. when structured information is available, funpat assumes that genes annotated to a gene set are also annotated to all its ancestors and that the farther the gene set is from the root node, the more specific information it conveys. funpat performs the clustering starting from the gene sets associated to the most specific terms and then removes all the genes belonging to a significant pattern from the ancestor nodes, similarly to what has been proposed by alexa et al. in the context of the functional enrichment analysis. since similar temporal patterns can be identified for different gene sets, funpat applies a second clustering step to identify the main patterns characterizing the data. each main pattern thus represents groups of gene sets characterized by highly-correlated temporal patterns of de genes. funpat implementation funpat is provided in r/bioconductor with the related documentation, it is open source under the gpl- license and it requires r version. or higher to perform the analyses. as output, funpat reports the selected genes and gene sets into simple tab delimited.txt files and plots the temporal patterns on separate.pdf files. the package allows the user to easily display the results into html tables with sortable and filterable columns, plots and hyperlinks to other data sources such as ncbi and go databases. figure shows an example of the final report summarizing the information on the identified main patterns. other two html reports are generated by funpat displaying the output of the bounded-area method and the temporal pattern profiles associated to each gene set. rna-seq time series data simulation in order to assess funpat pipeline performance in terms of selection of de genes and correct identification of the temporal patterns, its application to simulated time series data was tested. time series datasets were generated, simulating a dynamical response measured in two different conditions: treatment and control. each dataset is characterized by n = genes monitored over m = time samples. genes were simulated as differentially expressed, belonging to s = different temporal patterns, representing the log fold-changes of expression levels over time induced by the treatment with respect to the control. in particular, the expression profile θf of a given gene f was modelled on log scale as follows: log)=kf⋅pj+qft=...,m- where pj is the temporal pattern reflecting the changes in gene expression levels in response to treatment and kf, qf are gene-specific parameters. qf was sampled from a normal distribution n and kf was sampled from a uniform distribution in the interval. each pattern pj was used to simulate the expression profiles of de genes, for a total of de genes. the log fold-changes of the remaining genes were simulated as: log)=qft=...,m- assuming that the genes are single-isoform and have the same length for all the simulated transcripts, the probability that a read comes from a gene f can be computed, for each time point t, as: πf= θf∑f=1nθft=...,m- πf was used to obtain the final transcripts counts, using a negative binomial distribution nb, φ), where r is the sequencing depth and φ is the dispersion parameter. the sequencing depth of each sample was sampled from a uniform distribution in the interval and the dispersion parameter was set to φ =. three replicates were generated for each time point. simulated data were finally normalized according to the tmm method. in particular, the normalization factors were re-scaled by the median of the normalized library sizes and then used to obtain the normalized read counts. finally, each cluster of de genes was associated to a common specific go term. to each of these go terms, a random number of non-de genes was also associated, ranging between and the remaining not-de genes were randomly associated to other randomly chosen go terms. r packages go.db and org.hs.eg.db were used to define the dag structure of go terms and the go annotations, respectively. performance evaluation funpat was tested to evaluate its ability to: 1) recover false negatives in the selection of de genes without decreasing the false discovery rate; 2) correctly cluster the genes associated to the same temporal pattern; 3) give reproducible results on independent replicates. the statistical significance of all the comparisons done was evaluated using two-sided wilcoxon signed-rank test. selection of de genes selection performance was assessed in terms of precision and recall in detecting the simulated de genes. funpat selection performance was compared to edger and two existing methods specifically designed for time series expression data: masigpro, using the new generalize linear model for the rna-seq data, and the fpca-based approach proposed in wu and wu. in the comparison, we also considered the stand-alone application of the bounded-area method in order to evaluate if the integration of gene selection with the clustering step and the functional annotation is able to improve the recall without loss in precision. edger was applied to the data using the glm application, by defining two factors for the model: one indicating the treatment/control samples, and the other indicating the corresponding time point, as suggested in. masigpro applies two generalized linear regression steps to model gene expression in time series expression data. in particular, the former generates for each gene an anova table and the related p-values; the latter is a stepwise regression analysis applied only to the genes with significant p-value. the goodness of fit of the obtained models, namely r can optionally be used to perform an additional gene selection step. in the evaluation of masigpro on our simulated data we used the latest version adapted for rna-seq data, considering the results obtained by both the first regression step and setting a threshold on r equal to. in both regression steps the same two factors defined for edger were considered for the generalized linear model. differently from the above methods, the fpca-based approach integrates principal component analysis into an hypothesis testing framework, identifying data-driven eigenfunctions representing the expression trajectories. the related test, publicly available at the immune modeling community web portal repository was used to perform the gene selection on our data. identification of temporal patterns the ability to correctly associate the expression profiles to the corresponding simulated patterns was assessed in terms of clustering precision and recall, defined as described in figure the two scores were calculated by matching each identified profile to one of the simulated patterns looking at the maximum intersection between the groups of genes identified by the clustering method and those assigned to a cluster by the simulation, respectively. c-precision was calculated as true positives, i.e. the number of genes in the intersection, divided by the number of genes associated to the identified profile; the c-recall was calculated as true positives divided by the number of genes associated to the simulated pattern. figure provides a toy example. in addition to c-precision and c-recall, we also considered the normalized mutual information to quantify the shared information between the simulated partition and the clustering results. specifically, mutual information was calculated using the contingency table obtained by the true partition and the clustering results; since the mutual information has no upper bounds, its normalized version, ranging between and was used. funpat clustering performance was compared to the hierarchical and k-means clustering approaches and to a model-based method recently adapted for rna-seq data. the number of clusters obtained as output by funpat was used to set the number of clusters for all the other methods. reproducibility of de gene lists as a further evaluation, we considered the reproducibility of the results to assess the ability of each method to detect the same de genes when it is applied independently on available independent replicates. we applied funpat and the other selection methods to each single replicate and evaluated the reproducibility of the resulting lists of de genes in terms of intersection across the three replicates divided by the minimum list size, i.e. the smallest list size among the lists of de genes identified for each replicate. the same evaluation was also applied to two different real datasets, focusing also on the ability of funpat to obtain biologically interpretable results.  selection of de genes the ability of funpat and the other selection methods to select the simulated de genes is displayed in figure funpat is able to significantly increase the average recall with respect to the stand-alone application of the bounded-area method from to, without changing the false discovery rate. in terms of recall, funpat outperforms also all the other selection methods considered. edger shows the same average precision of funpat, but the recall is significantly lower. without any thresholds on r masigpro obtains a precision equal to and an average recall equal to, both significantly lower than those obtained by funpat. when the default threshold on r is applied, the number of genes selected by masigpro drastically drops, obtaining an average precision equal to but at the expense of the recall, equal to on average. a similar result is obtained by fpca, showing an average precision and recall equal to and, respectively. identification of temporal patterns the correct identification of the simulated patterns was tested against the hierarchical, the k-means, implemented in masigpro, and the model-based clustering method described in si et al.. in order to evaluate the clustering performance independently from the selection step, we assigned the genes selected by funpat as input to the hierarchical, the k-means and the model-based clustering. the number of clusters obtained as output by funpat was used to set the number of clusters for all the other methods. boxplots in figure summarizes the obtained results. funpat shows high c-precision and c-recall in cluster detection, both significantly higher with respect to hc. kc and mbc show significantly higher c-precision, but at the expense of the c-recall, on average and respectively, compared to an average of of funpat, with p-values always lower than 1e- moreover, funpat shows the best nmi with average, compared to, and obtained by hc, kc and mbc, respectively, reflecting that the de genes selected by funpat are well-distributed across the clusters. reproducibility of de gene lists considering the analysis applied to each single time series replicate, we wanted to assess, for each simulated dataset, whether the lists are also reproducible across the replicates. figure reports the boxplots of the intersection divided by the minimum list size for the simulated datasets, comparing the three lists of de genes obtained from the three replicates of each dataset. the best performing method is funpat. edger shows a lower reproducibility as well as masigpro, with p-values always below 4e- with respect to funpat. compared to all the other methods, the reproducibility of fpca drastically drops, since in many datasets it does not select any genes. application to real datasets in order to better appreciate the various facets of the presented approach, funpat and the other selection methods considered in the performance evaluation on the simulated data were also applied to two publicly available datasets. the first dataset represents the time varying b cell vaccine responses analyzed by rna-seq in five different subjects. the study focuses on the identification of both common genes and patient-specific dynamics, since, on one hand, a number of immune response features should be common across subjects, on the other, it is known that influenza vaccines produce highly variable b cell responses among different individuals. in the original study, each gene was tested for differential expression using the fpca-based approach, using a 5% fdr threshold to account for multiple testing. the authors reported a union set of de genes across the five subject, of which less than 1% belongs to the intersection set. interestingly, three subjects that, differently from the other two, were vaccinated within the previous three years show much higher similarity with a union set of genes, of which around 13% are in common. funpat was applied to each subject independently, using a fdr threshold equal to 5% to define the seeds. go annotations and go dag derived from r packages org.hs.eg.db and go.db respectively were considered. genes resulted differentially expressed across the five subjects. of these, only % are in common among all the subjects, consistently with the original study. however, when considering the three previously vaccinated individuals, funpat identified a union set of genes of which 21% are in common across the subjects, in comparison with the 13% obtained in the original study. considering the list of genes in common, about 60% were selected in the same three subjects also in. applied to the same dataset, masigpro selected and genes without thresholds on r and with the default threshold of, respectively. these results are characterized by a very low intersection between the gene lists, with no more than % in common among all the subjects, and no more than 2% considering the three subjects previously vaccinated. the high overlap observed with both funpat and fpca among the three subjects is not achieved by masigpro, which provides a signature of and genes in the intersection of the gene lists for r2> and r2>, respectively. in the former list, only genes are in common with the signature reported in. the selected gene in the latter list, cdca results selected also in. differently from the simulated data, for which we have a defined list of true de genes as a benchmark to compare the methods, here we do not know the real truth. however, in the original study the signature of genes in common among the three previously vaccinated subjects were shown in strong correlation with migrating plasma cells. in a memory response to influenza vaccination, resting memory b cells are induced to differentiate through several stages into plasmablast and long-lived plasma cells, thus a higher overlap among the three subjects previously vaccinated is expected. compared to masigpro, funpat is able to describe a better correspondence among these subject, in accordance with the validation made in the original study. as a further support to this result, funpat is also able to indentify subject-specific patterns in common gene sets across the five subjects. as an example, the biological process cell differentiation and the associated dynamic patterns are shown in figure cell differentiation is an important process in vaccination, since b cells are induced to differentiate through several stages into long-lived plasma cells. subjects and vaccinated within the previous three years, share a similar dynamic response with respect to the other two subjects in this gene set. interestingly, these patterns are characterized by different timing of peaks of expression level and by less or more gradual changes in gene expression, showing subject-specific temporal responses highlighted also in the original study. compared to fpca and masigpro, which do not use prior information, funpat is able to automatically associate these patterns to their common functional annotation, thus allowing an easier interpretation of the results. unfortunately, it was not possible to test edger in this dataset since un-normalized count data, required by this method, are not provided. as a further assessment of the reproducibility of the gene lists, we considered a second real dataset representing the gene expression changes at defined stages during pancreatic endocrine differentiation of human embryonic stem cells. the authors kindly provided us the count data in order to use also edger. experiments were performed on two independent biological replicates, monitoring the temporal differentiation pattern from human embryonic stem cells towards the pancreatic fate. here, we focused on the first five developmental stages, comparing the temporal expression profiles with respect to a reference ground state, set to the hescs population. we applied funpat, edger, masigpro and fpca to both biological replicates independently, normalizing the count data using the tmm approach. since for the time series based on developmental stages the number of resulting de genes and biological mechanisms involved is usually high, here we wanted to focus on the most important processes characterizing the temporal patterns observed. therefore, we decided to use bonferroni correction on p-values of edger, fpca and those used to define the seed genes in funpat. masigpro was applied using the threshold on r in order to deal with the most differentially expressed genes. go annotations and go dag derived from r packages org.hs.eg.db and go.db respectively were used in funpat. as done for the simulated data, the overlap between the lists was calculated in terms of intersection divided by the minimum list size, i.e. the smallest list size among the lists of de genes identified for each replicate. comparing for each method the two lists of de genes resulted from the replicates, both funpat and edger show the highest overlap with respect to masigpro and fpca. results confirm what observed in the simulated data and, considering also the results obtained in the first real dataset, it seems that, differently from masigpro and fpca, funpat is able to provide more stable lists of de genes, thus increasing the biological interpretability of the results. discussion a novel analysis framework, implemented in the r package funpat, was developed to search for the main temporal patterns in classes of functional gene sets and to improve the gene selection by integrating the statistical evidence of differential expression with the information on the temporal profiles and the functional annotations. in particular, funpat implements a differential expression analysis able to consider differences between two experimental conditions, taking into account the entire temporal expression profiles. the method is based on a model of the biological-plus-technical variability and of its dependence on the average gene expression; it is not constrained by any specific statistical distributions, thus allowing its application to rna-seq data pre-processed in different ways and, in general, to different technologies. it is important to note that, although the method is robust to different data pre-processing approaches, data need to be normalized before using funpat in order to correct for differences in sequencing depth and guarantee an accurate estimate of the biological-plus-technical variability after the removal of systematic biases. in a conventional analysis, the user selects the genes using some correction method to adjust the p-values for multiple testing and then applies the clustering independently with respect to the selection step. a side effect of this approach is that the clustering is too constrained by the results obtained in the selection step, where the need to control the type i error rate in a multiple testing condition leads to very small significant thresholds, thus increasing the number of false negatives. to overcome this drawback, funpat combines the information on p-values with both functional annotations and characteristic temporal pattern associations, thus decreasing the number of false negatives without significantly increasing the false discovery rate. the clustering method is based on a linear model, does not require the user to fix the number of clusters and is not computationally demanding. since the model is purely based on a least squares method, the algorithm is flexible for applications to data from different platforms and/or processed in different ways. finally, significant genes are associated to the most informative gene sets, avoiding the redundancy of information on gene sets representing general biological functions. in particular, funpat exploits, when available, the hierarchical structure of the annotations starting the search of the temporal patterns from the most specific functional terms and removing the selected genes from the ancestors, as originally proposed by alexa et al. in the context of functional enrichment. however, it is worth noting that funpat does not perform any enrichment analysis on the selected genes, but only exploits annotations to select de genes characterized by both a common temporal pattern and a common biological function. considering the application to the simulated data, both selection and clustering performance confirm that funpat is able to provide, with respect to all the other methods considered in this study, the best trade-off between precision vs. recall and c-precision vs. c-recall, respectively. moreover, funpat shows the best reproducibility of the identified lists of de genes with respect to the other methods. more specifically, funpat shows almost comparable precision with respect to edger, but it outperforms this latter in terms of recall. funpat also outperforms masigpro in terms of both precision and recall when no thresholds on r are imposed. on the other hand, the choice of the default setting leads to a precision equal to at the expense of a marked drop in recall, consistently below or equal to for all the simulated datasets. compared to funpat, edger and masigpro, fpca shows the worst performance in terms of recall and reproducibility, selecting few de genes, although with good precision. even if both fpca and masigpro with r2> show a higher precision with respect to funpat and edger, the reproducibility assessment shows that these methods tend to select different lists of true positive genes across different biological replicates of the same dataset. as regards the identification of the temporal patterns, funpat outperforms in terms of c-recall with respect to all the other methods. even if k-means and the model-based method show a higher c-precision, they present the lowest average recall, thus not providing the same trade-off between c-precision and c-recall of funpat. as a further support of this result, funpat outperforms all the methods also in terms of nmi score, thus highlighting the ability of funpat to provide more well-distributed clusters with respect to k-means and the model-based method, characterized by the lowest average nmi scores. finally, focusing on the definition of seeds and candidates defined by funpat using the p-values obtained by the bounded-area method, one may wonder if the selection performance would be affected by a selection method different from the bounded-area. considering the simulated data, when three replicates are available, the performance obtained using either edger or the bounded-area method are almost comparable. when the two methods are applied to a single replicate, the bounded-area method, which was specifically designed for time series in data-poor conditions, is able to select a higher number of genes than edger, maintaining, as edger, good precision, not statistically different with respect to a required false discovery rate equal to 5%, but showing a higher recall. our conclusion is that different methods can be used to assign the input p-values to the list of analyzed transcripts and to define seeds and candidates, but it is advisable to base the choice on the dataset characteristics. in particular, it is worth noting that funpat outperforms the other methods also when data suffers from missing replicates. obtained results, illustrated in additional file show a pattern similar to that observed in figure and emphasize the higher gain in recall of funpat with respect to all the other methods. this result is also supported by the application of funpat to the two real datasets considered in this study, for which the methods were always applied to single replicates.  funpat is an r package that integrates gene selection, clustering and functional annotations into a single analysis framework, providing clusters of de genes associated to temporal patterns and specific biological terms. tested on simulated time series data, funpat shows better performance with respect to both the selection and the clustering step. the integration of the selection and the clustering step is able to improve the recall without altering the false discovery rate with respect to a stand-alone selection step. moreover, the ability to identify different time series expression patterns is higher than that observed using hierarchical, k-means or model-based clustering approaches specifically designed for rna sequencing data. finally, when data are characterized by missing experimental replicates, funpat is able to provide highly reproducible lists of de genes. the application to two real datasets confirms the ability of funpat to select differentially expressed genes with high reproducibility on different time series expression data, thus indirectly confirming the ability of funpat to select genes with high precision and recall. competing interests the authors declare that they have no competing interests. authors' contributions ts helped in conceiving the study, designed funpat pipeline code and prepared the r package, did the analyses on simulated and real data and wrote the manuscript. ff designed the simulation code and generated the normalized simulated datasets. bdc conceived and supervised the study, designed funpat pipeline code and wrote the manuscript. all authors have read and approved the manuscript in its current form. supplementary material additional file 1 funpat linear model-based clustering algorithm. detailed description of the clustering method used in funpat pipeline for searching the temporal patterns, including the pseudo-code of the algorithm. click here for file additional file 2 output examples of html reports. html reports generated by funpat displaying the output of the bounded-area method and the temporal pattern profiles associated to each gene set. click here for file additional file 3 results of selection and clustering performance on single replicate. description of the selection and clustering performance of the methods when they are applied independently on the available replicates. click here for file acknowledgements we thank jonathan schug and maike sander for kindly providing us the count data of the study on the pancreatic endocrine differentiation of human embryonic stem cells. declarations publication of this article has been funded by prat cpda. this article has been published as part of bmc genomics volume supplement 2015: proceedings of the italian society of bioinformatics: annual meeting 2014: genomics. the full contents of the supplement are available online at http://www.biomedcentral.com/bmcgenomics/supplements/16/s 
here we present funpat, an r package for time series rna sequencing data that integrates gene selection, clustering and functional annotation into a single framework. moreover, the expression patterns obtained as output allow an easy interpretation of the results. significant genes are associated to both the most informative functional terms, avoiding redundancy of information, and the most representative temporal patterns, thus improving the readability of the results. the application to real time series expression data shows the ability of funpat to select differentially expressed genes with high reproducibility, indirectly confirming high precision and recall in gene selection. funpat exploits functional annotations by performing for each functional term, e.g. a novel analysis pipeline was developed to search the main temporal patterns in classes of genes similarly annotated, improving the sensitivity of gene selection by integrating the statistical evidence of differential expression with the information on temporal profiles and the functional annotations. moreover, when biological replicates are missing, funpat is able to provide reproducible lists of significant genes. dynamic expression data, nowadays obtained using high-throughput rna sequencing, are essential to monitor transient gene expression changes and to study the dynamics of their transcriptional activity in the cell or response to stimuli. funpat performance was assessed on both simulated and real data. several methods for data selection, clustering and functional analysis are available; however, these steps are usually performed independently, without exploiting and integrating the information derived from each step of the analysis. funpat also shows high precision and recall in detecting the correct temporal expression patterns; in particular, the recall is significantly higher than hierarchical, k-means and a model-based clustering approach specifically designed for rna sequencing data. with respect to a stand-alone selection step, the integration of the clustering step is able to improve the recall without altering the false discovery rate. 26- february eleventh annual meeting of the bioinformatics italian society meeting rome, italy
 dynamic expression data, nowadays obtained using high-throughput rna sequencing, are essential to monitor transient gene expression changes and to study the dynamics of their transcriptional activity in the cell or response to stimuli. several methods for data selection, clustering and functional analysis are available; however, these steps are usually performed independently, without exploiting and integrating the information derived from each step of the analysis. methods here we present funpat, an r package for time series rna sequencing data that integrates gene selection, clustering and functional annotation into a single framework. funpat exploits functional annotations by performing for each functional term, e.g. a gene ontology term, an integrated selection-clustering analysis to select differentially expressed genes that share, besides annotation, a common dynamic expression profile.  funpat performance was assessed on both simulated and real data. with respect to a stand-alone selection step, the integration of the clustering step is able to improve the recall without altering the false discovery rate. funpat also shows high precision and recall in detecting the correct temporal expression patterns; in particular, the recall is significantly higher than hierarchical, k-means and a model-based clustering approach specifically designed for rna sequencing data. moreover, when biological replicates are missing, funpat is able to provide reproducible lists of significant genes. the application to real time series expression data shows the ability of funpat to select differentially expressed genes with high reproducibility, indirectly confirming high precision and recall in gene selection. moreover, the expression patterns obtained as output allow an easy interpretation of the results.  a novel analysis pipeline was developed to search the main temporal patterns in classes of genes similarly annotated, improving the sensitivity of gene selection by integrating the statistical evidence of differential expression with the information on temporal profiles and the functional annotations. significant genes are associated to both the most informative functional terms, avoiding redundancy of information, and the most representative temporal patterns, thus improving the readability of the results. funpat package is provided in r/bioconductor at link: http://sysbiobig.dei.unipd.it/?q=node/ 26- february eleventh annual meeting of the bioinformatics italian society meeting rome, italy 