As described below, the nucleotides in RNA are chemically modified in very many different ways. In DNA, however, chemical modification is limited to methylation of bases. In bacterial cells, for example, certain adenines and cytosines are methylated as a way of distinguishing the host-cell DNA from invading viruses (virus DNA that is not methylated in the same way as the host-cell DNA will be cleaved by a cellular restriction endonuclease).
In vertebrates, nucleotide modification in DNA is directed at the 5′ carbon of certain cytosines, forming 5-methylcytosine (5-meC), which can be hydroxylated to form 5-hydroxymethylcytosine (Figure 1). Base pairing is not affected: both 5-meC and 5-hydroxymethylcytosine base-pair as normal with guanine. As detailed in Chapter 10, these modifications are epigenetic marks that serve as a reversible switch to regulate transcriptional activity.

Fig1. Structures of 5-methylcytosine (meC) and 5-hydroxymethylcytosine (hmC). (A) The carbon 5 of cytosine has an attached hydrogen that has been replaced by the groups highlighted in pale peach to give 5-methylcytosine and 5-hydroxymethylcytosine. (B) In terms of base pairing, the modified cytosines behave as normal cytosines and base-pair normally with guanine (the carbon-5 atom of cytosine is directed away from the laterally opposed guanine, as shown in this example of base pairing of meC to G; compare with the G-C base pairing in Figure 2A). The cytosine modifications are epigenetic marks that are important for regulating gene expression.

Fig2. Base pairing in DNA. (A) Watson–Crick base pairing. A-T base pairs (left) have two connecting hydrogen bonds (dotted red lines); G-C base pairs have three hydrogen bonds. Fractional positive charges and fractional negative charges are shown by δ+ and δ−, respectively. (B) When bases pair in DNA they are arranged in the same plane, perpendicular to the long axis of the DNA helix. Van der Waals attractions between neighboring bases on each strand (shown by green dashed lines for one set of neighboring bases, as an example) are also important in the stability of the double helix. (C) Hoogsteen base pairing. Here a Hoogsteen A-T base pair is shown. It arises by flipping of the Watson–Crick A-T base pair via rotation of the N-glycosidic bond linking the sugar to nitrogen atom 9 of the adenine. As a result, the hydrogen atom attached to nitrogen atom 3 of thymine now hydrogen-bonds to nitrogen atom 7 of adenine, instead of the nitrogen atom 1 in the Watson–Crick base pair.
The CpG dinucleotide (cytosine with a guanine as its 3′ neighbor) can be a target sequence for methylation of cytosines in vertebrate DNA, but it has become clear that cytosine methylation in vertebrate DNA can also occur at cytosines with a different 3′ neighbor (adenine, cytosine, or thymine), notably in brain cells and pluripotent cells (see He & Ecker [2015] PMID 26077819; Further Reading).