### THIS FILE IS OPTIONAL AND IS NOT NECESSARY.  IN THIS FILE, I DEFINED SOME ##
### ADDITIONAL PROTEIN TYPES FROM THE PAPER THAT I DID NOT USE IN THIS EXAMPLE##
#
# This file defines a family of coarse-grained protein models used in:
#      G. Bellesia, AI Jewett, and J-E Shea, 
#      Protein Science, Vol19 141-154 (2010)
#
# Strategy:
#
#1) First I'll define some building blocks (A16, B16, T3)
#   which are helices, sheets and turns of a predetermined length)

import "1beadProtSci2010.lt"

#   We defined A16 and T3 earlier in "1beadPRotSci2010.lt" Will define B16 below
#
#2)  Then I'll copy and paste them together to build
#    a 4-helix bundle or a 4-strand beta-barrel.


1beadProtSci2010 {  #<-- Add new molecules to existing namespace defined earlier
                    #  This way we don't have to start from scratch.  We can
                    #  use all the atom types and angle settings defined earlier

  # B16 is a coarse-grained beta-strand containing 16 residues (one "atom" each)

  B16 {

    #  AtomID   MoleculeID AtomType  Charge      X         Y         Z

    write('Data Atoms') {
      $atom:a1  $mol:... @atom:../sL  0.0      -1.8       0.0       0.0
      $atom:a2  $mol:... @atom:../sH  0.0       1.8       0.0       4.8
      $atom:a3  $mol:... @atom:../sL  0.0      -1.8       0.0       9.6
      $atom:a4  $mol:... @atom:../sH  0.0       1.8       0.0       14.4
      $atom:a5  $mol:... @atom:../sL  0.0      -1.8       0.0       19.2
      $atom:a6  $mol:... @atom:../sH  0.0       1.8       0.0       24.0
      $atom:a7  $mol:... @atom:../sL  0.0      -1.8       0.0       28.8
      $atom:a8  $mol:... @atom:../sH  0.0       1.8       0.0       33.6
      $atom:a9  $mol:... @atom:../sL  0.0      -1.8       0.0       38.4
      $atom:a10 $mol:... @atom:../sH  0.0       1.8       0.0       43.2
      $atom:a11 $mol:... @atom:../sL  0.0      -1.8       0.0       48.0
      $atom:a12 $mol:... @atom:../sH  0.0       1.8       0.0       52.8
      $atom:a13 $mol:... @atom:../sL  0.0      -1.8       0.0       57.6
      $atom:a14 $mol:... @atom:../sH  0.0       1.8       0.0       62.4
      $atom:a15 $mol:... @atom:../sL  0.0      -1.8       0.0       67.2
      $atom:a16 $mol:... @atom:../sH  0.0       1.8       0.0       72.0
    }

    write('Data Bonds') {
      $bond:b1 @bond:../backbone $atom:a1 $atom:a2
      $bond:b2 @bond:../backbone $atom:a2 $atom:a3
      $bond:b3 @bond:../backbone $atom:a3 $atom:a4
      $bond:b4 @bond:../backbone $atom:a4 $atom:a5
      $bond:b5 @bond:../backbone $atom:a5 $atom:a6
      $bond:b6 @bond:../backbone $atom:a6 $atom:a7
      $bond:b7 @bond:../backbone $atom:a7 $atom:a8
      $bond:b8 @bond:../backbone $atom:a8 $atom:a9
      $bond:b9 @bond:../backbone $atom:a9 $atom:a10
      $bond:b10 @bond:../backbone $atom:a10 $atom:a11
      $bond:b11 @bond:../backbone $atom:a11 $atom:a12
      $bond:b12 @bond:../backbone $atom:a12 $atom:a13
      $bond:b13 @bond:../backbone $atom:a13 $atom:a14
      $bond:b14 @bond:../backbone $atom:a14 $atom:a15
      $bond:b15 @bond:../backbone $atom:a15 $atom:a16
    }

  } # B16

  # ----- Now build larger molecules using B16 and T3 -------


  4SheetBarrel {
    sheet1 = new B16.rot(  45, 0,0,1).move(-4.762203156,-4.762203156, -36.0)
    sheet2 = new B16.rot( 135, 0,0,1).move( 4.762203156,-4.762203156, -36.0)
    sheet3 = new B16.rot( 225, 0,0,1).move( 4.762203156, 4.762203156, -36.0)
    sheet4 = new B16.rot( 315, 0,0,1).move(-4.762203156, 4.762203156, -36.0)

    turn1  = new T3.rot(180,1,0,0).rot( 0, 0,0,1).move( 0, -7.8, 39.6)
    turn2  = new T3.rot(  0,1,0,0).rot(-90,0,0,1).move(4.2, 0.0,-41.4)
    turn3  = new T3.rot(180,1,0,0).rot(-180,0,0,1).move( 0, 7.8, 39.6)

    write('Data Bonds') {
      $bond:turn1a  @bond:../backbone  $atom:turn1/a1    $atom:sheet1/a16
      $bond:turn1b  @bond:../backbone  $atom:turn1/a3    $atom:sheet2/a16
      $bond:turn2a  @bond:../backbone  $atom:turn2/a1    $atom:sheet3/a1
      $bond:turn2b  @bond:../backbone  $atom:turn2/a3    $atom:sheet2/a1
      $bond:turn3a  @bond:../backbone  $atom:turn3/a1    $atom:sheet3/a16
      $bond:turn3b  @bond:../backbone  $atom:turn3/a3    $atom:sheet4/a16
    }
    create_var { $mol } # molecule ID number shared by all atoms in this protein
  }


  # Below I define several alternate conformations of the"4HelixBundleInsideOut"
  # molecule I defined earlier in "1beadProtSci2010.lt".  Same molecule however.

  4HelixBundle {
    helix1 = new A16.rot( -45, 0,0,1).move(-5.70,-5.70,-32.4)
    helix2 = new A16.rot(  45, 0,0,1).move( 5.70,-5.70,-28.8)
    helix3 = new A16.rot( 135, 0,0,1).move( 5.70, 5.70,-25.2)
    helix4 = new A16.rot( 225, 0,0,1).move(-5.70, 5.70,-21.6)

    write('Data Bonds') {
      $bond:turn1a  @bond:../backbone  $atom:turn1/a1    $atom:helix1/a16
      $bond:turn1b  @bond:../backbone  $atom:turn1/a3    $atom:helix2/a16
      $bond:turn2a  @bond:../backbone  $atom:turn2/a1    $atom:helix3/a1
      $bond:turn2b  @bond:../backbone  $atom:turn2/a3    $atom:helix2/a1
      $bond:turn3a  @bond:../backbone  $atom:turn3/a1    $atom:helix3/a16
      $bond:turn3b  @bond:../backbone  $atom:turn3/a3    $atom:helix4/a16
    }

    turn1  = new T3.rot(150,1,0,0).rot(-23,0,1,0).rot(  8,0,0,1).move(-3.6,-4.8,28.2)
    turn2  = new T3.rot(-5,1,0,0).rot( 21,0,1,0).rot(-100,0,0,1).move(4.2,-0.66,-30.9)
    turn3  = new T3.rot(150,1,0,0).rot(-23,0,1,0).rot(188,0,0,1).move(3.6,4.8,35.4)

    create_var { $mol } # molecule ID number shared by all atoms in this protein

  } # 4HelixBundle




  #  ---  alternate conformations (same molecule) ----

  # In the following version, the helices are oriented in a similar way, 
  # but they are separated a little further away from eachother.

  4HelixBundleLoose {

    helix1 = new A16.rot( -45, 0,0,1).move(-6.7347723,-6.7347723, -27.0)
    helix2 = new A16.rot(  45, 0,0,1).move( 6.7347723,-6.7347723, -27.0)
    helix3 = new A16.rot( 135, 0,0,1).move( 6.7347723, 6.7347723, -27.0)
    helix4 = new A16.rot( 225, 0,0,1).move(-6.7347723, 6.7347723, -27.0)

    turn1  = new T3.rot(180,1,0,0).rot(-17,0,0,1).move(-1.2,-4.2,32.4)
    turn2  = new T3.rot(  0,1,0,0).rot(-100,0,0,1).move(4.2,-0.9,-28.8)
    turn3  = new T3.rot(180,1,0,0).rot(163,0,0,1).move(1.2,4.2,32.4)

    write('Data Bonds') {
      $bond:turn1a  @bond:../backbone  $atom:turn1/a1    $atom:helix1/a16
      $bond:turn1b  @bond:../backbone  $atom:turn1/a3    $atom:helix2/a16
      $bond:turn2a  @bond:../backbone  $atom:turn2/a1    $atom:helix3/a1
      $bond:turn2b  @bond:../backbone  $atom:turn2/a3    $atom:helix2/a1
      $bond:turn3a  @bond:../backbone  $atom:turn3/a1    $atom:helix3/a16
      $bond:turn3b  @bond:../backbone  $atom:turn3/a3    $atom:helix4/a16
    }
    create_var { $mol } # molecule ID number shared by all atoms in this protein
  }


  # In following version, the helices are oriented in a similar way, 
  # but they are separated a little further away from eachother.

  4HelixInsideOutLoose {
    helix1 = new A16.rot(-225, 0,0,1).move(-6.7347723,-6.7347723, -27.0)
    helix2 = new A16.rot(-135, 0,0,1).move( 6.7347723,-6.7347723, -27.0)
    helix3 = new A16.rot( -45, 0,0,1).move( 6.7347723, 6.7347723, -27.0)
    helix4 = new A16.rot(  45, 0,0,1).move(-6.7347723, 6.7347723, -27.0)

    turn1  = new T3.rot(180,1,0,0).rot( 10,0,0,1).move( 0.78,-4.2,28.8)
    turn2  = new T3.rot( 70,1,0,0).rot(-70,0,0,1).move( 10.8,2.4,-28.2)
    turn3  = new T3.rot(180,1,0,0).rot(190,0,0,1).move(-0.78,4.2,28.8)

    write('Data Bonds') {
      $bond:turn1a  @bond:../backbone   $atom:turn1/a1   $atom:helix1/a16
      $bond:turn1b  @bond:../backbone   $atom:turn1/a3   $atom:helix2/a16
      $bond:turn2a  @bond:../backbone   $atom:turn2/a1   $atom:helix3/a1
      $bond:turn2b  @bond:../backbone   $atom:turn2/a3   $atom:helix2/a1
      $bond:turn3a  @bond:../backbone   $atom:turn3/a1   $atom:helix3/a16
      $bond:turn3b  @bond:../backbone   $atom:turn3/a3   $atom:helix4/a16
    }
    create_var { $mol } # molecule ID number shared by all atoms in this protein

  } # 4HelixInsideOutLoose




  # In the following version, the 4 helices are arranged next to each other,
  # side-by-side, in a planar conformation (instead of a compact bundle).

  4HelixPlanar {
    helix1 = new A16.rot(-00, 0,0,1).move(0,    0, -27.0)
    helix2 = new A16.rot( 00, 0,0,1).move(14.4, 0, -27.0)
    helix3 = new A16.rot(-00, 0,0,1).move(28.8, 0, -27.0)
    helix4 = new A16.rot( 00, 0,0,1).move(43.2, 0, -27.0)

    turn1  = new T3.rot(180,1,0,0).rot(  0,0,0,1).move( 4.8, 0, 31.8)
    turn2  = new T3.rot(  0,1,0,0).rot(180,0,0,1).move(19.2, 0,-31.8)
    turn3  = new T3.rot(180,1,0,0).rot(  0,0,0,1).move(34.6, 0, 31.8)

    write('Data Bonds') {
      $bond:turn1a  @bond:../backbone   $atom:turn1/a1   $atom:helix1/a16
      $bond:turn1b  @bond:../backbone   $atom:turn1/a3   $atom:helix2/a16
      $bond:turn2a  @bond:../backbone   $atom:turn2/a1   $atom:helix3/a1
      $bond:turn2b  @bond:../backbone   $atom:turn2/a3   $atom:helix2/a1
      $bond:turn3a  @bond:../backbone   $atom:turn3/a1   $atom:helix3/a16
      $bond:turn3b  @bond:../backbone   $atom:turn3/a3   $atom:helix4/a16
    }
    create_var { $mol } # molecule ID number shared by all atoms in this protein

  } # 4HelixPlanar


  # -------- Minor coordinates adjustment: -----------
  # Those coordinates in the commands above are a little too large.
  # To make it easier to type them in, I was using sigma=6.0 Angstroms.
  # Instead, here I'll try using sigma=5.5 Angstroms.   5.5/6 = 0.916667)

  4SheetBarrel.scale(0.9166666666666666)
  4HelixBundle.scale(0.9166666666666666)
  4HelixBundleLoose.scale(0.9166666666666666)
  4HelixInsideOutLoose.scale(0.9166666666666666)
  4HelixPlanar.scale(0.9166666666666666)

  # Note: "scale()" only effects the initial coordinates of
  #       the molecule, not the force field parameters.
  #       (If you plan to minimize the molecule, you don't need to 
  #        be so careful about the initial coordinates.  In that case,
  #        you don't have worry about "scale()".  Feel free to remove.)


} # 1beadProtSci2010 (namespace)

