Estimation of the methylation pattern distribution from deep sequencing data

18 pages, 8 figures

section_content: Epigenetic regulations are involved in a broad range of biological processes, including development, tissue homeostasis, learning and memory, as well as various diseases such as obesity and cancer [1] [2] [3]. 

DNA methylation is one of the best studied epigenetic molecular mechanisms. It consists of the addition of a methyl group to the cytosine residues (C) of a DNA molecule. In animals, DNA methylation usually takes place in the CpG context: cytosines followed by a guanine (G) residue. 

DNA methylation modulates gene expression through a variety of mechanisms. In vertebrates, methylation in the promoter region usually has a repressive effect on transcription initiation. By contrast, methylation of gene bodies is generally associated with an active transcriptional state and has been shown to play an important role in the control of alternative splicing [4, 5]. 

The diverse and subtle effects of DNA methylation enable a given genome to produce different phenotypic outputs as part of a developmental program or in response to environmental factors. This has fundamental implications at the organismal level, where DNA methylation plays an important role in phenotypic plasticity [6]. This is also important at the cellular level to create diverse cell types, tissues and organs all based on the same genome. DNA methylation patterns can thus change from one cell type to another or within a cell under different conditions [7]. 

The diversity of methylation patterns in a sample can be studied with a single base pair resolution using the bisulphite sequencing technique [8]. When DNA is treated with bisulphite, the unmethylated cytosines are converted to uracils with a high (albeit not complete) efficiency, whereas the methylated cytosines remain as cytosines. A library is prepared from the bisulphite treated DNA by fragmenting to lengths of approximately 200 bp and PCR amplified. During this amplification process, uracils are replicated as thymines (T). The DNA library is then sequenced and the resulting reads are mapped to a reference. Within each read, CpG dinucleotides which have been converted to TpG are recognised as unmethylated, and unconverted CpG dinucleotides are recognised as methylated. 

A common type of analysis carried out with this type of data is to estimate, for each cytosine, the global methylation level of a sample, namely, the average methylation level across all DNA strands in all the cells represented in that sample. This is usually done by correcting for the fact that bisulphite conversion is not a complete reaction (for instance, see [4, 9] ). 

However, this type of analysis only considers the methylation level at individual positions and is oblivious to the fact that cytosines present on a given read represent a broader snapshot of the methylation landscape on a particular strand of DNA. One can therefore gain a significantly deeper insight into the complexity of DNA methylation landscapes by reconstituting the methylation patterns that are physically present on the same sequence, and thus come from the same cell. Each read can be seen as containing a small number of binary labelled CpG sites: 1 for methylated, 0 for unmethylated and represents the methylation pattern of a given strand of DNA in one particular cell. This approach is of particular interest when studying complex biological samples that contain a mixture of cell types, for instance a tumour or a whole insect brain. It gives a much more detailed picture about the diversity of DNA methylation in a sample than simply looking at the methylation level at each position. 

The study of the diversity and dynamics of DNA methylation patterns has recently generated a great deal of interest as it allows assessment of the methylation status in subsets of cells within a sample. Such studies have provided novel insights into the role of DNA methylation in cell differentiation and reprogramming, and the evolution of tumours (for instance [10] [11] [12] ). It has also been proposed that the DNA methylation patterns present in heterogeneous samples could be effective tumour-specific biomarkers [13]. 

The approach of looking at methylation patterns instead of individual CpG sites can be hampered by the lack of sequencing coverage depth. For reasons of cost, most whole genome bisulphite sequencing studies have a mean genomic coverage in the 10-100 range. If the underlying sample contains hundreds of methylation patterns, they cannot be sampled representatively. Consequently, studies looking at DNA methylation diversity have focussed on short patterns (around 4 CpGs) [12]. 

As an alternative, in order to reach a high coverage, researchers have often focussed on specific loci, either by sequencing PCR amplicons of bisulphite converted DNA, or by reduced representation bisulphite sequencing, or by using a capture assay (for review see [14] ). In this paper, we focus on the analysis of amplicon data, but the statistical framework introduced here could be applied to data extracted from other types of sequencing approaches such as reduced representation and capture-based sequencing. 

The problem of determining methylation patterns in the original sample from the observed data is non trivial. The purpose of this paper is to infer formally the probability distribution over all possible methylation profiles defined by the population of methylomes at a given locus. We show that taking into account the effect of the nonsystematic errors of incomplete bisulphite conversion, as well as sequencing error, is critical as this removes a large number of spurious patterns present in the raw reads.
section_name: Background

section_name: Results and discussion

section_content: The probability distribution over methylation patterns at a given locus from from bisulphite sequencing data is estimated via an algorithm described below in the Methods section. The algorithm is implemented as an R Bioconductor [15] package MPFE (for Methylation Patterns Frequency Estimation). 

As the true distribution over methylation patterns is always unknown in the laboratory, we have constructed a number of synthetic data sets to test the effectiveness of the algorithm. For a locus with n CpG sites we prescribe a true distribution θ k, k = 1,. . ., 2 n, over the 2 n possible methylation patterns. We simulate from these patterns a set of N read initial reads, each labelled with its 'true' methylation pattern, and then redistribute the reads among patterns according to the statistical model described in the Methods section to simulate errors due to incomplete bisulphite conversion and sequencing errors. 

The rates of conversion and sequencing error can be estimated by spiking-in non-methylated DNA of known sequence, or by looking at positions known in advance not to be methylated [16]. 

Incomplete conversion is specified by a non-conversion rate parameter equal to the probability that an unmethylated cytosine will fail to convert. Its value is typically of order 10 -2, and will be assumed in our simulations to be estimated independently from the rate of conversion of non-CpG cytosines. For instance, it could be calculated based on sequences known a priori not to be methylated. The sequencing error rates are specified by a vector η = (η 1,. . ., η n ), where η s ∼ O(10 -2 ) is the probability that site s is methylated but registers as unmethylated and vice versa. These two sources of error can generate spurious methylation patterns, that is, patterns for which the observed read count y k is non-zero when the true frequency of the pattern, θ k, is zero. The aim is to assess the ability of the algorithm to recover the true distribution θ k from a set of observed read counts y k, and, more specifically, determine whether spurious patterns can be identified. 

The algorithm can be run in two possible modes: a slow (exact) mode, which performs a complete calculation over all possible 2 n methylation patterns, and an (approximate, default) fast mode which assumes θ k = 0 for any pattern for which the observed read count y k is zero. Because of the exponential growth in the number of patterns, we find in general that use of the function in the slow mode becomes computationally prohibitive for n > 8. However, there is very little difference in the computed results between the two modes (see below). Furthermore, the number of realised patterns tends to be relatively small and the performance of the function is adequate even for large n. 

To illustrate the concept of the algorithms, we begin with a small synthetic dataset corresponding to a locus with n = 6 CpG sites, and a distribution of pattern abundances θ i contrived to mimic a combination of high and low abundance patterns as observed in a real dataset. Table 1 and Figure 1 show the results of creating the dataset assuming a nonconversion rate = 0. 005, sequencing errors η = (0. 008, 0. 006, 0. 006, 0. 006, 0. 006, 0. 008) to model a signal that degrades towards the ends of the reads, and a total number of reads N read = 2000 to generate read counts y i. These data are then analysed using the same and η values in both the slow and fast modes to generate estimated pattern abundances θi. 

For this synthetic dataset we find that for any pattern for which the 'observed' read count y i is zero, the 'true' abundance θ i and the estimated abundance θi from the slow-mode version of the algorithm are also zero. For this reason, results are only shown for patterns for which the read count y k is non-zero. For completeness, the plot produced for all 64 patterns by running our package in the slow mode is given in Additional file 1. 

We observe that for almost all patterns the estimated distribution θk is closer to the true distribution θ k than the naive read proportion y k /N read, the only exception being a slight shift in the wrong direction for the pattern m 64 (111111). 

We observe also that the algorithm has the effect of skewing the distribution of reads away from lowfrequency, more highly methylated patterns towards the totally unmethylated pattern, thus reducing the false discovery rate. This algorithmic effect will generally be the case for any realistic dataset (see Additional file 2). Furthermore, our implementation of the algorithm registers whether, for any given pattern k, the estimate θk is identically zero, that is, it makes a call as to whether the pattern is present or absent. In this example, no real pattern is classified as spurious. The algorithm correctly identifies 14 out of the 18 spurious patterns in the slow mode, and 13 out of the 18 in the fast mode. For the one extra pattern which was missed by the fast mode, namely pattern 110000, the estimated proportion θi (fast) < 10 -4 is very low. 

In general, when the number of CpG sites n in an amplicon is large, it is expected that only a small faction of the 2 n possible patterns will be present. Furthermore, it is rare for a true pattern with θ k > 0 to have zero counts as a result of incomplete bisulphite conversion or sequencing errors. For instance, in the the current example none of the patterns with a positive true frequency θ k had zero reads, and for the remaining patterns there is no substantial difference between the two implementations of the algorithm. From now on, the discussion focusses on the fast implementation. 

Figure 2 and Additional file 3 show the results of applying the fast implementation of the algorithm to synthetic data modelled on biological data from a PCR amplicon in the honey bee Apis mellifera genome (see Biological data The 'true' distribution θ k (black dots), observed read counts y k (blue pluses) and estimated distribution θk from the slow (purple squares) and fast (red crosses) implementations of our algorithm over methylation patterns for synthetic data with n = 6 CpG sites. The non-conversion rate is set to be = 0. 005, the sequencing errors are set to be η = (0. 008, 0. 006, 0. 006, 0. 006, 0. 006, 0. 008), the total number of reads is N read = 2000. 

Only patterns with non-zero reads are shown and methylation patterns are ordered lexicographically. Data for the three patterns (000000, 111101 and 111111) which are beyond the range of the plot can be found in Table 1. section). To obtain the dataset, the function was applied once to a biological dataset of N read = 730 reads from an amplicon corresponding to a locus with n = 9 CpG sites. 

To maintain a similar number of non-zero reads the 'true' distribution of the synthetic dataset was taken to be

where θinit i is the result of the initial application of the algorithm. Here the non-conversion parameter is = 0. 01, and the sequencing error rate η = 0. 02 is taken to be uniform across all CpG sites. 

Of the 46 spurious patterns in this dataset, 16 are correctly identified and no false identifications of spurious patterns are made. For the 30 failed identifications, the program estimates a lower estimate θi than the read proportion y i /N read. 

Given that the MPFE algorithm requires as input an estimate of the non-conversion rate and read error rate η, it is important to gauge the sensitivity of pattern frequency estimates to these parameters. Figure 3 shows the variation in estimated pattern abundances for the dataset of Figure 1 as the values of and η used by MPFE are perturbed from the 'true' values used to construct the synthetic data. We observe that the estimated abundances are relatively insensitive to for the actually occurring patterns, but drop rapidly with increasing for most of the spurious patterns. It is perhaps not surprising that θi will be sensitive to the for those spurious patterns for which θi > 0: As explained in Additional file 2, increasing has the effect of skewing the distribution towards the less methylated patterns, which in general tend to be the more abundantly ocurring patterns. A relevant point here is that the correction for non-conversion almost invariably moves the estimates θi in the correct direction from the raw data for the spurious patterns, while leaving even the low-frequency non-spurious patterns almost unchnaged. Also, not surprisingly, the estimates θi are sensitive to the read error rate η for both spurious and non-spurious patterns.
section_name: Synthetic data

section_content: The effectiveness of our algorithm in identifying spurious patterns can be further gauged by introducing a threshold on the estimated pattern abundance. In the following definitions we only consider methylation patterns with non-zero reads y i. 

We set a threshold K ∈[ 0, 1] as a binary classifier and, using the estimated distribution θi as a test statistic, declare pattern i to be spurious when θi ≤ K. Patterns are defined to be true or false positives or negatives according to the rules TP if θi ≤ K and θ i = 0, FP if θi ≤ K and θ i > 0, TN if θi > K and θ i > 0, FN if θi > K and θ i = 0. 

True positive rates (TPR) and false positive rates (FPR) are defined in the usual way as

An analogous set of definitions applies using the raw data count proportions y i /N read as a test statistic. Note that this classification does not constitute classical hypothesis testing per se, as the threshold does not easily translate to a p-value under a well-defined null hypothesis: patterns are not independent, and specifiying θ i = 0 for a given pattern does not determine the distribution of the estimator θi without further assumptions about the remaining 2 n -1 patterns. 

Figure 4A shows the TPR curves for the data of Figure 1. It shows that using θi results in a clear improvement in detecting which methylation patterns are likely to be a spurious artefact of incomplete conversion and reading error. The FPR curves for both test statistics are constantly zero for the same threshold range in the TPR graph. 

Figure 4B shows the TPR curves for the synthetic data based on biological data from an amplicon analysed in Figure 2. Again we observe a clear improvement in detecting which methylation patterns are likely to be a spurious artefact of incomplete methylation and reading error.
section_name: Detecting spurious patterns

section_content: Amplicons were obtained as described in [4]. Briefly, genomic DNA was extracted from brains of adult honeybee workers and treated with sodium bisulphite. A region of gene GB17113 (gene ID: 724724, a 6phosphofructokinase) was then amplified by PCR and sequenced using the 454 technology. No ethical approval was required for this work. 

Below we apply the fast algorithm to two examples from this dataset assuming a non-conversion rate of = 0. 01 and a global sequencing error rate of η = 0. 02. The first example is shown in Figure 5 Observations (i) and (ii) can be explained by the fact that the edit distance between the two patterns covered by a single read and any pattern observed to be highly abundant renders it unlikely that these patterns have arisen through sequencing errors or incomplete conversion. Observation (iii) arises because the spurious patterns with > 30 reads are just one sequencing error or one incomplete conversion away from the most abundant pattern, m 0 (00000000). Figure 6 and Additional file 4 show the second example, with n = 14 CpG sites and 160 patterns with non-zero reads. The total number of reads is N read = 2347. In this case 47 patterns are called as spurious. Note that these data indicate that the methylation statuses of neighouring CpG loci are correlated. This correlation was also observed by Lyco et al. [4] and has motivated our approach that has the advantage of being able to accommodate neighbouring spatial correlations Figure 4 The TPR versus the threshold K using the test statistic θi (red curve) and y i /N read (blue curve) for the synthetic data of (A) Figure 1 and (B) Figure 2. 

between CpG positions without imposing any a priori structure.
section_name: Biological data

section_content: We have developed an algorithm for estimating the true distribution of methylation patterns in at a genomic locus containing n CpG sites. The algorithm, based on a constrained multinomial model, accounts for statistical variation due to incomplete bisulphite conversion and sequencing errors. This method can be readily applied to methylation patterns extracted from amplicon sequencing data analysed with with software such as BiQ-Analyser [17]. Further work would be required to extract methylation patterns counts from whole-genome sequencing data. 

The analysis differs from previous treatments in that the estimated distribution is a joint probability distribution over patterns which preserves maximal information pertaining to interaction between different CpG sites, as opposed to a pointwise measure of methylation at each Numerical experiments with realistic synthetic data indicate that the algorithm is able to identify the majority of the spurious observed methylation patterns, that is, patterns which are not present in the original library but are observed in the reads because of incomplete bisulphite conversion or sequencing errors. In general, our estimates are closer to the true distribution than the naive estimates given by the relative proportion of observed read counts for almost all patterns in each simulation (see Figures 1, 2, and Table 1 ). 

Application of the algorithm to biological data consisting of bisulphite treated amplicon reads for a honeybee genomic sequence predicts that a correspondingly high proportion of observed methylation patterns in real data may indeed be spurious. However, our results also reveal an important number of real methylation patterns in this biological sample. This complexity of the methylation landscape is virtually undetectable when one only considers position-wise methylation level, but becomes apparent through our method. 

In the future, the statistical method presented here could be extended and refined to deal with systematic sources of errors (for instance non-homogeneous bisulfite conversion rates, differential amplification of different epialleles) and to extract information from incomplete data (reads where one or more positions of the pattern are missing, which are currently ignored).
section_name: Conclusions

section_name: Methods

section_content: We take as the starting point of our statistical model a population of methylomes restricted to a locus containing n CpG sites. Each member of the population within a given class is represented by a vector of non-independent binary valued random variables K = (K 1,. . ., K n ), where each K s ∈ {0, 1} labels the methylation state (0 for unmethylated, 1 for methylated) at the s-th CpG site at this locus. The population defines a methylation profile represented by the probability distribution of realising the pattern k = (k 1,. . ., k n ) in a read randomly chosen from the population:

For convenience, from here on we will label the possible methylation patterns by the integers k = 1,. . ., 2 n, and set θ k = θ k, where k -1 is the integer whose binary representation is the methylation pattern k. 

Our aim is to estimate the distribution θ k representing the relative abundance of methylation pattern k from high throughput sequencing data consisting of a set of integer valued read counts Y k. In a typical experiment, the number n of CpG sites in an amplicon may be up O( 10 2 ), and the total number of read counts N read = 2 n k=1 Y k may be up to O (10 6 ). 

The model takes into account two sources of error. First, the bisulphite conversion of unmethylated cytosine to uracil is not 100% efficient. There is a probability that an unmethylated CpG site will register as being methylated, where ∼ O(10 -2 ) can be estimated from the cytosines known not to be methylated (mitochondrial genome, chloroplastic genome, spike-ins, etc). The second type of error is caused by sequencing. For many applications this may be assumed for practical purposes to be site independent. However, to allow for effects such as degradation of the read quality towards the ends of the reads, we will assume there is a site-dependent probability η s ∼ O(10 -2 ) that if site s is unmethylated it will register as methylated and vice versa. It follows that if the true methylation pattern of any given read is K, but the read registers as being pattern L, then

where, as above, we adopt the conventon that k -1 is the integer whose binary representation is the methylation pattern k = (k 1,. . ., k n ) and -1 is the integer whose binary representation is the methylation pattern l = ( 1,. . ., n ), and

where, for each s = 1,. . . n,

is a 2 × 2 matrix whose rows and columns are labelled 0 (for unmethylated) and 1 (for methylated). In fact the matrix M whose elements are M k is the Kronecker product E 1 ⊗. . . ⊗ E n. Eqs. ( 1 ) and (2) imply that the probability that a random read will be the pattern is

say. Assuming each read to be independent, for an experiment with a given total number of reads N read the observed set of read counts represented by the random variable Y has a multinomial distribution:

Prob (Y = y |φ) = N read ! y 1 ! y 2 !. . . y 2 n ! φ 1 y 1. . . φ 2 n y 2 n. (6) In a recent applications note, [9] develop a statistical model for the distribution of the number of reads which register as being methylated in a pooled set of bisulphitesequencing reads from CpG sites in a given region of a genome. Their model is mathematically equivalent to the n = 1 version of the above model, and as such can be simplified to a single binomial distribution (see Additional file 2).
section_name: Statistical model of bisulphite sequencing

section_name: Acknowledgements

section_content: This project is supported by Australian Research Council Discovery Grants DP120101422 and DE130101450 and National Health and Medical Research Council Grant NHMRC525453. We thank Ryszard Maleszka for sharing sequencing data.
section_name: Acknowledgements

section_name: Parameter estimation

section_content: The parameters of the distribution over methylation profiles, θ k, are estimated by maximising the log likelihood:

subject to the constraint that (θ 1,. . ., θ 2 n ) lies in the (2 n -1)-dimensional simplex

One may be tempted to use the usual formula, φ = y /N read, for the maximum likelihood estimate of multinomial parameters, and simply invert the matrix M to recover θk. However this will not work for any realistic data because the matrix M shrinks the simplex to a smaller volume. In practice many of the y are zero, which leads to a naive estimate φ on the boundary of the unshrunken simplex in φ-space, and this boundary is not included in the shrunken simplex (see Figure 7 for the n = 2 case, in which the simplex is tetrahedron). Instead we maximise the log likelihood over the allowed domain numerically by using the R function constrOptim(). Unfortunately the performance of this function becomes prohibitively slow for n 8 as the dimensionality of the parameter space grows exponentially. However, we have noticed in numerical simulations that if the observed counts y k are zero for a subset of the possible patterns, the corresponding estimates θk are zero (or in rare cases, very close to zero) for the same subset. Thus we have implemented an algorithm which only searches over that part of the boundary of S constrained by θ k = 0 for those k such that y k = 0. The algorithm remains reasonably efficient on a standard desktop computer provided the number of observed methylation patterns does not exceed about 200. This allows analysis of most realistic datasets while still addressing the biologically relevant question of identifying spurious methylation patterns which are the result of incomplete methylation. 

In Additional file 2 we prove that both the exact maximum likelihood estimate, and the aproximate maximum likelihood estimate over reduced part of the boundary described above are unique. However, in both cases the function constrOptim() is of finite accuracy in locating the maximum of the log-likelihood. Thus, if the located maximum θ is close to the boundary of the simplex, our algorithm also calculates the value of the loglikelihood at several nearby points on the boundary. If this results in a log-likelihood bigger than or equal to the maximum reported by constrOptim(), the appropriate point on the boundary is taken as the maximum likelihood estimate, and those patterns m k for which θk ≡ 0 are reported as being spurious reads. 

Additional file 2 also contains an argument that for realistic datasets and parameter values, the estimated distribution θi is in general skewed towards less-methlyated states relative to the naïve estimate y i /n read, and that the set of patterns reported to be present is a subset of (or the same set as) the set of patterns naïvely observed. These observations hold rigorously for any dataset if the algorithm is run with the read-error rate η s set to zero for all sites s.
section_name: Parameter estimation

section_content: Additional file 1: Estimated pattern abundances using the exact algorithm. Estimates θi calculated with the exact, slow implementations of our algorithm for the synthetic dataset of Figure 1. Methylation patterns are labelled lexicographically from m 1 = 000000 to m 64 = 111111. Data for patterns m 1, m 62 = 111101, and m 64 are beyond the range of the plot, but are listed in Table 1. 

Additional file 2: Technical details. Analysis of the relationship of the statistical model used by Akman et al. [9] to our statistical model, proof of uniqueness of maximum likelihood estimate and argument that the number of reported methylation patterns is reduced by the MPFE algorithm.
section_name: Additional files

section_name: Additional file 3: Table of results

section_content: The authors declare that they have no competing interests. 

Authors' contributions SF, CJB, SRW conceived and designed the project. SF prepared the datasets. PL, CJB developed the mathematical and statistical model, carried out the analysis and developed the software. PL, SF, CJB wrote the manuscript. All authors read and approved the final manuscript.
section_name: Competing interests