code for our manuscript in eLife 2022