Reading tRNA
You'll recover a tRNA's secondary structure from nothing but atom coordinates: find the base pairs, write them in dot-bracket, separate the cloverleaf from the tertiary contacts that fold it into an L, and measure its sugars. Then you'll measure B-DNA's grooves. Programs like DSSR and RNAView do this for every RNA entry in the PDB.
Structures: 1EHZ, yeast tRNA-Phe at 1.93 Å, and 1BNA, the B-DNA dodecamer from lesson 7.1. The
helpers come from primer.py (structure, fetch, display_widget), with Biopython and NumPy.
Task 1: the sequence, including modified bases
Fourteen of tRNA-Phe's 76 nucleotides are chemically modified after transcription, and a structure file
gives each one its own residue name (2MG, PSU, YYG, …). PSU is pseudouridine, a rearranged
uridine written Ψ. Each file's MODRES records map a modified
residue to its parent base. A MODRES line is fixed-width: the modified name sits in columns 13–15 and the
parent in columns 25–27. Parse those records and build the 76-letter sequence with each modified base
replaced by its parent.
from primer import structure, fetch
trna = structure("1EHZ")[0]["A"]
nts = [r for r in trna if "C1'" in r] # nucleotides only: skip waters and metal ions
print(len(nts), "nucleotides")
76 nucleotides
Solution
modres = {}
for line in open(fetch("1EHZ")):
if line.startswith("MODRES"):
modres[line[12:15].strip()] = line[24:27].strip()
parent = {r.id[1]: modres.get(r.get_resname(), r.get_resname()) for r in nts}
by_id = {r.id[1]: r for r in nts}
seq = "".join(parent[r.id[1]] for r in nts)
print(seq)
print("modified:", ", ".join(f"{r.get_resname()}{r.id[1]}→{parent[r.id[1]]}" for r in nts if r.get_resname() in modres))
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUCUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCACCA modified: 2MG10→G, H2U16→U, H2U17→U, M2G26→G, OMC32→C, OMG34→G, YYG37→G, PSU39→U, 5MC40→C, 7MG46→G, 5MC49→C, 5MU54→U, PSU55→U, 1MA58→A
Biopython files modified residues as hetero residues (their ids start with H_), which is why the filter
above keys on the C1′ atom rather than on the residue type. Position 37 is wybutosine (YYG), a guanosine
with a large extra ring system that keeps the anticodon loop stacked.
Task 2: find the base–base hydrogen bonds
Two bases are paired when nitrogen or oxygen atoms on their edges sit within hydrogen-bonding distance. For every pair of nucleotides at least two apart in sequence, list the contacts under 3.4 Å between N or O atoms that belong to the bases (not the sugar or phosphate), and keep the residue pairs with at least two such contacts.
Solution
import itertools
BACKBONE = {"P", "OP1", "OP2", "O5'", "C5'", "C4'", "O4'", "C3'", "O3'", "C2'", "O2'", "C1'"}
def base_polar(res):
return [a for a in res if a.element in ("N", "O") and a.get_id() not in BACKBONE]
contacts = {}
for a, b in itertools.combinations(nts, 2):
if b.id[1] - a.id[1] < 2:
continue
hb = [(x.get_id(), y.get_id(), round(float(x - y), 2))
for x in base_polar(a) for y in base_polar(b) if x - y < 3.4]
if len(hb) >= 2:
contacts[(a.id[1], b.id[1])] = hb
print(len(contacts), "residue pairs with two or more base–base contacts")
for (i, j), hb in list(contacts.items())[:6]:
print(f"{parent[i]}{i}–{parent[j]}{j}:", ", ".join(f"{p}···{q} {d} Å" for p, q, d in hb))
39 residue pairs with two or more base–base contacts G1–C72: O6···N3 3.34 Å, O6···N4 2.83 Å, N1···N3 2.88 Å, N2···O2 2.84 Å G1–A73: O6···N1 3.32 Å, N1···N3 3.22 Å C2–G71: O2···N2 3.01 Å, N3···N1 2.97 Å, N4···O6 2.86 Å G3–C70: O6···N4 2.94 Å, N1···N3 2.87 Å, N2···O2 2.76 Å G3–G71: N1···N1 3.25 Å, N3···N2 3.02 Å G4–U69: O6···O2 3.36 Å, O6···N3 2.91 Å, N1···O2 2.82 Å
Task 3: the cloverleaf in dot-bracket
Classify each contact. A Watson–Crick G–C pair has all three of N1···N3, O6···N4, and N2···O2; an A–U pair has N1···N3 and N6···O4; a G·U wobble has G N1···U O2 and G O6···U N3. Call a canonical pair part of a stem if a neighboring pair stacks on it, or . Write the stem pairs in dot-bracket and compare with the textbook cloverleaf.
Solution
from primer import display_widget
CANONICAL = {("G", "C"): [("N1", "N3"), ("O6", "N4"), ("N2", "O2")],
("A", "U"): [("N1", "N3"), ("N6", "O4")],
("G", "U"): [("N1", "O2"), ("O6", "N3")]}
def canonical(i, j):
for x, y in ((i, j), (j, i)):
need = CANONICAL.get((parent[x], parent[y]))
if need and all(by_id[x][p] - by_id[y][q] < 3.4 for p, q in need):
return True
return False
canon = {k for k in contacts if canonical(*k)}
stems = {(i, j) for i, j in canon if (i + 1, j - 1) in canon or (i - 1, j + 1) in canon}
db = ["."] * len(nts)
for i, j in stems:
db[i - 1], db[j - 1] = "(", ")"
db = "".join(db)
cloverleaf = "(((((((..((((........)))).(((((.......))))).....(((((.......))))))))))))...."
print(seq)
print(db, " from coordinates")
print(cloverleaf, " textbook")
print("differ at", [k + 1 for k in range(len(db)) if db[k] != cloverleaf[k]])
print("canonical but not in a stem:", sorted(canon - stems))
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUCUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCACCA (((((((..((((........)))).((((.........)))).....(((((.......)))))))))))).... from coordinates (((((((..((((........)))).(((((.......))))).....(((((.......)))))))))))).... textbook differ at [31, 39] canonical but not in a stem: [(19, 56)]
The coordinates give back the whole cloverleaf, including the G4·U69 wobble in the acceptor stem, except for one pair: A31·Ψ39 at the bottom of the anticodon stem. In this crystal it has a single N1···O2 contact, so the pair is strained, and our three-contact rule misses it (the first self-check asks what loosening the rule would cost).
The other leftover, G19–C56, is a perfect Watson–Crick pair. It isn't in a stem: it joins the D loop to the T loop, crossing the D and T stems.
Task 4: the tertiary contacts
Now take every contact that is neither a stem pair nor a cross-strand neighbor of one (a contact like (1, 73), which sits diagonally next to the stem pair (1, 72), is a stacking artifact of the helix). What's left holds the L together. Draw them all on the cloverleaf.
Solution
def beside_stem(i, j):
return any((i + di, j + dj) in stems for di, dj in ((1, 0), (-1, 0), (0, 1), (0, -1)))
tertiary = sorted(k for k in contacts if k not in stems and not beside_stem(*k))
for i, j in tertiary:
atoms = ", ".join(f"{p}···{q}" for p, q, _ in contacts[(i, j)])
print(f"{parent[i]}{i:<3} {parent[j]}{j:<3} {atoms}")
display_widget("rna-fold", "The cloverleaf found in Task 3, with every tertiary contact from Task 4 as a "
"dashed line. They converge on the D and T loops, the elbow of the L.",
mode="draw", sequence=seq, structure=db, tertiary=[list(p) for p in tertiary])
U8 A14 O2···N6, N3···N7 A9 A23 N7···N6, N6···N7 G15 C48 N1···O2, N2···N3 G15 U59 N1···O2, N2···N3 U16 U59 N1···N3, O2···O2, O2···N3, N3···O2, N3···N3 G18 U55 N1···O4, N2···O4 G18 G57 N9···N1, N3···N1 G19 C56 O6···N4, N1···N3, N2···O2 G19 G57 N9···N2, N7···N2 A21 C48 N9···N4, N3···N3 G22 G46 N7···N1, O6···N2 G26 A44 O6···N6, O6···N1, N1···N1 U54 A58 N3···N7, O2···N6
The cloverleaf found in Task 3, with every tertiary contact from Task 4 as a dashed line. They converge on the D and T loops, the elbow of the L.
Read the atom names and you can name the edges (lesson 7.2). U8·A14 joins U's Watson–Crick edge (N3, O2) to A's Hoogsteen edge (N7, N6), with the glycosidic bonds trans: a reverse Hoogsteen pair. T54·m¹A58 is the same kind. G15·C48, the "Levitt pair", uses both Watson–Crick edges but with the strands parallel, so it is trans Watson–Crick/Watson–Crick. G22 pairs with m⁷G46 while also pairing with C13 in the D stem, and A9·A23 sits beside U12–A23: these are base triples. G18·Ψ55 and G19–C56 tie the D loop to the T loop.
Task 5: sugar puckers
Compute the pseudorotation phase of all 76 sugars, with the pucker function from lesson 7.1. RNA
should be C3′-endo. Which residues aren't, and where are they in the structure?
Solution
import math
import numpy as np
def torsion(p0, p1, p2, p3):
b0, b1, b2 = p0 - p1, p2 - p1, p3 - p2
b1 = b1 / np.linalg.norm(b1)
v, w = b0 - (b0 @ b1) * b1, b2 - (b2 @ b1) * b1
return math.degrees(math.atan2(np.cross(b1, v) @ w, v @ w))
RING = [("C4'", "O4'", "C1'", "C2'"), ("O4'", "C1'", "C2'", "C3'"), ("C1'", "C2'", "C3'", "C4'"),
("C2'", "C3'", "C4'", "O4'"), ("C3'", "C4'", "O4'", "C1'")]
def pucker(res):
t0, t1, t2, t3, t4 = (torsion(*(res[a].coord.astype(float) for a in names)) for names in RING)
s = math.sin(math.radians(36)) + math.sin(math.radians(72))
P = math.degrees(math.atan2((t4 + t1) - (t3 + t0), 2 * t2 * s)) % 360
return P, t2 / math.cos(math.radians(P))
points, south = [], []
for r in nts:
P, tm = pucker(r)
i = r.id[1]
where = "stem" if db[i - 1] != "." else "loop"
points.append({"label": f"{parent[i]}{i} ({where})", "P": round(P), "tm": round(tm), "group": where})
if 90 < P < 270:
south.append(f"{parent[i]}{i}")
print(f"{len(nts) - len(south)} of {len(nts)} sugars are north (C3′-endo family).")
print("South (C2′-endo family):", ", ".join(south))
display_widget("pucker-wheel", "Every sugar of tRNA-Phe, colored by whether its base is in a stem or a loop.",
points=points)
66 of 76 sugars are north (C3′-endo family). South (C2′-endo family): U7, A9, G18, G19, G46, U47, C48, A58, C60, A76
Every sugar of tRNA-Phe, colored by whether its base is in a stem or a loop.
Every stem sugar is C3′-endo, as an A-form helix requires. The ten C2′-endo sugars are all in loops or at the junctions where the backbone has to turn sharply: U7 and A9 next to the acceptor stem, G18 and G19 in the D loop, m⁷G46 to C48 in the variable loop, m¹A58 and C60 in the T loop, and the 3′-terminal A76. A C2′-endo sugar lengthens the phosphate–phosphate step, which is one way a backbone makes a turn that A-form geometry can't.
Task 6: look at it
Load 1EHZ in the viewer below, or in Mol* or ChimeraX. Find the anticodon (Gm34, A35, A36), the 3′ end (A76), and the elbow. Measure the distance between the anticodon and the 3′ end, the two ends of the adaptor.
tRNA-Phe (1EHZ). First view: the anticodon (aqua) and the acceptor stem with its single-stranded ACCA end (blue). The phosphates of A35 and A76 are about 73 Å apart, across the length of the L. Second view: the ten C2′-endo nucleotides from Task 5 (orange), all at turns in the backbone.
Open 1EHZ in Mol*Solution
print(f"P35 to P76: {by_id[35]['P'] - by_id[76]['P']:.1f} Å")
P35 to P76: 73.0 Å
Task 7: the grooves of B-DNA
A groove's width is the gap between the two backbones across it. Measure it as a phosphorus–phosphorus distance between the strands, minus 5.8 Å for the van der Waals radii of the two phosphate groups (about 2.9 Å each). First print the whole matrix of cross-strand P–P distances for 1BNA and find the two valleys, one for each groove. Then read off each groove's width along its valley.
Solution
dna = structure("1BNA")[0]
pa = {r.id[1]: r["P"].coord for r in dna["A"] if "P" in r}
pb = {r.id[1]: r["P"].coord for r in dna["B"] if "P" in r}
D = np.array([[np.linalg.norm(pa[i] - pb[j]) for j in sorted(pb)] for i in sorted(pa)])
print("P–P distances (rows: strand A residues 2–12; columns: strand B residues 14–24)")
print(np.array2string(D, precision=1, max_line_width=120))
P–P distances (rows: strand A residues 2–12; columns: strand B residues 14–24) [[37.1 33. 27.6 22.5 19.6 17.4 17.3 18.3 18.8 18.5 18. ] [33.2 28.5 22.9 18.6 17.6 17.3 18.2 19. 19.1 18.1 16.8] [29. 24. 18.9 16.4 17.5 18.2 18.8 18.6 18. 16.7 15.3] [24.8 20.3 16.7 16.8 19. 19.5 19.1 17.6 16.1 14.9 14.5] [21.8 19. 17.4 18.8 20.5 19.7 17.8 14.7 12.9 13. 15.1] [19.3 18.5 18.1 19.6 19.9 17.8 14.6 11.3 11.1 14.3 18.8] [17.8 18.3 18.3 19. 17.9 14.9 11.6 10. 12.8 18. 23.4] [17.7 18.7 18.3 17.6 14.9 11.5 9.8 12. 17. 22.9 28.2] [19. 19.2 17.7 15.3 11.2 8.9 10.9 16. 21.7 27.3 32. ] [18. 17.8 16.4 14. 11. 12.3 16.6 22. 27.5 32.7 36.8] [18.1 16.1 13.7 10.9 10.6 15.2 20.8 26.3 31.1 35.4 38.5]]
Two valleys run along anti-diagonals. One, near 9–11 Å, pairs A residue with B residue . The other, near 16–17 Å, pairs with . Residue of strand A pairs with of strand B, so the first valley reaches four base pairs one way along the helix, and the second four pairs the other way. Those are the two grooves.
def groove(i, s):
"""Narrowest P–P gap from A residue i to B residues near s − i, minus the phosphates' radii."""
ds = [np.linalg.norm(pa[i] - pb[j]) for j in (s - i - 1, s - i, s - i + 1) if j in pb]
return min(ds) - 5.8 if ds else float("nan")
print("A residue minor groove major groove")
for i in sorted(pa):
print(f"{dna['A'][i].get_resname()[1]}{i:<10} {groove(i, 29):9.1f} Å {groove(i, 21):9.1f} Å")
A residue minor groove major groove G2 nan Å 11.5 Å C3 nan Å 11.5 Å G4 9.5 Å 10.6 Å A5 8.7 Å 10.9 Å A6 7.1 Å 11.6 Å T7 5.3 Å 12.7 Å T8 4.2 Å 12.0 Å C9 4.0 Å nan Å G10 3.1 Å nan Å C11 5.2 Å nan Å G12 4.8 Å nan Å
The major groove is about 11–13 Å wide all along. The minor groove narrows from about 9 Å to 3–4 Å for the phosphates of T8 to G10, whose partners across the groove lie four pairs back, so those readings span the AATT center. That is narrower than the canonical B-DNA minor groove (about 6 Å). Runs of A–T pairs narrow the minor groove like this, which is part of why minor-groove drugs prefer them.
Self-check
A31·Ψ39 was missed by the distance rule. Suppose you loosen the rule to accept any two-atom contact under 3.6 Å as a pair. Predict what happens to the stems and to the list of tertiary contacts.
Reasoning
You'd likely recover A31·Ψ39, but you'd also gain spurious "pairs": the cross-strand neighbors of stem pairs, like (1, 73) and (49, 66), already have contacts near 3.3 Å, and at 3.6 Å more of them qualify. Some would join stems wrongly as bifurcated pairs, and the tertiary list would fill with stacking artifacts. Distance alone trades recall against precision. Real annotation tools add donor and acceptor angles and require the two bases to be roughly coplanar.
The G19–C56 pair is canonical Watson–Crick. A mutation changes C56 to G. Predict the effect on the secondary structure and on the 3D fold.
Reasoning
The secondary structure wouldn't change: G19–C56 isn't part of the cloverleaf, and a secondary-structure algorithm wouldn't even see the loss. The 3D fold would suffer, because G19–C56 is one of the few contacts tying the D loop to the T loop at the elbow, and a G–G pair can't form the same three hydrogen bonds. The L would loosen, or the elbow would rearrange.
All stem sugars are C3′-endo. If you modeled the anticodon stem as B-form DNA instead, what would go wrong in a superposition onto the crystal structure, and roughly by how much?
Reasoning
The helix parameters would be wrong in a way that accumulates along the stem. B-form rises 3.4 Å per pair with the pairs on the axis; A-form rises about 2.6 Å with the pairs displaced nearly 5 Å from the axis. Over the four steps between the five pairs of the anticodon stem, the B model would be about 3 Å too long, and its base pairs would sit in the wrong place relative to the axis, so atom positions would differ by several Å even after the best superposition. The sugars would also be in the wrong pucker, putting the 2′-OH where C3′-endo ribose never puts it.
The minor groove you measured at the AATT center is narrower than at the CGCG ends. A drug that binds only in the minor groove and makes hydrogen bonds to adenine N3 and thymine O2 is added. Where on 1BNA do you expect it, and why there rather than at the ends?
Reasoning
At the central AATT, the same place Hoechst 33258 sits in 8BNA (lesson 7.1). Two reasons. The narrow groove there fits a flat, crescent-shaped molecule snugly, so van der Waals contact with both walls is good. And the floor of the minor groove at A–T pairs presents A N3 and T O2 as acceptors with no obstruction, while at G–C pairs guanine's N2 amino group sticks into the minor groove and would clash with the drug.