def zip_chains

bend-prot@0.1.0.0 · pdb.bend:396

import bend-prot@0.1.0.0/pdb.bend as Pdb
import Base
import bend-prot@0.1.0.0/protein.bend as P

396# Zip the parallel chain/residue lists back into pairs (aligned by
397# construction; extra elements on either side are dropped).
398def zip_chains(cs: List<&2, U32>, rs: List<&2, P.Residue>) -> List<&1, U32 & P.Residue>:
399  match cs rs:
400    case Nil{} Nil{}:
401      Nil{}
402    case Nil{} _ <> _:
403      Nil{}
404    case _ <> _ Nil{}:
405      Nil{}
406    case c <> ct r <> rt:
407      (c, r) <> zip_chains(ct, rt)

Uses (5)

Used by (1)