BACKGROUND
gene expression measured by microarray chips is an emerging and cost-effective tool to assess the expression of thousands of genes in different tissues and organisms  <cit> .
this technology has been intensively used to monitor changes in gene expression between tissues, treatments or time points in order to detect genes, or even metabolic pathways, involved in differential expression patterns  <cit> .
as was highlighted by wolfinger et al.
<cit> , inference in microarray gene expression analyses is typically focused on gene-specific differences between mathematical expectations of two  groups of biological conditions.
however, discrepancies in gene expression could also be characterized by other statistics of interest like dispersion parameters  <cit> .
heterogeneity of residual variances is a topic of main concern in biological studies where residual variance changes under alternative treatments  <cit> .
in gene expression analyses, heterogeneity of gene-specific residual dispersion has been addressed recently  <cit> , where hierarchical mixed models with gene-specific residual variances substantially reduced the rate of false positives and allowed for a more realistic fit of gene expression data  <cit> .
nevertheless, a common within-gene residual variance was assumed in these analyses, although within-gene discrepancies in the dispersion parameters could also be feasible.
to our best knowledge, discrepancies in terms of gene-specific residual variance across different biological conditions  have never been considered in the microarray literature.
besides a plausible scale effect on the residual variance due to changes in mathematical expectation under different groups of microarrays, within-gene heterogeneity of the residual variance could suggest a group-specific pattern of variability at the transcription level.
variability could be just due to within tissue variability in cell type composition, but may or may not be related to any meaningful difference in transcription.
the aim of this research is to propose a hierarchical mixed model analysis of microarray gene expression data assuming within-gene heterogeneous residual variances.
in addition, a straightforward bayes factor approach to test differences between two within-gene residual variances is developed, taking verdinelli and wasserman  <cit>  and varona et al.
<cit>  as starting point.
this methodology could open a new research field in gene expression analysis where differential gene expression will be characterized in terms of variability of the transcription process.
methods
hierarchical mixed model with within-gene heterogeneous residual variances
assume as starting point n replicates of non-competitive hybridization microarray data with m genes  per array.
under the simplest design, these replicates are distributed in two different groups of treatments  with r and s replicates per treatment, respectively .
this gene expression data can be analyzed under the following hierarchical mixed model  <cit> ,
y = xa + z1p <dig> + z2p <dig> +e,
where y is the  ×  <dig> column vector of intensity scores sorted by array within treatment within gene and e is the  ×  <dig> column vector of residuals.
effects in model were array  and probe  linked to y by appropriate incidence matrices .
vector e is assumed to be normally distributed  <cit> ,
e ~ n,
r being the matrix of residual variances.
assuming null residual variances  <cit>  and heterogeneous gene-specific residual variances between treatments, r can be stated as
r=⊕i=1m,
where i <dig> is a r × r identity matrix, i <dig> is a s × s identity matrix,  <dig> is a r × s matrix of zeros, and σe <dig> is the residual variance for the ith gene and jth treatment.
under a standard bayesian development, the joint posterior probability of all unknowns in model is proportional to
p∝p,r)ppp×ppp,
with a flat prior for a and multivariate normal a priori distributions for y, p <dig> and p <dig>  <cit> ,
p~n,p~n,
and
p~n,
where im is an m × m identity matrix, and σp <dig> and σp <dig> are the variance components for p <dig> and p <dig>  respectively.
additionally, inverted χ <dig> priors with hyperparameters s <dig> and ν are assumed for variance components,
p~χsp <dig> νp1− <dig> p~χsp <dig> νp2− <dig>
and
p~∏i=1m∏j=12χse <dig> νe− <dig>
all the unknowns in model can be sampled under a markov chain monte carlo framework by standard gibbs sampling  <cit> .
bayes factor to test within-gene heterogeneous residual variances
when gene expression data is grouped in two different treatments or groups the verdinelli and wasserman's  <cit>  approach to bayes factor can be easily adapted.
in order to allow for a straightforward comparison between σe2=σe <dig> and σe2≠σe <dig> hypothesis and without loss of generality, r=⊕i=1m can be redefined as
r∗=⊕i=1m,
and consequently, σe2=σe2+σe <dig> and πi=σe2/σe <dig>  note πi can be viewed as a variance heterogeneity parameter where πi =  <dig>  accounts for equal residual variances between treatments and πi ≠  <dig>  suggests within-gene  heterogeneity of residual variances.
assuming σ′= and σ' = , this reparameterization can also be developed within a bayesian frame, with the following joint posterior probability,
p∝pppp×pppp,
and bayesian likelihood,
p ~ n.
we assume the same prior distributions for a, p <dig>  p <dig>  σp <dig> and σp <dig> as in previous model, and a scaled inverted χ <dig> prior for elements in σ
p~∏i=1mχse <dig> νe− <dig>
note that this parameterization allows for a gene-specific definition of hyperparameters se <dig> and νe, modifying the shape of the inverted scaled χ <dig> prior accordingly to our a priori knowledge about the dispersion patter of each gene.
nevertheless, if we lack of a priori information about gene-specific dispersion patterns, this prior could be reduced to a proper flat distribution with appropriate bound.
the priori distribution for π is stated as flat between appropriate bounds,
p~∏i=1m1if πi∈ and 0 otherwise.
note that this prior distribution is the key point for the further calculation of the bayes factor and covers all possible values taken by πi with equal probability, following verdinelli and wasserman  <cit>  and varona et al.
<cit> .
as in previous model parameterization, all unknowns can be updated by gibbs sampling  <cit>  with the exception of πi that requires a metropolis-hastings step  <cit> .
for a given gene, model comparison between σe2≠σe <dig> and σe2=σe <dig> hypotheses simplifies to conditions πi ≠  <dig>   and πi =  <dig>  .
note that πi is assumed known and fixed in model hoi and then, model hoi and model he are nested models that only differ in a bounded variable .
it is important to highlight that this bayes factor testes gene-by-gene dispersion patterns, although it does not inform us about the best analytical model for the joint inference of all genes.
following the methodology developed by verdinelli and wasserman  <cit> , the bayes factor between model he and model hoi  can be easily calculated from the markov chain monte carlo sampler output of model he, by averaging the full conditional densities of each cycle at πi =  <dig>  using the rao-blackwell argument  <cit> .
following garcía-cortés et al.
<cit>  and varona et al.
<cit> , the posterior density p suffices to obtain bfhe/hoi,
bfhe/hoi=pp=1p,
because p was previously defined with the a priori distribution of πi.
on the basis of geamm v. <dig>  program  <cit> , the bayes factor developed above was implemented with fortran <dig> language.
all the subsequent analyses were performed with this software.
example  <dig>  simulated data
our bayes factor approach was tested on simulated data sets under three different scenarios in order to check its statistical performance.
for each scenario, a total of  <dig> data sets were generated, each one including  <dig> arrays ,  <dig>  genes per array and two groups of treatments .
more specifically, scenario  <dig>  assigned  <dig> arrays to each treatment without missing data, scenario  <dig>  assumed an unbalanced design with  <dig> and  <dig> arrays for treatments a and b, respectively , and scenario  <dig>  assumed two groups of  <dig> arrays with a 5% of randomly distributed missing data.
intensity scores  were simulated under the following model,
yijk = μ + ai + gj = eijk,
were μ was the overall mean arbitrarily fitted to  <dig>  ai was the effect of each array sampled from an uniform distribution between  <dig> and  <dig>  gj was the effect of the gene sampled from a gaussian distribution with mean  <dig> and variance  <dig>  and eijk was the residual term obtained from a gaussian distribution with mean zero and variance  <dig>  × πi  or  <dig>  ×  .
we assumed a unique  value for the overall residual variance in order to allow for a direct comparison and interpretations of the results.
genes were grouped in five levels with different values of πi:  <dig>  ,  <dig>  ,  <dig>  ,  <dig>   and  <dig>  .
statistical performance of the developed bf to check differential expression in terms of dispersion pattern  was compared with a well-known standard f-test.
the effect of within-gene differential expression was not considered in order to allow for a straightforward comparison between group a and group b residual variances under f-test.
indeed, additional sources of variation were avoided in order to allow for a direct calculation of the f-test without requiring preliminary pre-correction of the data.
each data set was analyzed by the bayes factor approach described above with the scaled χ- <dig> prior distribution for variances components generalized to proper flat priors  defined between >  <dig> and  <dig>  a unique monte carlo markov chain with  <dig>  elements was launched for each data set, after discarding the first  <dig>  iterations as burn-in.
convergence was checked by the raftery and lewis  <cit>  algorithm.
example  <dig>  free-access gene expression data
to illustrate the methodology described above, we applied the model to free-access fibroblast gene expression data from  <dig> chimps and  <dig> gorillas .
as described karaman et al.
<cit> , hybridization was performed in the human genome u <dig> set platform .
a rough normalization was performed on the original data set by calculating multiplicative scaling factors on the basis of the median intensity of the 60th and 95th quintile of gene-expression scores  <cit> .
all gene-expression scores below  <dig> were set to  <dig> in the original data set  and.
within this context, all genes with one or more scores equal to  <dig> were removed from the final analysis.
after editing, data set included gene expression scores of  <dig>  genes, transformed by a base-2-logarithm as suggested yeung et al.
<cit> .
the analytical process followed the same specifications as for simulated data sets.
RESULTS
example  <dig>  simulated data
as can be seen in table  <dig>  differences between simulated and predicted values of π were small, suggesting a reasonable model adjustment to gene expression data.
indeed, the average posterior mean for the residual variance was  <dig>   and agreed with the value used in simulations .
when gene expression data was generated under equal residual variances across groups , the bayes factor  discarded heterogeneous variances in the greater part of the cases .
under s <dig> and following jeffreys'  <cit>  scale of evidence, between 1% and 12% of genes reached vague evidences of heterogeneous variances and only between 1% and 3% of genes showed substantial evidences of heterogeneous variances .
results under s <dig>  and s <dig>  provided a similar trend with and expectable power loss .
although a small percentage of genes supported the existence of heterogeneous variances, these results do not invalidate our bayes factor approach, given that a substantial increase in false positives is expected when the number of replicates  per analyses is small, a typical phenomenon in microarray data sets.
moreover, these results agreed with the ones obtained by a standard f-test, where a 1–12% of genes  reached p-values lower than  <dig> .
1empirical standard errors were smaller than  <dig>  in all cases.
as was expected, bfhe/hoi showed an overall increase when π values used in the simulation process decreased .
the percentage of bfhe/hoi <  <dig> decreased with π, it ranging between 60% and 84% , between 20% and 48% , between 4% and 16%  and 0% .
additionally, evidences favoring the presence of heterogeneous variances increased when gene expression data were simulated under small π, 84% to 100% of the genes reaching bfhe/hoi ≥  <dig> for π =  <dig>  simulated genes .
this increase in bfhe/hoi when the bounded variable  departed from the "null hypothesis"  agrees with previous results published by garcía-cortés et al.
<cit>  and casellas et al.
<cit>  with the same bayes factor approach although adapted to test heritability of linear and threshold traits.
as can be seen in figure  <dig>  our bayes factor and the standard f-test performed similarly, in contrast to the noticeable computational instability of previous approximations to the bayes factor  <cit> .
nevertheless, the approximation adapted in this manuscript has been previously compared with other statistics of reference like likelihood ratio test  <cit>  or the deviance information criterion  <cit>  developed by spiegelhalter et al.
<cit> , and showed a very similar performance without detecting remarkable deviations.
the strong similarity between the proposed bayes factor and the standard f-test could the viewed as a critical advantage for the f-test under a very simple microarray design with two different treatments.
when additional sources of variation are included in model, the proposed bayes factor takes advantage of the joint analysis for all the parameters in the model and simultaneous testing for discrepancies between residual variances of interest.
within this scenario, the f-test requires a previous pre-correction for additional sources of variation in the model and therefore, implies a two-steps analysis.
example  <dig>  free-access gene expression data
results are shown in table  <dig>  where  <dig> % of genes did not reveal evidence of within-gene heterogeneous residual variances, and  <dig> % of genes suggested almost discernable deviations from model hoi .
it is graphically illustrated in figure  <dig> where most of the estimated π values were accumulated around  <dig> , the value characterizing within-gene homogeneous residual variances.
nevertheless, substantial , strong , very strong  and decisive evidences  of within-gene heterogeneous residual variances following jeffreys'  <cit>  scale were detected  in this free-access data set.
1values were transformed to  <dig> - π when π was grater than  <dig> .
2number of genes.
3percentage related to the overall number of genes analyzed.
as was expected, the across-genes average π values  was maximum for genes with bfhe/hoi <  <dig> , whereas this parameter reduced to around  <dig>  when bfhe/hoi increased .
note that in our analyses, extreme values of π values  were scarce .
for the joint residual variance 2), averages ranged between  <dig>  and  <dig>  .
discussion
within-gene heterogeneity of the residual dispersion patter in real data
results obtained in the comparison between chimp and gorilla gene expression data suggested a substantial incidence of within-gene heterogeneity, which is not typically accounted for in standard gene expression analyses.
moreover, detection of relevant  genes was substantially affected by the analytical model, as is illustrated in table  <dig>  model he showed a more conservative pattern and, when bfhe/hoi took greater-than-one values, this phenomenon suggested that the rate of false positives increased if within-gene heterogeneity of residual variances was not accounted for in the model  <cit> .
a moderate percentage of genes with heterogeneous residual variances did not show differences in terms of mathematical expectation , therefore discarding a scale effect.
although these results can not be directly extrapolated to all microarray data sets, these results suggests that heterogeneous residual patterns could be a biological phenomenon of special interest in further analysis of gene expression data.
variability could be just due to within tissue variability in cell type composition, but may or may not be related to any meaningful difference in transcription.
1posterior probability above  of below zero  of the difference between chip vs. gorilla mathematical expectation.
2all πi were arbitrarily fitted to  <dig> .
bayes factor to compare dispersion patterns in microarray studies
although gene expression analyses have been typically focused on the comparison between mathematical expectations of two or more  groups of arrays, the analytical approach developed in the present paper allow for an alternative characterization of differential expression patterns.
moreover, it allows for an appropriate data modeling when within-gene heterogeneity of residual variances exists.
this approach could be viewed as statistically inefficient for those genes with homogeneity of residual variances  <cit> .
nevertheless, the aim of this research was to provide an accurate method to compare dispersion patterns, whereas differences between the mathematical expectances of groups of treatments are not of interest in this case.
this test could also be applied to experiments with less replicates per group although its results must be taken with caution, given the inherent loss of robustness under small data sets,.
as is shown in figure  <dig>  our bayes factor performed similarly to the standard f-test, with a stable a coherent behavior under moderate sample sizes .
although the bayes factor approach has been described under a simple scenario , this can be easily generalized to more complex frameworks without additional requirements.
within this context, across-genes shrinkage of residual variances is a topic of main interest in microarray research  <cit>  which can be easily adapted to the hierarchical mixed model applied above.
indeed, several bayesian methods proposed for residual variances shrinkage  <cit>  can be applied to both residual variances and heterogeneity parameters, and the calculation of the bayes factor does not substantially change within-gene or within a group of genes.
in a similar way, other approaches can also be jointly implemented with the developed bayes factor such as mixtures of distributions  <cit> .
if several sources of variation are expected on the residual term, the mixed model with within-gene heterogeneous residual variances could be viewed as a useful tool to characterize their distribution pattern, the bayes factor being a straightforward way to check their statistical relevance.
within this context, our bayes factor procedure could provide preliminary results required for the application of more complex and computational demanding approaches like the mixed model with log-transformed hierarchical residual variances developed by jaffrezic et al.
<cit> .
changes in residual dispersion patterns could be due to a scale effect when mathematical expectations of two  groups of arrays are different.
nevertheless, this scale-related hypothesis was only attributable to a small percentage of genes with heterogeneous residual variances , whereas more than 75% of differential dispersion patters must be related to other unknown causes in the analyzed free-access microarray data.
these changes in the dispersion pattern were previously suggested in genes involved in cancer pathogenesis  <cit>  and other diseases  <cit> , although within-gene residual heterogeneity is not commonly considered in gene expression analyses  <cit> .
moreover, heterogeneity in gene expression increases with age  <cit>  and therefore, our approach could be of special interest in time-series analyses where individuals at different ages are compared.
as a whole, the hierarchical mixed model with within-gene heterogeneous residual variances allows for a new and more accurate modeling of gene expression data with appealing perspectives, and the bayes factor developed is an easy way to check differences between within-gene residual variances.
under the bayesian framework, model comparison is usually made by calculating bayes factors  <cit> , the ratio between the marginal probabilities of the data given the tested models and after integrating out all parameters in the models.
the bayes factor developed by verdinelli and wasserman  <cit>  from generalization of the savage-dickey density ratio, and adapted to the animal breeding context by garcía-cortés et al.
<cit>  and varona et al.
<cit> , has been easily applied to check heterogeneous residual variances in gene expression analyses when two groups of treatments are compared.
it provides a rigorous and clear framework to compare competing models, avoiding the calculation of significance levels and without depending upon asymptotic properties of frequentist estimators  <cit> , bayes factor behaves well even when the bounded variable to be tested is either close to the boundary of the parametric space  <cit> .
in addition, bayes factor provides a ratio of probabilities between models, without any requirement to define the null or the alternative hypothesis, without trying to discard the null hypothesis in favor of an alternative hypothesis, and without referring to the asymptotic properties of the frequentist estimators  <cit> .
although other bayes factor approaches could be used, the verdinelli and wasserman's  <cit>  approach allows for a simplified calculation, where only the analysis of the complex model is necessary.
moreover, a unique analysis is required to calculate all the gene-specific bayes factors, and chain storage is not needed because only the  average of the full conditional densities at πi =  <dig>  is used during calculation.
under alternative bayes factor approaches  <cit> , an additional model with π =  <dig>  for the gene to be tested  must be analyzed for each gene, in order to obtain the gene-specific bayes factor comparing heterogeneous versus homogeneous residual variances.
given the null a priori information about the expected distribution of π, we assumed a flat prior distribution between  <dig> and  <dig> in order to give the same a priori probability to all plausible values.
this is a standard assumption for the verdinelli and wasserman's bayes factor  <cit> , although other prior distributions could also become reasonable.
it is important to note that p equally influences both p and p terms and therefore, the bayes factor must be relatively robust to prior modifications.
in the light of the results obtained from the analysis of great ape gene expression data, a priori distributions favoring values close to  <dig>  and with decreasing probability in their tails could be realistic.
within this context, gaussian, laplace and student's t distributions with mean  <dig>  and truncated at  <dig> and  <dig> could be useful a priori distributions, among others.
nevertheless, further studies are required to confirm this pattern in real gene expression data.
as was recently demonstrated at the gene-specific level  <cit> , an accurate modeling of residual dispersion allows for a more realistic fit of gene expression data.
moreover, it has a relevant impact on the rate of false positives when gene expression is characterized in terms of mathematical expectations or their differences  <cit> .
in this manuscript, we have adapted lo and gottardo  <cit>  mixed model to account for within gene heterogeneity of residual variances, where a relevant incidence of within-gene heterogeneity has been revealed in real gene expression data.
moreover, this heterogeneity can be easily checked gene-by-gene by applying a straightforward bayes factor with a minimal increase in computational requirements.
note that differences between average gene expression without assuming equal residual variances is a typical example of the behrens-fisher problem  <cit> , which could be easily by-passed in microarray analyses by appropriately adapting welch's  <cit> t-test.
nevertheless, our approach seeks a novel point of view were, not only differences between mathematical means are tested but differences between residual dispersion patterns must also be checked and characterized.
in addition, our bayes factor allows to detect those genes with heterogeneous residual variances where behrens-fisher problem  <cit>  holds.
CONCLUSIONS
accounting for within-gene between-groups heterogeneous residual variances in mixed model analyses of non-competitive microarray gene expression data  allows to characterize differential expression patterns in terms of gene expression variability.
the bayes factor approach here presented provides a straightforward comparison between within-gene group-specific residual variances with minimal computing requirements.
this methodology is freely available in geamm v. <dig>  software  <cit> .
authors' contributions
the methodological approach described in this manuscript was developed by both jc and lv.
in addition, jc implemented the analytical model and simulated data sets in fortran <dig> language, evaluated both real and simulated data sets and drafted the manuscript.
lv and contributed to the interpretation of the analyses results and manuscript preparation.
both authors read and approved the final manuscript.

 gene expression measured by microarray chips is an emerging and cost-effective tool to assess the expression of thousands of genes in different tissues and organisms. this technology has been intensively used to monitor changes in gene expression between tissues, treatments or time points in order to detect genes, or even metabolic pathways, involved in differential expression patterns. as was highlighted by wolfinger et al., inference in microarray gene expression analyses is typically focused on gene-specific differences between mathematical expectations of two groups of biological conditions. however, discrepancies in gene expression could also be characterized by other statistics of interest like dispersion parameters. heterogeneity of residual variances is a topic of main concern in biological studies where residual variance changes under alternative treatments. in gene expression analyses, heterogeneity of gene-specific residual dispersion has been addressed recently, where hierarchical mixed models with gene-specific residual variances substantially reduced the rate of false positives and allowed for a more realistic fit of gene expression data. nevertheless, a common within-gene residual variance was assumed in these analyses, although within-gene discrepancies in the dispersion parameters could also be feasible. to our best knowledge, discrepancies in terms of gene-specific residual variance across different biological conditions have never been considered in the microarray literature. besides a plausible scale effect on the residual variance due to changes in mathematical expectation under different groups of microarrays, within-gene heterogeneity of the residual variance could suggest a group-specific pattern of variability at the transcription level. variability could be just due to within tissue variability in cell type composition, but may or may not be related to any meaningful difference in transcription. the aim of this research is to propose a hierarchical mixed model analysis of microarray gene expression data assuming within-gene heterogeneous residual variances. in addition, a straightforward bayes factor approach to test differences between two within-gene residual variances is developed, taking verdinelli and wasserman and varona et al. as starting point. this methodology could open a new research field in gene expression analysis where differential gene expression will be characterized in terms of variability of the transcription process. methods hierarchical mixed model with within-gene heterogeneous residual variances assume as starting point n replicates of non-competitive hybridization microarray data with m genes per array. under the simplest design, these replicates are distributed in two different groups of treatments with r and s replicates per treatment, respectively. this gene expression data can be analyzed under the following hierarchical mixed model, y = xa + z1p + z2p +e, where y is the × column vector of intensity scores sorted by array within treatment within gene and e is the × column vector of residuals. effects in model were array and probe linked to y by appropriate incidence matrices. vector e is assumed to be normally distributed, e ~ n, r being the matrix of residual variances. assuming null residual variances and heterogeneous gene-specific residual variances between treatments, r can be stated as r=⊕i=1m, where i is a r × r identity matrix, i is a s × s identity matrix, is a r × s matrix of zeros, and σe is the residual variance for the ith gene and jth treatment. under a standard bayesian development, the joint posterior probability of all unknowns in model is proportional to p∝p,r)ppp×ppp, with a flat prior for a and multivariate normal a priori distributions for y, p and p, p~n,p~n, and p~n, where im is an m × m identity matrix, and σp and σp are the variance components for p and p respectively. additionally, inverted χ priors with hyperparameters s and ν are assumed for variance components, p~χsp νp1− p~χsp νp2− and p~∏i=1m∏j=12χse νe− all the unknowns in model can be sampled under a markov chain monte carlo framework by standard gibbs sampling. bayes factor to test within-gene heterogeneous residual variances when gene expression data is grouped in two different treatments or groups the verdinelli and wasserman's approach to bayes factor can be easily adapted. in order to allow for a straightforward comparison between σe2=σe and σe2≠σe hypothesis and without loss of generality, r=⊕i=1m can be redefined as r∗=⊕i=1m, and consequently, σe2=σe2+σe and πi=σe2/σe note πi can be viewed as a variance heterogeneity parameter where πi = accounts for equal residual variances between treatments and πi ≠ suggests within-gene heterogeneity of residual variances. assuming σ′= and σ' =, this reparameterization can also be developed within a bayesian frame, with the following joint posterior probability, p∝pppp×pppp, and bayesian likelihood, p ~ n. we assume the same prior distributions for a, p p σp and σp as in previous model, and a scaled inverted χ prior for elements in σ p~∏i=1mχse νe− note that this parameterization allows for a gene-specific definition of hyperparameters se and νe, modifying the shape of the inverted scaled χ prior accordingly to our a priori knowledge about the dispersion patter of each gene. nevertheless, if we lack of a priori information about gene-specific dispersion patterns, this prior could be reduced to a proper flat distribution with appropriate bound. the priori distribution for π is stated as flat between appropriate bounds, p~∏i=1m1if πi∈ and 0 otherwise. note that this prior distribution is the key point for the further calculation of the bayes factor and covers all possible values taken by πi with equal probability, following verdinelli and wasserman and varona et al.. as in previous model parameterization, all unknowns can be updated by gibbs sampling with the exception of πi that requires a metropolis-hastings step. for a given gene, model comparison between σe2≠σe and σe2=σe hypotheses simplifies to conditions πi ≠ and πi =. note that πi is assumed known and fixed in model hoi and then, model hoi and model he are nested models that only differ in a bounded variable. it is important to highlight that this bayes factor testes gene-by-gene dispersion patterns, although it does not inform us about the best analytical model for the joint inference of all genes. following the methodology developed by verdinelli and wasserman, the bayes factor between model he and model hoi can be easily calculated from the markov chain monte carlo sampler output of model he, by averaging the full conditional densities of each cycle at πi = using the rao-blackwell argument. following garcía-cortés et al. and varona et al., the posterior density p suffices to obtain bfhe/hoi, bfhe/hoi=pp=1p, because p was previously defined with the a priori distribution of πi. on the basis of geamm v. program, the bayes factor developed above was implemented with fortran language. all the subsequent analyses were performed with this software. example simulated data our bayes factor approach was tested on simulated data sets under three different scenarios in order to check its statistical performance. for each scenario, a total of data sets were generated, each one including arrays, genes per array and two groups of treatments. more specifically, scenario assigned arrays to each treatment without missing data, scenario assumed an unbalanced design with and arrays for treatments a and b, respectively, and scenario assumed two groups of arrays with a 5% of randomly distributed missing data. intensity scores were simulated under the following model, yijk = μ + ai + gj = eijk, were μ was the overall mean arbitrarily fitted to ai was the effect of each array sampled from an uniform distribution between and gj was the effect of the gene sampled from a gaussian distribution with mean and variance and eijk was the residual term obtained from a gaussian distribution with mean zero and variance × πi or ×. we assumed a unique value for the overall residual variance in order to allow for a direct comparison and interpretations of the results. genes were grouped in five levels with different values of πi:,,, and. statistical performance of the developed bf to check differential expression in terms of dispersion pattern was compared with a well-known standard f-test. the effect of within-gene differential expression was not considered in order to allow for a straightforward comparison between group a and group b residual variances under f-test. indeed, additional sources of variation were avoided in order to allow for a direct calculation of the f-test without requiring preliminary pre-correction of the data. each data set was analyzed by the bayes factor approach described above with the scaled χ- prior distribution for variances components generalized to proper flat priors defined between > and a unique monte carlo markov chain with elements was launched for each data set, after discarding the first iterations as burn-in. convergence was checked by the raftery and lewis algorithm. example free-access gene expression data to illustrate the methodology described above, we applied the model to free-access fibroblast gene expression data from chimps and gorillas. as described karaman et al., hybridization was performed in the human genome u set platform. a rough normalization was performed on the original data set by calculating multiplicative scaling factors on the basis of the median intensity of the 60th and 95th quintile of gene-expression scores. all gene-expression scores below were set to in the original data set and. within this context, all genes with one or more scores equal to were removed from the final analysis. after editing, data set included gene expression scores of genes, transformed by a base-2-logarithm as suggested yeung et al.. the analytical process followed the same specifications as for simulated data sets.  example simulated data as can be seen in table differences between simulated and predicted values of π were small, suggesting a reasonable model adjustment to gene expression data. indeed, the average posterior mean for the residual variance was and agreed with the value used in simulations. when gene expression data was generated under equal residual variances across groups, the bayes factor discarded heterogeneous variances in the greater part of the cases. under s and following jeffreys' scale of evidence, between 1% and 12% of genes reached vague evidences of heterogeneous variances and only between 1% and 3% of genes showed substantial evidences of heterogeneous variances. results under s and s provided a similar trend with and expectable power loss. although a small percentage of genes supported the existence of heterogeneous variances, these results do not invalidate our bayes factor approach, given that a substantial increase in false positives is expected when the number of replicates per analyses is small, a typical phenomenon in microarray data sets. moreover, these results agreed with the ones obtained by a standard f-test, where a 1–12% of genes reached p-values lower than. 1empirical standard errors were smaller than in all cases. as was expected, bfhe/hoi showed an overall increase when π values used in the simulation process decreased. the percentage of bfhe/hoi < decreased with π, it ranging between 60% and 84%, between 20% and 48%, between 4% and 16% and 0%. additionally, evidences favoring the presence of heterogeneous variances increased when gene expression data were simulated under small π, 84% to 100% of the genes reaching bfhe/hoi ≥ for π = simulated genes. this increase in bfhe/hoi when the bounded variable departed from the "null hypothesis" agrees with previous results published by garcía-cortés et al. and casellas et al. with the same bayes factor approach although adapted to test heritability of linear and threshold traits. as can be seen in figure our bayes factor and the standard f-test performed similarly, in contrast to the noticeable computational instability of previous approximations to the bayes factor. nevertheless, the approximation adapted in this manuscript has been previously compared with other statistics of reference like likelihood ratio test or the deviance information criterion developed by spiegelhalter et al., and showed a very similar performance without detecting remarkable deviations. the strong similarity between the proposed bayes factor and the standard f-test could the viewed as a critical advantage for the f-test under a very simple microarray design with two different treatments. when additional sources of variation are included in model, the proposed bayes factor takes advantage of the joint analysis for all the parameters in the model and simultaneous testing for discrepancies between residual variances of interest. within this scenario, the f-test requires a previous pre-correction for additional sources of variation in the model and therefore, implies a two-steps analysis. example free-access gene expression data results are shown in table where % of genes did not reveal evidence of within-gene heterogeneous residual variances, and % of genes suggested almost discernable deviations from model hoi. it is graphically illustrated in figure where most of the estimated π values were accumulated around, the value characterizing within-gene homogeneous residual variances. nevertheless, substantial, strong, very strong and decisive evidences of within-gene heterogeneous residual variances following jeffreys' scale were detected in this free-access data set. 1values were transformed to - π when π was grater than. 2number of genes. 3percentage related to the overall number of genes analyzed. as was expected, the across-genes average π values was maximum for genes with bfhe/hoi <, whereas this parameter reduced to around when bfhe/hoi increased. note that in our analyses, extreme values of π values were scarce. for the joint residual variance 2), averages ranged between and. discussion within-gene heterogeneity of the residual dispersion patter in real data results obtained in the comparison between chimp and gorilla gene expression data suggested a substantial incidence of within-gene heterogeneity, which is not typically accounted for in standard gene expression analyses. moreover, detection of relevant genes was substantially affected by the analytical model, as is illustrated in table model he showed a more conservative pattern and, when bfhe/hoi took greater-than-one values, this phenomenon suggested that the rate of false positives increased if within-gene heterogeneity of residual variances was not accounted for in the model. a moderate percentage of genes with heterogeneous residual variances did not show differences in terms of mathematical expectation, therefore discarding a scale effect. although these results can not be directly extrapolated to all microarray data sets, these results suggests that heterogeneous residual patterns could be a biological phenomenon of special interest in further analysis of gene expression data. variability could be just due to within tissue variability in cell type composition, but may or may not be related to any meaningful difference in transcription. 1posterior probability above of below zero of the difference between chip vs. gorilla mathematical expectation. 2all πi were arbitrarily fitted to. bayes factor to compare dispersion patterns in microarray studies although gene expression analyses have been typically focused on the comparison between mathematical expectations of two or more groups of arrays, the analytical approach developed in the present paper allow for an alternative characterization of differential expression patterns. moreover, it allows for an appropriate data modeling when within-gene heterogeneity of residual variances exists. this approach could be viewed as statistically inefficient for those genes with homogeneity of residual variances. nevertheless, the aim of this research was to provide an accurate method to compare dispersion patterns, whereas differences between the mathematical expectances of groups of treatments are not of interest in this case. this test could also be applied to experiments with less replicates per group although its results must be taken with caution, given the inherent loss of robustness under small data sets,. as is shown in figure our bayes factor performed similarly to the standard f-test, with a stable a coherent behavior under moderate sample sizes. although the bayes factor approach has been described under a simple scenario, this can be easily generalized to more complex frameworks without additional requirements. within this context, across-genes shrinkage of residual variances is a topic of main interest in microarray research which can be easily adapted to the hierarchical mixed model applied above. indeed, several bayesian methods proposed for residual variances shrinkage can be applied to both residual variances and heterogeneity parameters, and the calculation of the bayes factor does not substantially change within-gene or within a group of genes. in a similar way, other approaches can also be jointly implemented with the developed bayes factor such as mixtures of distributions. if several sources of variation are expected on the residual term, the mixed model with within-gene heterogeneous residual variances could be viewed as a useful tool to characterize their distribution pattern, the bayes factor being a straightforward way to check their statistical relevance. within this context, our bayes factor procedure could provide preliminary results required for the application of more complex and computational demanding approaches like the mixed model with log-transformed hierarchical residual variances developed by jaffrezic et al.. changes in residual dispersion patterns could be due to a scale effect when mathematical expectations of two groups of arrays are different. nevertheless, this scale-related hypothesis was only attributable to a small percentage of genes with heterogeneous residual variances, whereas more than 75% of differential dispersion patters must be related to other unknown causes in the analyzed free-access microarray data. these changes in the dispersion pattern were previously suggested in genes involved in cancer pathogenesis and other diseases, although within-gene residual heterogeneity is not commonly considered in gene expression analyses. moreover, heterogeneity in gene expression increases with age and therefore, our approach could be of special interest in time-series analyses where individuals at different ages are compared. as a whole, the hierarchical mixed model with within-gene heterogeneous residual variances allows for a new and more accurate modeling of gene expression data with appealing perspectives, and the bayes factor developed is an easy way to check differences between within-gene residual variances. under the bayesian framework, model comparison is usually made by calculating bayes factors, the ratio between the marginal probabilities of the data given the tested models and after integrating out all parameters in the models. the bayes factor developed by verdinelli and wasserman from generalization of the savage-dickey density ratio, and adapted to the animal breeding context by garcía-cortés et al. and varona et al., has been easily applied to check heterogeneous residual variances in gene expression analyses when two groups of treatments are compared. it provides a rigorous and clear framework to compare competing models, avoiding the calculation of significance levels and without depending upon asymptotic properties of frequentist estimators, bayes factor behaves well even when the bounded variable to be tested is either close to the boundary of the parametric space. in addition, bayes factor provides a ratio of probabilities between models, without any requirement to define the null or the alternative hypothesis, without trying to discard the null hypothesis in favor of an alternative hypothesis, and without referring to the asymptotic properties of the frequentist estimators. although other bayes factor approaches could be used, the verdinelli and wasserman's approach allows for a simplified calculation, where only the analysis of the complex model is necessary. moreover, a unique analysis is required to calculate all the gene-specific bayes factors, and chain storage is not needed because only the average of the full conditional densities at πi = is used during calculation. under alternative bayes factor approaches, an additional model with π = for the gene to be tested must be analyzed for each gene, in order to obtain the gene-specific bayes factor comparing heterogeneous versus homogeneous residual variances. given the null a priori information about the expected distribution of π, we assumed a flat prior distribution between and in order to give the same a priori probability to all plausible values. this is a standard assumption for the verdinelli and wasserman's bayes factor, although other prior distributions could also become reasonable. it is important to note that p equally influences both p and p terms and therefore, the bayes factor must be relatively robust to prior modifications. in the light of the results obtained from the analysis of great ape gene expression data, a priori distributions favoring values close to and with decreasing probability in their tails could be realistic. within this context, gaussian, laplace and student's t distributions with mean and truncated at and could be useful a priori distributions, among others. nevertheless, further studies are required to confirm this pattern in real gene expression data. as was recently demonstrated at the gene-specific level, an accurate modeling of residual dispersion allows for a more realistic fit of gene expression data. moreover, it has a relevant impact on the rate of false positives when gene expression is characterized in terms of mathematical expectations or their differences. in this manuscript, we have adapted lo and gottardo mixed model to account for within gene heterogeneity of residual variances, where a relevant incidence of within-gene heterogeneity has been revealed in real gene expression data. moreover, this heterogeneity can be easily checked gene-by-gene by applying a straightforward bayes factor with a minimal increase in computational requirements. note that differences between average gene expression without assuming equal residual variances is a typical example of the behrens-fisher problem, which could be easily by-passed in microarray analyses by appropriately adapting welch's t-test. nevertheless, our approach seeks a novel point of view were, not only differences between mathematical means are tested but differences between residual dispersion patterns must also be checked and characterized. in addition, our bayes factor allows to detect those genes with heterogeneous residual variances where behrens-fisher problem holds.  accounting for within-gene between-groups heterogeneous residual variances in mixed model analyses of non-competitive microarray gene expression data allows to characterize differential expression patterns in terms of gene expression variability. the bayes factor approach here presented provides a straightforward comparison between within-gene group-specific residual variances with minimal computing requirements. this methodology is freely available in geamm v. software. authors' contributions the methodological approach described in this manuscript was developed by both jc and lv. in addition, jc implemented the analytical model and simulated data sets in fortran language, evaluated both real and simulated data sets and drafted the manuscript. lv and contributed to the interpretation of the analyses results and manuscript preparation. both authors read and approved the final manuscript. 
the analysis of microarray gene expression data typically tries to identify differential gene expression patterns in terms of differences of the mathematical expectation between groups of arrays. this bayes factor only requires the analysis of the complex model and gene-specific bayes factors are provided from the output of a simple markov chain monte carlo sampling. commonly, a homogeneous gene-specific residual variance is assumed in hierarchical mixed models for gene expression data, although it could result in substantial biases if this assumption is not true. in this manuscript, a hierarchical mixed model with within-gene heterogeneous residual variances is proposed to analyze gene expression data from non-competitive hybridized microarrays. nevertheless, the differential expression pattern could also be characterized by group-specific dispersion patterns, although little is known about this phenomenon in microarray data. moreover, a straightforward bayes factor is adapted to easily check within-gene heterogeneity of residual variances when samples are grouped in two different treatments. this statistical development opens new research possibilities within the gene expression framework, where heterogeneity in residual variability could be viewed as an alternative and plausible characterization of differential expression patterns.
 the analysis of microarray gene expression data typically tries to identify differential gene expression patterns in terms of differences of the mathematical expectation between groups of arrays. nevertheless, the differential expression pattern could also be characterized by group-specific dispersion patterns, although little is known about this phenomenon in microarray data. commonly, a homogeneous gene-specific residual variance is assumed in hierarchical mixed models for gene expression data, although it could result in substantial biases if this assumption is not true.  in this manuscript, a hierarchical mixed model with within-gene heterogeneous residual variances is proposed to analyze gene expression data from non-competitive hybridized microarrays. moreover, a straightforward bayes factor is adapted to easily check within-gene heterogeneity of residual variances when samples are grouped in two different treatments. this bayes factor only requires the analysis of the complex model and gene-specific bayes factors are provided from the output of a simple markov chain monte carlo sampling.  this statistical development opens new research possibilities within the gene expression framework, where heterogeneity in residual variability could be viewed as an alternative and plausible characterization of differential expression patterns. 