import "2bead.lt"

Peptide {

  # A polymer of alternating "H" and "P" beads:

  res1 = new 2bead/P
  res2 = new 2bead/P.rot(180.0, 1,0,0).move(3.2,0,0)
  res3 = new 2bead/H.rot(  0.0, 1,0,0).move(6.4,0,0)
  res4 = new 2bead/H.rot(180.0, 1,0,0).move(9.6,0,0)
  res5 = new 2bead/H.rot(  0.0, 1,0,0).move(12.8,0,0)
  res6 = new 2bead/H.rot(180.0, 1,0,0).move(16.0,0,0)
  res7 = new 2bead/P.rot(  0.0, 1,0,0).move(19.2,0,0)
  res8 = new 2bead/P.rot(180.0, 1,0,0).move(22.4,0,0)
  res9 = new 2bead/P.rot(  0.0, 1,0,0).move(25.6,0,0)
  res10 = new 2bead/H.rot(180.0, 1,0,0).move(28.8,0,0)
  res11 = new 2bead/H.rot( 0.0, 1,0,0).move(32.0,0,0)
  res12 = new 2bead/H.rot(180.0, 1,0,0).move(35.2,0,0)
  res13 = new 2bead/P.rot(  0.0, 1,0,0).move(38.4,0,0)
  res14 = new 2bead/P.rot(180.0, 1,0,0).move(41.6,0,0)

  # Now, link the residues together this way:
  write("Data Bond List") {
    $bond:backbone1  $atom:res1/CA  $atom:res2/CA
    $bond:backbone2  $atom:res2/CA  $atom:res3/CA
    $bond:backbone3  $atom:res3/CA  $atom:res4/CA
    $bond:backbone4  $atom:res4/CA  $atom:res5/CA
    $bond:backbone5  $atom:res5/CA  $atom:res6/CA
    $bond:backbone6  $atom:res6/CA  $atom:res7/CA
    $bond:backbone7  $atom:res7/CA  $atom:res8/CA
    $bond:backbone8  $atom:res8/CA  $atom:res9/CA
    $bond:backbone9  $atom:res9/CA  $atom:res10/CA
    $bond:backbone10  $atom:res10/CA  $atom:res11/CA
    $bond:backbone11  $atom:res11/CA  $atom:res12/CA
    $bond:backbone12  $atom:res12/CA  $atom:res13/CA
    $bond:backbone13  $atom:res13/CA  $atom:res14/CA
  }

  create_var { $mol }    # <--create a molecule ID number for this peptide

  # This causes res1,res2,res3,...,res14 to share the same molecule counter
  # because in the 2bead.lt file, the "..." in "$mol:..." preferentially looks
  # for a counter of that type in a parent molecule or earlier ancestor.

} # Peptide



# Angle, dihedral and improper interactions will be generated
# according to the instructions in "2bead_force_field.lt"
