remarks  file  generate/generateco.inp 
 remarks  Sample: generate protein structure with a cofactor.  Equilibrium 
 remarks  (target) parameters for the co-factor are learned from Cartesian 
 remarks  coordinates. Protein parameters are obtained from the standard
 remarks  "parhcsdx.pro" parameter set. 

 topology  
    @TOPPAR:tophcsdx.pro

    autogenerate angles=true end
    
                            {* Define default mass for P. The other masses *}
                            {* are already defined in file "tophcsdx.pro". *}
    MASS  P    30.97400                 

    RESIdue PMP                           {* Pyridoxamine phosphate; the   *}
                                          {* name PMP has to match what is *}
                                          {* used in the coordinate file.  *}
     GROUP

                       {* All PMP charges are set to 0 which is appropriate *}
                       {* for refinement purposes.  The PMP atom types are  *}
                       {* used for assigning the default mass for each      *}
                       {* atom.  The PMP atom types are unimportant for     *}
                       {* the parameterization since the parameters are     *}
                       {* learned from the PMP coordinates.                 *}

       ATOM P    TYPE=P       CHARge=0.    END
       ATOM OP1  TYPE=O       CHARge=0.    END
       ATOM OP2  TYPE=O       CHARge=0.    END
       ATOM OP3  TYPE=O       CHARge=0.    END
       ATOM OP4  TYPE=O       CHARge=0.    END
     GROUP
       ATOM C5A  TYPE=CH2E    CHARge=0.    END
       ATOM C5   TYPE=C       CHARge=0.    END
     GROUP
       ATOM N1   TYPE=NH2     CHARge=0.    END  
       ATOM C6   TYPE=CH1E    CHARge=0.    END 
     GROUP
       ATOM C2   TYPE=C       CHARge=0.    END
       ATOM C2A  TYPE=CH3E    CHARge=0.    END
     GROUP
       ATOM C3   TYPE=C       CHARge=0.    END
       ATOM O3   TYPE=O       CHARge=0.    END
       ATOM H3   TYPE=H       CHARge=0.    END
     GROUP
       ATOM C4   TYPE=C       CHARge=0.    END
       ATOM C4A  TYPE=CH2E    CHARge=0.    END   
     GROUP
       ATOM N4   TYPE=MMM     CHARge=0.    END 
       ATOM H41  TYPE=H       CHARge=0.    END
       ATOM H42  TYPE=H       CHARge=0.    END

     BOND P OP1     BOND P OP2      BOND P OP3      BOND P OP4
     BOND OP4 C5A   BOND C5A C5     BOND N1 C2      BOND N1 C6    BOND C2 C2A
     BOND C2 C3     BOND C3  O3     BOND O3 H3 
     BOND C3 C4     BOND C4 C4A     BOND C4A N4     BOND N4 H41   BOND N4 H42
     BOND C4 C5     BOND C5 C6      

                       {* Impropers are specified to define groups of      *}
                       {* atoms with rigid planar or tetrahedral geometry. *}
     IMPRoper N1 C2 C3 C4      
     IMPRoper C2 C3 C4 C5    
     IMPRoper C3 C4 C5 C6  
     IMPRoper C4 C5 C6 N1     
     IMPRoper C5 C6 N1 C2    
     IMPRoper C6 N1 C2 C3
     IMPRoper O3 C2 C4 C3      
     IMPRoper C2A N1 C3 C2   
     IMPRoper C5A C4 C6 C5
     IMPRoper C4A C3 C5 C4     
     IMPRoper H42 C4A H41 N4                
 
     end
 end 

                                                        {*Generate protein.*}
 segment 
   name="    "                              
   chain                                    
     @TOPPAR:toph19.pep 
     coordinates @../generate/maat.pdb 
   end
 end
                                                           {*Rename atoms. *}
 vector do (name="O") ( name OT1 )               
 vector do (name="OT") ( name OT2 )
 vector do (name="CD1") ( name CD and resname ile )

 coordinates @../generate/maat.pdb 

                                                            {*Generate PMP.*}
 segment 
   name="    "                              
   chain                                    
     coordinates @../generate/maat.pmp 
   end
 end
 coordinates @../generate/maat.pmp 

 parameter                                     
   @TOPPAR:parhcsdx.pro 

               {* Learn parameters for PMP from the cartesian coordinates. *}
               {* Parameters involving hydrogens have to be set explicitly *}
               {* since the cartesian coordinates are unavailabe in this   *}
               {* case.                                                    *}

         {* Learn equilibrium parameters from known cartesian coordinates. *}
   learn initiate sele=(resname PMP and known ) mode=nostatistics end
   learn accumulate end
   learn terminate end

                     {* Set energy constants. We are using generic values. *}
   BOND (resname PMP  ) (resname PMP ) 500. TOKEN
   ANGLE (resname PMP ) (resname PMP ) 
                        (resname PMP ) 500. TOKEN
   IMPR (resname PMP )  (resname PMP )  
        (resname PMP )  (resname PMP ) 500. TOKEN TOKEN

                           {* Set nonbonded parameters (epsilon and sigma) *}
                           {* for the Lennard-Jones potential.             *} 
   NONBonded ( name C* and resname PMP ) 0.1  3.5     0.1  3.5
   NONBonded ( name H* and resname PMP ) 0.05 1.4     0.05 1.4
   NONBonded ( name O* and resname PMP ) 0.1  3.4     0.1  3.4
   NONBonded ( name N* and resname PMP ) 0.1  3.4     0.1  3.4
   NONBonded ( name P* and resname PMP ) 0.58 3.38    0.58 3.38

        {* Set equilibrium parameters for hydrogens bonded to heavy atoms. *}
        {* These parameters are needed for the hydrogen building procedure.*}
        {* Once the hydrogens have been built, the following statement are *}
        {* not required in subsequent jobs.                                *}

   BOND (name H* and resn PMP )  (resn PMP  ) 500. 1.
   ANGLE (name H4* and resn PMP  )  (resn PMP  ) (resn PMP ) 500. 120. 
   ANGLE (name H3  and resn PMP  )  (resn PMP  ) (resn PMP ) 500. 110. 

 end
   
 flags exclude vdw elec impr end     {* Do quick hydrogen building without *}
                                     {* nonbonded interactions.   Impropers*}
                                     {* are excluded as well to avoid      *}
                                     {* problems with unknown parameters.  *}

 hbuild                                   {* This statement builds missing *}
    selection=( hydrogen )                {* hydrogens.                    *}
    phistep=45                            {* for the force field.          *}
 end

 constraints fix=( not hydrogen ) end      {* Minimize hydrogen positions. *}
 flags include vdw elec end
 minimize powell 
    nstep=40 
 end
 constraints fix=( not all ) end 

 write coordinates output=generateco.pdb end
 
 write structure output=generateco.psf end 

 stop

{* ----------------------------------------------------------------------- *}
{* In all subsequent jobs one has to re-create the PMP parameters          *}
{* using the generated coordinates as a reference.  All jobs must          *}
{* begin with the following statements:                                    *}

 {===>} structure @generateco.psf end              {* Read structure file. *}

 {===>} coor @generateco.pdb   {* Read reference coordinates for learning. *}
                                             

 parameter                                     
   @TOPPAR:parhcsdx.pro 

               {* Learn parameters for PMP from the cartesian coordinates. *}

         {* Learn equilibrium parameters from known cartesian coordinates. *}
   learn initiate sele=(resname PMP and known ) mode=nostatistics end
   learn accumulate end
   learn terminate end

                     {* Set energy constants. We are using generic values. *}
   BOND (resname PMP  ) (resname PMP ) 500. TOKEN
   ANGLE (resname PMP ) (resname PMP ) 
                        (resname PMP ) 500. TOKEN
   IMPR (resname PMP )  (resname PMP )  
        (resname PMP )  (resname PMP ) 500. TOKEN TOKEN

                           {* Set nonbonded parameters (epsilon and sigma) *}
                           {* for the Lennard-Jones potential.             *} 
   NONBonded ( name C* and resname PMP ) 0.1  3.5     0.1  3.5
   NONBonded ( name H* and resname PMP ) 0.05 1.4     0.05 1.4
   NONBonded ( name O* and resname PMP ) 0.1  3.4     0.1  3.4
   NONBonded ( name N* and resname PMP ) 0.1  3.4     0.1  3.4
   NONBonded ( name P* and resname PMP ) 0.58 3.38    0.58 3.38

 end   

 {===>} coor @generateco.pdb                   {* Read current coordinates.*}

           {* Now the parameters are well-defined and one can proceed with *}
           {* any X-PLOR task.                                             *}