Skip to contents

Algorithm 10 of the Supplementary Information to Jumper et al. (2021), p. 17. This is the only path by which the MSA stack writes into the pair stack. Rows i and j of the MSA representation are projected, their outer product is averaged over sequences, flattened and projected to the pair channel width.

Usage

Alfopm(m, wa, wb, wo, layernorm = TRUE)

Arguments

m

MSA representation, an s x n x cm array.

wa, wb

The two projections of line 2, each c x cm.

wo

Output projection, cz x (c * c) (line 4).

layernorm

Apply the layer normalisation of line 1. FALSE exposes the degenerate single-channel reduction to a Gram matrix.

Value

A list with the pair update z, the flattened outer product means o, estimate, n and method.

References

Jumper et al (2021) Nature 596:583-589, Suppl. Algorithm 10

Examples

set.seed(6)
m <- array(rnorm(2 * 3 * 4), c(2, 3, 4))   # 2 sequences, 3 residues, cm = 4
r <- Alfopm(m, wa = matrix(rnorm(8), 2, 4), wb = matrix(rnorm(8), 2, 4), wo = matrix(rnorm(12), 3, 4))
dim(r$z)
#> [1] 3 3 3