LSMA

LONDON SCHOOL OF MULTIOMICS & AI

LSMA

LONDON SCHOOL OF MULTIOMICS & AI

Free course

Free course

0 of 79 lessons

DNA methylation data: bisulfite sequencing and arrays

DNA methylation data: bisulfite sequencing and arrays

DNA methylation data: bisulfite sequencing and arrays

Methylation is a mark on DNA that changes no letter of the sequence. Bisulfite turns it into a C-versus-T difference, so reads, aligners and counts can measure it at every CpG.

In Protein–DNA binding with ChIP-seq: peaks and motifs you located the places where a protein sits on DNA. This lesson turns to a mark written on the DNA itself: methylation. It changes no letter of the sequence, yet it helps decide which genes a cell can use, and it can be read with the same sequencing tools you already know.

What is being measured

DNA methylation is the addition of a small chemical group, a methyl group, to a base. In mammals it falls almost entirely on cytosine, and almost always where a cytosine is followed by a guanine. That pair is written CpG: C, then the phosphate that links the two bases, then G. Because the opposite strand of a CpG also reads CpG, a methyl mark on one strand can be copied onto the new strand when a cell divides, which is why methylation patterns are inherited from a cell to its daughters.

The human genome holds roughly 28 million CpGs. Most of them, perhaps 70–80% in a typical adult tissue, are methylated. The exceptions matter most. CpG islands are stretches, often a few hundred to a few thousand bases long, where CpGs are unusually dense; many sit at gene promoters and are usually unmethylated. When a promoter's CpG island becomes methylated, the gene is normally switched off. You met one example in Module 1: the silencing of the DNA repair gene MLH1 in some colorectal tumours.

For each CpG in a sample, the quantity you want is the share of DNA copies that carry the mark. A sample is millions of cells, and each cell has two copies of each chromosome, so a CpG is rarely simply "on" or "off". A value of 0.5 can mean that one copy is methylated in every cell, as at some imprinted genes, or that half of the cells are methylated on both copies. The data cannot tell those apart on their own, and this matters later when we come to mixtures of cell types.

Other contexts

Cytosines outside CpGs are written CHG and CHH, where H means A, C or T. In plants they are often methylated. In most mammalian tissues they almost never are, apart from some brain cells and stem cells. This turns out to be useful: in mammalian data, non-CpG cytosines act as a built-in check on the chemistry described next.

DNA methylation data: bisulfite sequencing and arrays · LSMA free course A short DNA sequence with two CpG sites, one methylated and one unmethylated, before and after bisulfite treatment and PCR. The methylated cytosine still reads as C; the unmethylated cytosine reads as T. 1 · ORIGINAL DNA2 · AFTER BISULFITE AND PCR ACGTTCGA ACGTTTGA me vermilion: methylated CpG peach: unmethylated CpG methylated C is protected: still C unmethylated C became U, read as T The reference says C at both sites. C vs T at each site = methylated vs not.
Bisulfite turns unmethylated cytosine into uracil, which PCR copies as thymine; methylated cytosine is protected. Comparing each read with the reference at every C reveals the methylation state. Schematic, not to scale.

Bisulfite sequencing, from reads to methylation calls

A sequencer cannot see a methyl group directly, so the standard method changes the DNA first. Treating DNA with sodium bisulfite converts unmethylated cytosine into uracil, while methylated cytosine is protected and stays as cytosine. After PCR, the uracils are copied as thymine. A C in a read therefore means "methylated here", and a T where the reference has a C means "unmethylated here". Methylation becomes a sequence difference, which an aligner and a counter can handle.

Two designs are common. Whole-genome bisulfite sequencing (WGBS) treats and sequences all of the DNA, so it measures nearly every CpG, but it needs deep sequencing to give each CpG enough reads. Reduced representation bisulfite sequencing (RRBS) first cuts the DNA with an enzyme, MspI, that cuts at CCGG, and keeps only the short fragments. Those come mostly from CpG-rich regions, so RRBS covers many promoters and CpG islands cheaply, at the cost of missing most of the rest of the genome.

Why ordinary aligners struggle

After conversion, most reads contain far fewer Cs than the genome they came from. An ordinary aligner, such as the ones in Aligning reads to a genome, would see every converted C as a mismatch and fail to place many reads. Bisulfite aligners solve this by converting the problem. Bismark makes two converted copies of the genome, one with every C turned into T and one with every G turned into A (for the opposite strand), converts each read the same way, and aligns it with Bowtie2. It then goes back to the original read to decide, at each cytosine, whether it was C or T. bwa-meth uses the same idea with BWA-MEM and is faster on large genomes.

Terminal
conda create -n methyl -c conda-forge -c bioconda bismark bowtie2 samtools trim-galore
conda activate methyl

bismark_genome_preparation genome/          # once: genome/ holds the reference FASTA
bismark --genome genome/ -1 trimmed/sample_R1.fastq.gz -2 trimmed/sample_R2.fastq.gz -o bismark/
deduplicate_bismark --paired --bam bismark/sample_R1_bismark_bt2_pe.bam --output_dir bismark/
bismark_methylation_extractor --paired-end --bedGraph --gzip -o meth/ \
    bismark/sample_R1_bismark_bt2_pe.deduplicated.bam

What this does

  • bismark_genome_preparation builds the two converted genome indexes inside the genome folder. Like the HISAT2 index, it is made once per genome.
  • bismark aligns the trimmed read pairs and writes a BAM file whose name is built from the read 1 file name. Trimming comes first, as in Trimming and filtering; Trim Galore is often used for bisulfite data because it knows the quirks of RRBS libraries.
  • deduplicate_bismark removes read pairs that start at the same positions. For WGBS this matters, because PCR copies of one fragment would otherwise count as several independent measurements of the same CpGs. It is not used for RRBS, where many fragments start at the same enzyme site by design.
  • bismark_methylation_extractor walks along every read and records each cytosine as methylated or not. With --bedGraph it also writes a coverage file, ending in .bismark.cov.gz, with one line per cytosine position: chromosome, start, end, percentage methylated, number of reads showing it methylated and number showing it unmethylated.

Bismark also writes a report for each sample. Two lines in it deserve a look every time. The mapping efficiency is lower than for ordinary DNA, because converted reads are harder to place; compare it across samples rather than with RNA-seq. And the methylation level in the CHH context should be close to zero in most mammalian samples. If it is several per cent, conversion was incomplete: some unmethylated cytosines survived the bisulfite step and are being read as methylated. Many labs also add a little unmethylated DNA from the lambda virus as a spike-in, whose conversion rate can be measured directly.

From counts to beta values, M-values and differences

For each CpG the extractor gives two numbers: m, the reads that show it methylated, and u, the reads that show it unmethylated. The usual summary is the beta value, β = m ÷ (m + u): the fraction methylated, between 0 and 1. The total, m + u, is the coverage at that CpG, and it decides how much the beta value can be trusted.

Python
import numpy as np
import pandas as pd

cols = ["chrom", "start", "end", "pct", "meth", "unmeth"]
cov = pd.read_csv("meth/sample_R1_bismark_bt2_pe.deduplicated.bismark.cov.gz",
                  sep="\t", header=None, names=cols)

cov["depth"] = cov["meth"] + cov["unmeth"]
kept = cov[cov["depth"] >= 10].copy()
kept["beta"] = kept["meth"] / kept["depth"]
kept["m_value"] = np.log2((kept["meth"] + 1) / (kept["unmeth"] + 1))

print(len(cov), "CpGs covered;", len(kept), "with at least 10 reads")
print(kept["beta"].describe())

What this does

  • The coverage file has no header line, so the column names are given in the code, in the order Bismark writes them.
  • CpGs with fewer than ten reads are set aside. With three reads, the only possible beta values are 0, 0.33, 0.67 and 1, and one read either way changes the answer by a third. Ten is a common minimum, not a law; choose one value and use it for every sample.
  • The M-value is the log2 ratio of methylated to unmethylated reads. Adding 1 to each count keeps it finite when one of them is zero.
  • The last line prints a summary of the beta values. In most mammalian samples you will see a distribution with two peaks: many CpGs near 1, a smaller group near 0 (largely the CpG islands), and fewer in between.

Beta or M?

Beta values are easy to read: 0.8 means about 80% of copies are methylated. But they are squeezed near 0 and 1, where a change from 0.95 to 0.98 is a large relative change that looks tiny. Statistical tests that assume roughly equal spread work better on M-values, which stretch the ends of the scale. A common practice is to test on M-values and report results as differences in beta, which people can picture.

Differential methylation

A differentially methylated position (DMP) is a single CpG whose methylation differs between groups. Because neighbouring CpGs tend to move together, many studies look for differentially methylated regions (DMRs) instead: runs of nearby CpGs that shift in the same direction. A region is more robust than one CpG and easier to link to a promoter or an enhancer. The statistics rest on ideas you have already met: biological replicates, as in From sample to reads, and correction for testing many places at once, the multiple-testing problem you will meet again in Module 6. Python tools for this exist, and many published analyses use R packages such as methylKit and DSS; whatever the tool, report the minimum coverage, the test and the cut-off for the size of the difference.

Worked example · why coverage matters

CpG A: 3 methylated, 1 unmethylated → β = 3 ÷ 4 = 0.75
CpG B: 30 methylated, 10 unmethylated → β = 30 ÷ 40 = 0.75
one more unmethylated read: A → 3 ÷ 5 = 0.60 · B → 30 ÷ 41 ≈ 0.73

Step by step. Both CpGs have the same beta value, 0.75. Now add a single unmethylated read to each. At CpG A the total becomes 5 and β falls to 3 ÷ 5 = 0.60, a drop of 0.15. At CpG B the total becomes 41 and β falls to 30 ÷ 41 = 0.732, a drop of about 0.02.

What the answer means. A beta value is only as good as the reads behind it. Two samples that "differ by 0.15" at a CpG with four reads each may not differ at all. That is why filters on coverage come before any comparison, and why good tests for differential methylation use the counts, not just the beta values.

Arrays, direct detection and what can mislead

Methylation arrays

For large studies, especially of human blood and tumours, the most used platform is not sequencing but an array. Illumina's Infinium arrays measure a fixed set of CpGs chosen in advance: about 450,000 on the older 450K array and about 850,000 on the EPIC array, with a newer EPIC version adding more. Bisulfite-treated DNA binds to probes designed for the converted sequence, and two colour signals, one for methylated and one for unmethylated, give a beta value for each probe. Arrays are cheap per sample and easy to compare across thousands of people, which is why large cancer and population studies, including TCGA, used them. Their limit is the fixed menu: a CpG not on the array is never measured.

Array data have their own clean-up steps. Probes that overlap a common SNP can measure the genotype instead of methylation; probes that bind in several places are unreliable; and the array uses two probe designs with slightly different value ranges, which normalisation methods correct. Sample-level checks include whether the reported sex matches the signal from the X and Y chromosomes, a quick way to catch swapped samples.

Reading methylation without bisulfite

Bisulfite is harsh: it breaks much of the DNA, and it cannot tell 5-methylcytosine from 5-hydroxymethylcytosine, a related mark common in the brain. Two newer routes avoid it. Enzymatic methyl-seq (EM-seq) uses enzymes to make the same C-to-T distinction more gently, so the reads can go through the same aligners. The long-read platforms from Long reads and repeats go further: nanopore and PacBio instruments can detect modified bases directly from the raw signal as each molecule is read. Because each read is long, they also show which CpGs are methylated together on one molecule, and on which copy of a chromosome.

The mixture problem

Different cell types have very different methylation patterns; that is part of what makes them different cell types. A blood sample is a mixture of neutrophils, lymphocytes and other cells, and a tumour sample is a mixture of cancer cells and normal tissue. If a disease changes the mix, many CpGs will appear to change methylation even if no single cell changed at all. This is the same composition trap you met with CPM in Counting reads per gene, in a new form. Analyses therefore estimate the cell-type proportions from the methylation data, using reference profiles of purified cells, and include them in the model.

The same strong link between methylation and cell state is also useful. Epigenetic clocks are models that predict a person's age from the methylation of a few hundred chosen CpGs, often to within a few years. The gap between predicted and real age is studied as a marker of biological ageing, though what it means for a single person is still debated. Clocks are a good example of the supervised models you will build in Module 7, and of why they need careful, independent testing.

The first single-base methylome of a human cell was published by Lister et al. (2009, Nature), showing non-CpG methylation in stem cells. Bismark is described by Krueger and Andrews (2011, Bioinformatics). Du et al. (2010, BMC Bioinformatics) compared beta values and M-values and recommended M-values for testing. Houseman et al. (2012, BMC Bioinformatics) introduced a widely used method for estimating cell-type proportions from methylation data, and Horvath (2013, Genome Biology) built the first multi-tissue epigenetic clock. In your methods, report the platform, the conversion check, the aligner and version, the minimum coverage and how cell composition was handled.

Common mistakes

  • Skipping the conversion check. Incomplete conversion makes everything look more methylated; check the CHH level or a spike-in for every sample.
  • Calling a C-to-T SNP an unmethylated CpG. In bisulfite data a true C/T variant looks exactly like a change in methylation; known SNP positions should be excluded or handled.
  • Deduplicating RRBS data, which removes good reads because fragments share their start site by design.
  • Comparing beta values from CpGs with very different coverage as if they were equally precise.
  • Reporting methylation changes between groups without asking whether the mix of cell types differs.

Key point

Bisulfite sequencing turns methylation into C-versus-T differences, so the familiar steps of trimming, aligning and counting apply with a special aligner. Judge each beta value by its coverage, and always ask whether a change could come from a change in the cells, not in the marks.

Further reading · Module 5The Bismark user guide: how bisulfite alignment and methylation extraction work, with every option explained. · All reading for this course

Check your understanding

1. After bisulfite treatment and PCR, a read shows T where the reference has the C of a CpG. What does that suggest?

2. A CpG has 6 methylated and 2 unmethylated reads. What is its beta value?

3. Why is cell-type composition a concern in methylation studies of blood or tumours?

Ask LSMA