a–d, Distance difference matrices (DDMs) calculated between the pH 7 (reference) structure and either the pH 10 or the pH 5 structure. Blue and red indicate decreases and increases in Cα–Cα distances in the pH 10 or pH 5 structures as compared to the pH 7 structure, respectively. The secondary structures of BinA (a–c) and BinB (a, b, d) are recapitulated by cartoons on the side or the diagonal of the DDMs. These cartoons are coloured by subdomain as in Fig. 4. a, Intermolecular (BinA versus BinB) DDM between the pH 10 and the pH 7 structures. This DDM illustrates that the BinAB dimer contracts upon pH elevation, with the two trefoil domains coming closer to one another. This might be due to electrostatic repulsion at crystal contact zone 5 (Fig. 4e, Extended Data Fig. 6e and Supplementary Table 7), which involves the trefoils of BinA and BinB from two symmetry-related dimers. b, Intermolecular (BinA versus BinB) DDM between the pH 5 and the pH 7 structures. The pH 5 structure is overall slightly more compact than the pH 7 structure but shows no major conformational changes. c, d, Intramolecular DDMs of BinA (c) and BinB (d). Changes in Cα–Cα distances between the pH 10 and the pH 7 structures are reported below the diagonal, while those between the pH 7 and the pH 5 structures are shown above the diagonal. The pH 5 and pH 7 structures of BinA (c) and BinB (d) are overall similar, with only the BinA loop Ile110–Arg120 and BinB loop Lys175–Ser184 showing a noticeable difference in conformation. In contrast, the pH 10 structures of BinA (c) and BinB (d) appear more compact. On the local level, striking conformational changes are observed upon pH elevation in the N-terminal propeptide of BinA, in loops Ile110–Thr120 (trefoil) and Asn341–Tyr345 (PFD) of BinA, and in loop Lys175–Ser184 (trefoil) of BinB. The increase in compactness is due to the trefoil domain coming closer to the PFD in both BinA and BinB. BinA loop Ile110–Thr120 appears sensitive to both increases and decreases in pH. e, f, Porcupine plots depicting differences between structures of BinAB for pH 7 versus pH 5 (green arrows) and pH 7 versus pH 10 (red arrows). The pH 7 structure of BinAB is shown, coloured by subdomain as in Fig. 4. The movement of Cα atoms is indicated by arrows on the ribbon representation, with the magnitude of motions illustrated by length of arrows exaggerated by 2.5 Å to increase visibility (for all atoms that move by more than 0.1 Å). e, View of the BinAB dimer, in an orientation similar to Fig. 4b. As compared to Fig. 3a, b, this view is rotated by 180° around the vertical axis. f, View from the top of the trefoil domains; this face of the BinAB dimer is presumably that interacting with the apical membrane of larvae midgut cells. The view in f is 90° apart from that in e.