ComQumX-2QM
ComQumX-2QM is an extension of ComQum-X to two QM systems, i.e. with disorder in the QM system.
ComQum-X or quantum refinement is a method to combine X-ray crystallographic refinement with QM/MM calculations to obtain an optimum compromise between crystallography and quantum chemistry.
It requires the structure factors from a crystallographic investigation.

The proper reference of ComQum-X is:
U. Ryde, L. Olsen & K. Nilsson (2002) "Quantum chemical geometry optimisations in proteins using crystallographic raw data", J. Comp. Chem., 23, 1058-1070.
ComQumX-2QM will be described in
L. Cao & U. Ryde, "Quantum refinement with multiple conformations in the QM system"; applications to the P-cluster in nitrogenase", Acta Cryst. D, submitted.
and the first application is described in:
L. Cao, O. Caldararu & U. Ryde (2020) "Does the crystal structure of vanadium nitrogenase contain a reaction intermediate? Evidence from quantum refinement" J. Biol. Inorg. Chem., in press; DOI 10.1007/s00775-020-01813-z.

We have implemented an run also a ComQumX-4QM variant (comqumx74-4qm).
Follow the instructions below, but repeat 4 times for the QM system instead of 2.

How to run a ComQumX-2QM job
In this version, we consider QM as a complement to MM in the X-ray investigation.
Thus, we do not include electrostatics and have no hydrogen atoms.
  1. Start with a refined crystal structure, including structure factors. The structure factors can be found from the summary entry in the 3DBrowser (i.e. look first up the pdb file).

  2. cp /temp4/bio/Data/Comqumx_lib/* .

  3. Edit the file sedfile by inserting (the values should appear between the second and last /; e.g. s/cqx_crystal_a/43.1/) the data in the following points:
    1. Space group (http://stock.cabm.rutgers.edu/xtal/NOTES/sg_table.html gives a proper translation table; note that the last number in the CRYST1 record is the number of the space group)
    2. Crystal data (a, b, c, alpha, beta, gamma)
    3. File names: coordinates, parameter, topology (do not include the CNS files), and reflections.
    4. Percentage in the test set (if not already set)
    5. Low and high resolution limits
    6. Residues in the quantum system
     
  4. Find out from the pdb file the following data

  5. 1. Unit cell and symmetry
    CRYST1   49.970   58.680   98.050  90.00  90.00  90.00 P 21 21 21    4
    (this pdb row show a, b, c, alpha, beta, gamma, and the symmetry)

    2. Resolution range
    REMARK   3  DATA USED IN REFINEMENT.
    REMARK   3   RESOLUTION RANGE HIGH (ANGSTROMS) : 1.90
    REMARK   3   RESOLUTION RANGE LOW  (ANGSTROMS) : 20.00

    3. Sigma-cutoff value
    REMARK   3   DATA CUTOFF            (SIGMA(F)) : 0.000

    4. R-factor
    REMARK   3   R VALUE            (WORKING SET) : 0.181
    REMARK   3   FREE R VALUE                     : 0.231

    5. Test set size
    REMARK   3   FREE R VALUE TEST SET SIZE   (%) : 4.900
    REMARK   3   FREE R VALUE TEST SET COUNT      : 1042

    6. Parameter and topology files (at least if CNS was used for refinement)
    REMARK   3  PARAMETER FILE  1  : PROTEIN_REP.PA
    REMARK   3  PARAMETER FILE  2  : WATER_REP.PARA
    REMARK   3  TOPOLOGY FILE  1   : PROTEIN.TOP
    REMARK   3  TOPOLOGY FILE  2   : WATER.TOP

    7. Alternative configurations
    REMARK   3  OTHER REFINEMENT REMARKS: ALTERNATE CONFORMATIONS FOR
    REMARK   3  RESIDUES 33, 120, 121 AND 122    

  6. Insert END at the end of all files.

  7. It is wise to copy the subunit column to the segid column (pos 73-76; if not used).
    changepdb, command seg followed by return and w does this for you.
    HETATMiiiiixaaaaarrrxaiiiiaxxxffffffffggggggggffffffffggggggffffffxxxxxxsegiel-1
    ****|****1****|****2****|****3****|****4****|****5****|****6****|****7****|****8
  8.  
  9. If necessary, construct topology and parameter files for unusual ligands, etc.
    They can be obtained either by describe (Hess2FF; from QM calculations) or from the HIC-UP web server.
    Collect all top and par files in the files all.top and all.par.
  10.  
  11. Change the name of ions to the proper CNS names (e.g. residue=ZN2, atom=ZN+2; it is recommend also to change the charge in the last 2 columns (79 and 80) of the pdb file).
    Note that if there are four letters name in the pdb file, they must start so that there is a blank before the residue. Use changepdb to change the format to -6.
    Moreover, cns does not read the subunit key, so you may need to renumber the residues by changepdb, command rr.
    Note that changepdb removes TER from the file. These may have to be added manually; otherwise you can get PATCH-ERR when you run generate.

  12. Run cqx_sedscript
    This will construct the proper cns files:
    bindividual.inp  bindividual1.inp  generate.inp  make_cv.inp  mmrun2  mmrun3
    1.  
  13. Run generate for system 3:

    cns <generate.inp >generate.out

    grep ERR     generate.out
    grep WRN     generate.out
    grep INFO    generate.out
    grep error   generate.out
    grep warning generate.out

    These warnings and info are acceptable:

      %READC-WRN: still   1361 missing coordinates (in selected subset)
     CNSsolve>           display  %INFO: There are no coordinates missing for non-hydrogen atoms

    This gives the file mm3.pdb, which should be used as the pdb file in the following.
    Check the start (REMARK section) of this file for added Cys-Cys links and missing atoms.

    If you want to avoid added atoms (you almost always want that), set (this is now default):
    {===>} atom_delete=(not known);


    If you want to add or delete bonds, you need to include patches:
     {* any special protein patches can be applied here *}
    {===>}
    topology
       @fs2.patch
    end

    patch FS2P
       reference=1=(resid 632) reference=2=(resid 188) reference=3=(resid 260) reference=4=(resid  97) reference=5=(resid 128)
    end

    Remark Patch to build the Fe-Cys bonds for a Fe2S2 cluster
    presidue FS2P

      add bond 1FE1 2SG
      add bond 1FE1 3NH1
      add bond 1FE2 4SG
      add bond 1FE2 5SG
      add angle 2SG  1FE1  1S1
      add angle 2SG  1FE1  1S2
      add angle 3NH1 1FE1  1S1
      add angle 3NH1 1FE1  1S2
      add angle 4SG  1FE2  1S1
      add angle 4SG  1FE2  1S2
      add angle 5SG  1FE2  1S1
      add angle 5SG  1FE2  1S2
      add angle 2CB  2SG  1FE1
      add angle 3CZ  3NH1 1FE1
      add angle 4CB  4SG  1FE2
      add angle 5CB  5SG  1FE2
    end

  1. To include alternative configurations, insert the atoms involved in the atom_select keyword in the file alternate.inp, using the format "atom segid residue_number atom_name", e.g.  atom S 234 NE2 or atom L 33 CG (this list can be set up with changepdb, command occ).
    Also check that you have only two configurations of each residue.
    Then run
    cns <alternate.inp >alternate.out
    grep ERR     alternate.out
    grep WRN     alternate.out
    grep INFO    alternate.out
    grep error   alternate.out
    grep warning alternate.out

    Atoms with alternate configurations will get new segids AC1, AC2, but they will have identical coordinates (that of conformation B!). This can be corrected by running changepdb, command al on the file alternate.pdb. Write the file out as mm3.pdb

    Finally
    \mv alternate.mtf mm3.mtf

    The script alternate.inp does not work with metal ion with names like "Fe+2".
    We managed to solve the problem by changing the atom name to "Fe  " in alternate.inp, mm3.mtf (only 1st field = atom name) and mm3.pdb. Then you have to change them back to FE+2 (now in both AC1 and AC2) in alternate.mtf and alternate.pdb after running cns.
    This is now done automatically with changepdb command fe and changemtf command f:
    changepdb << EOF
    mm3.pdb
    fe
    y
    w
    mm3.pdb
    q

    EOF

    changemtf <<EOF
    mm3.mtf
    f
    y
    w
    mm3.mtf
    q

    EOF

    changepdb <<EOF
    alternate.pdb
    fe
    n
    al
    u7q.pdb
    w
    mm3.pdb

    q
    EOF

    changemtf <<EOF
    alternate.mtf
    f
    n
    w
    mm3.mtf
    q

    EOF


    If you start from two old ComQum-X calculations without disorder in the QM system then rerun generate.inp and then start from this point with alternative confs.

  2. cp mm3.pdb comqum.pdb
    Then change the name of the histidine residues in the quantum system to HID or HIE (to get the right protonation and to get correct junctions). Cysteinate metal ligands may remain called CYS.

  3. For both QM systems, in separate sub-directories: Protonate the quantum system in this file (comqum.pdb).
    Note that this needs to be done separately for the two QM systems, i.e. H atoms from one QM system must not be in the comqum.dat file for the other QM system.

  4. One way is to use tleap (see Amber equilibration page).
    Another way to do this is to run protonate on the protein:
    /temp4/bio/AMBER/Amber7/exe/protonate -k -d /temp4/bio/Data/Amber/PROTON_INFO.bio <comqum.pdb >ppdb
    This will protonate all amino acids. To protonate water molecules, use changepdb, command addwat and then command w(rite). This will give you crude proton coordinates, which you might want to improve. Alternatively, you can add them manually with Spartan. To automatically improve the proton coordinates, follow the procedure in the Amber equilibration setup , points 9-16.
    Note that you should add protons only to the quantum system and not to the whole protein. However, protonate works only for full amino acids. Therefore, it is easiest to protonate the whole protein first and then copy only exactly those hydrogen atoms you need into the pdb file.
    B factors and occupation numbers need to be defined. Therefore, set occupation numbers of the hydrogen atoms to 1.00 and the B factors to the same value as the mother heavy atom.
    Note that rasmol does not understand the Amber format of four-character hydrogen atoms. If you want to visualise the result, run changepdb command f(ormat), chose format 3, then write out a new file with command w(rite).

    If you have an old comqum.pdb file with the H atoms already added, this can be done automatically with changepdb command cph.
     
  5. Renumber the comqum.pdb file:
    changepdb <<EOF
    comqum.pdb
    ren

    w

    q
    EOF

  6. For both QM systems, in separate sub-directories, setup the syst1 file and run pdbtocomqum
    1. Select the name of the logfile (default is OK)
    2. Enter the name of the pdb file (comqum.pdb)
    3. Do not search for short contatcts
    4. Enter a new title (can be done in a file, see next point).
    5. Select the quantum system, including the junction atoms that will be changed to hydrogens (you first give the number of the amino acid, then the number of the atoms in this amino acid; one <CR> let you select a new amino acid; another <CR> ends the selection).
    6. This can preferably be done by entering the name of a file with the atom numbers (see below). This file should also contain the new title as the first line.
    7. 0 water molecules to include
    8. Select the radius for system 2 (MM system that is optimised). Typically the whole protein (1000 Å).
    9. There is no need to include or remove residues from this system.
    10. Select the radius for system 3 (MM system that is fixed). Typically 0 Å (the whole protein has already been included).
    11. Select a cns type of calculation, by entering c(ns).
    12. Select the basis set (i.e. the type of junction, typically 12).
    13. Enter the junction atoms (those that will become hydrogen atoms in the quantum system). They are normally read also from the syst1 file.
    14. Enter return.
      Check that the junctions  are not unknown.

    This gives the files:
    comqum.dat   comqum.mmout   comqum.qcout    logfil  

  7. If the quantum system is built up of symmetry related atoms, insert into the file comqum.dat the relevant tranformation in the format:

    $transformation
     26-40,41
     0.0d0  1.0d0  0.0d0  0.0d0
     0.0d0  0.0d0  1.0d0  0.0d0
     1.0d0  0.0d0  0.0d0  0.0d0
     0.0d0  0.0d0  1.0d0  0.0d0
     1.0d0  0.0d0  0.0d0  0.0d0
     0.0d0  1.0d0  0.0d0  0.0d0

    where the first line gives the atoms that should be transformed
    and the following three lines gives the relevant transformation (rotation matrix followed by translation vector).
    and the last three lines gives the relevant back-transformation

  8. For both QM systems, run comqumtoturbo to get the Turbomole files:

  9. control  coord
     
  10. For both QM systems, check the name of metal atoms in file coord and then run
    define
    1. construct an UFF hessian in the geometry menu
    2. define the basis sets
    3. get starting orbitals
    4. possibly change the DFT functional
    5. turn on the ri calculations
    6. turn on DFT-D3 dispersion (bj)

    If you have old calculations, just copy all the Turbomole files from that calculation.

  11.  
  12. For both QM systems, run comqumtocns to get the CNS files:

  13. Enter first x and then mm1.par and possibly more (e.g. all.par) as the name of the parameter file.

    comqumtocns <<EOF
    x
    mm1.par
    all.par



    EOF

    This gives the following files:
    fix.pdb    generate1.inp    mmrun1    pdb1    pdb3

    but only mmrun1 and fix.pdb are actually used.
    Check that there are no HIE, HID, or HIP in fix.pdb. 

    With alternate conformations, this does not work properly (mmrun3 and binidvidual1 complains about atoms not found in molecular structure). Run:
    changepdb <<EOF
    mm3.pdb
    cqf
    comqum.dat1
    comqum.dat2

    w
    fix.pdb
    q
    EOF

  14. For both QM systems, insert into the comqum.dat file the occupancy of this QM system:
    $occupancy
     0.8

  15. For only one QM system, convert the pdb structure factor file to CNS format using /temp4/bio/Cns/pdbtocnsrefl.f.

  16. You probably have to change the read reflections line in the source code (line ~158) to fit your reflection file. Check carefully that you get the right number of unique reflections.
    The program is compiled by typing make pdbtocnsrefl in the directory /temp4/bio/Cns/Linux.

    A better and more general tool is sf-convert:
    http://sw-tools.pdb.org/apps/SF_CONVERT (more info at the end of this file)
    or to do it by Phenix (https://www.phenix-online.org/documentation/reference/reflection_file_tools.html):
    phenix.relection_file_converter xxx.cif --cns=cns.cv (a numer of flags are normally needed)
    phenix.reflection_file_converter 6cdk-v.cif --label='_refln.F_meas_au,_refln.F_meas_sigma_au' --r-free-label='_refln.pdbx_r_free_flag' --r-free-test-flag-value=0 --cns .)

  1. For only one QM system: Construct a test set if not already available in the structure factor file (normally not needed).

    cns <make_cv.inp >make_cv.out
    grep ERR make_cv.out
    grep WAR make_cv.out
    grep INFO make_cv.out


  2. For only one QM system: Go into the file mmrun2 and mmrun3 and change "none" to "segid AC1" or AC2  (or perhaps something like LAC1 and LAC2) in the following (consecutive) lines (around line 195):

    {* select atoms in alternate conformation 1 *}
    {===>} conf_1=(segid AC1);

    {* select atoms in alternate conformation 2 *}
    {===>} conf_2=(segid AC2);

  3. For only one QM system: Copy the relevant parameter file of the protein.
    For time being, you need a special version :
    cp /temp4/bio/Data/Cns/protein_rep.param protein.param
    (or protein-allhdg5-4.param or dna-rna_rep.param)

  4. In the base directory: Run cqx2qmprep with the names of the two sub-directories with the two QM systems as options, e.g.
    cqx2qmprep Pn Pox

    Look in the files mmrun1.out and mmrun2.out for violations.

    The following warnings or informations are OK (but not any ERR):
     DEFINE>{* files must contain unique array names otherwise errors will occur *}
     %READC-WRN: multiple coordinates for   5948 atoms
      CNSsolve>     display REMARK warning: B-correction gave atomic B-values less than zero

    Check that fixcoord1 worked properly:
    ********** Fix Coord 1 ended normally **********

    If you have special parameter files, not called all.par, they have to be included in mmrun1.

  5. You should always run with a fixed value of the wa factor (even if you want the default one). This is done in the file mmrun2 (search for wa=). Run fixenergy_cnsin to get the default value of wa (take the first in the output of this program - there are two).

  6. You can add restraints on a distance between two atoms using (note the unusual units):
    $restraints
      atom1(1)  atom2(1)  desired_distance_in_A   force_constant_in_au
    $restraints
    1 3  1.00 1.0

    A typical force constant is 1 a.u. (which typically gives less than 0.01 Å deviation at convergence)

  7. Start comqumx-2qm:
    comqumx-2qm -ri -backup -c 200
    .

    The results are in files energy and cns.dat.
    The final coordinates are in bindividual1.pdb and in coord1 and coord2
    You can build pdb files for the latter two by cqx2topdb (the results are in pdb1 and pdb2).

  8. You do not have to calculate strain energies; these can be directly read from the energy file, entry three.

This is cqx2qmprep :

# ComQumX-2QM Prep
# Ulf Ryde, 9/9-19
#
# The scipt takes two options, viz. the name of the two subdirectories

# Check that two directories are given as argument
if [ -z "$2" ]; then
   echo "You must give the two subdirectories as arguments of cqx2qmprep"
   exit
else
   echo "The two subdirectories are $1 and $2"
fi

echo
echo "Construct mm1.mtf
, mm1.par and mm1.pdb for the first QM system in $1"
echo from mm3.mtf, mm3.pdb, and protein_rep.param
cd $1

changemtf <<EOF
mm3.mtf
t
y
mm1.mtf
protein.param
mm1.par
y
mm3.pdb
mm1.pdb
q
EOF

echo
echo Construct dummy mm1.pdb1 file for 8-decimal precision

changepdb <<EOF
mm1.pdb
f
1
3
0
dum

q
EOF

echo
echo Construct dummy mm3.pdb1 file for 8-decimal precision
changepdb <<EOF
mm3.pdb
f
1
3
0
dum

q
EOF

echo
echo Test mmrun 1

cns <mmrun1   >mmrun1.out
grep ERR       mmrun1.out
grep WRN       mmrun1.out
grep INFO      mmrun1.out
grep violation mmrun1.out
#page mmrun1.out

echo
echo Test fixcoord1

fixcoord1_cnsin
fixcoord1_turboin
fixcoord1
fixcoord1_cnsout

echo
echo
Copy files to main directory
\cp alpha         ../alpha1    
\cp auxbasis      ../auxbasis1    
\cp basis         ../basis1    
\cp beta          ../beta1    
\cp comqum.dat    ../comqum.dat1    
\cp control       ../control1    
\cp coord         ../coord1    
\cp forceapprox   ../forceapprox1    
\cp gradient      ../gradient1    
\cp mos           ../mos1    
\cp uffhessian0-0 ../uffhessian0-01

\cp all.par          ..
\cp all.top          ..
\cp bindividual.inp  ..
\cp bindividual1.inp ..
\cp fix.pdb          ..
\cp mmrun1
           ..
\cp mmrun2           ..
\cp mmrun3           ..
\cp mm1.mtf          ../mm11.mtf

\cp mm1.par          ../mm11.par
\cp mm1.pdb          ../mm11.pdb

\cp mm1.pdb1         ../mm11.pdb1

\cp mm3.mtf          ..

\cp mm3.pdb          ..

\cp mm3.pdb1         ..
\cp *.cv             ..

######################################################
echo
"################################################"
echo "Construct mm1.mtf
, mm1.par and mm1.pdb for the second QM system in $2"
echo from mm3.mtf, mm3.pdb, and protein_rep.param
cd ../$2

changemtf <<EOF
../mm3.mtf
t
y
mm1.mtf
../$1/protein.param
mm1.par
y
../mm3.pdb
mm1.pdb
q
EOF

echo
echo Construct dummy mm1.pdb1 file for 8-decimal precision

changepdb <<EOF
mm1.pdb
f
1
3
0
dum

q
EOF

echo
echo Test mmrun 1

cns <mmrun1   >mmrun1.out

grep ERR       mmrun1.out

grep WRN       mmrun1.out

grep INFO      mmrun1.out

grep violation mmrun1.out


echo

echo Test fixcoord1

fixcoord1_cnsin

fixcoord1_turboin

fixcoord1

fixcoord1_cnsout

echo
echo
Copy files to main directory
\cp alpha         ../alpha2    
\cp auxbasis      ../auxbasis2    
\cp basis         ../basis2    
\cp beta          ../beta2    
\cp comqum.dat    ../comqum.dat2    
\cp control       ../control2    
\cp coord         ../coord2    
\cp forceapprox   ../forceapprox2    
\cp gradient      ../gradient2    
\cp mos           ../mos2    
\cp uffhessian0-0 ../uffhessian0-02

\cp mm1.mtf          ../mm12.mtf
\cp mm1.par          ../mm12.par
\cp mm1.pdb          ../mm12.pdb

\cp mm1.pdb1         ../mm12.pdb1


######################################################
echo
"################################################"
echo Correct the file fix.pdb
cd ..
changepdb <<EOF
mm3.pdb
cqf
comqum.dat1
comqum.dat2

w
fix.pdb
q
EOF

echo
echo Change file references in file control1
sed -i "s/file=auxbasis/file=auxbasis1/" control1
sed -i "s/file=basis/file=basis1/" control1
sed -i "s/file=coord/file=coord1/" control1
sed -i "s/file=alpha/file=alpha1/" control1
sed -i "s/file=beta/file=beta1/" control1
sed -i "s/file=mos/file=mos1/" control1
sed -i "s/file=energy/file=energy1/" control1
sed -i "s/file=gradient/file=gradient1/" control1
sed -i "s/file=forceapprox/file=forceapprox1/" control1
sed -i "s/file=twoint/file=twoint1/" control1
sed -i "s/file=uffhessian0-0/file=uffhessian0-01/" control1
sed -i "s/file=ufftopology/file=ufftopology1/" control1
grep file control1

echo
echo Change file references in file control2
sed -i "s/file=auxbasis/file=auxbasis2/" control2
sed -i "s/file=basis/file=basis2/" control2
sed -i "s/file=coord/file=coord2/" control2
sed -i "s/file=alpha/file=alpha2/" control2
sed -i "s/file=beta/file=beta2/" control2
sed -i "s/file=mos/file=mos2/" control2
sed -i "s/file=energy/file=energy2/" control2
sed -i "s/file=gradient/file=gradient2/" control2
sed -i "s/file=forceapprox/file=forceapprox2/" control2
sed -i "s/file=twoint/file=twoint2/" control2
sed -i "s/file=uffhessian0-0/file=uffhessian0-02/" control2
sed -i "s/file=ufftopology/file=ufftopology2/" control2
grep file control2

echo
echo Test mmrun 2

cns <mmrun2   >mmrun2.out
grep ERR       mmrun2.out
grep WRN       mmrun2.out
grep INFO      mmrun2.out
grep error     mmrun2.out
grep warning   mmrun2.out
grep '>>'      mmrun2.out
grep violation mmrun2.out

echo
echo Test mmrun 3

cns <mmrun3   >mmrun3.out
grep ERR       mmrun3.out
grep WRN       mmrun3.out
grep INFO      mmrun3.out
grep error     mmrun3.out
grep warning   mmrun3.out
grep violation mmrun3.out
grep '>>'      mmrun3.out

echo
echo Test bindividual

cns <bindividual.inp >bindividual.out
grep ERR       bindividual.out
grep WRN       bindividual.out
grep INFO      bindividual.out
grep error     bindividual.out
grep warning   bindividual.out
grep violation bindividual.out
grep '>>'      bindividual.out

echo
echo Test bindividual1

cns <bindividual1.inp >bindividual1.out
grep ERR       bindividual1.out
grep WRN       bindividual1.out
grep INFO      bindividual1.out
grep error     bindividual1.out
grep warning   bindividual1.out
grep violation bindividual1.out
grep '>>'      bindividual1.out

echo
echo Make the files bindividual.pdb, bindividual.pdb1, and minimize3.pdb1

cp mm3.pdb1 bindividual.pdb1
cp mm3.pdb1 minimize3.pdb1
cp mm3.pdb bindividual.pdb



Additions for comqumx-4QM:

\cp alpha         ../alpha3    
\cp auxbasis      ../auxbasis3    
\cp basis         ../basis3    
\cp beta          ../beta3    
\cp comqum.dat    ../comqum.dat3    
\cp control       ../control3    
\cp coord         ../coord3    
\cp forceapprox   ../forceapprox3    
\cp gradient      ../gradient3    
\cp mos           ../mos3    
\cp uffhessian0-0 ../uffhessian0-03

\cp mm1.mtf          ../mm13.mtf
\cp mm1.par          ../mm13.par
\cp mm1.pdb          ../mm13.pdb
\cp mm1.pdb1         ../mm13.pdb1


\cp alpha         ../alpha4    
\cp auxbasis      ../auxbasis4    
\cp basis         ../basis4    
\cp beta          ../beta4    
\cp comqum.dat    ../comqum.dat4    
\cp control       ../control4    
\cp coord         ../coord4    
\cp forceapprox   ../forceapprox4    
\cp gradient      ../gradient4    
\cp mos           ../mos4    
\cp uffhessian0-0 ../uffhessian0-04

\cp mm1.mtf          ../mm14.mtf
\cp mm1.par          ../mm14.par
\cp mm1.pdb          ../mm14.pdb
\cp mm1.pdb1         ../mm14.pdb1



echo Change file references in file control3
sed -i "s/file=auxbasis/file=auxbasis3/" control3
sed -i "s/file=basis/file=basis3/" control3
sed -i "s/file=coord/file=coord3/" control3
sed -i "s/file=alpha/file=alpha3/" control3
sed -i "s/file=beta/file=beta3/" control3
sed -i "s/file=mos/file=mos3/" control3
sed -i "s/file=energy/file=energy3/" control3
sed -i "s/file=gradient/file=gradient3/" control3
sed -i "s/file=forceapprox/file=forceapprox3/" control3
sed -i "s/file=twoint/file=twoint3/" control3
sed -i "s/file=uffhessian0-0/file=uffhessian0-03/" control3
sed -i "s/file=ufftopology/file=ufftopology3/" control3
grep file control3


echo Change file references in file control4
sed -i "s/file=auxbasis/file=auxbasis4/" control4
sed -i "s/file=basis/file=basis4/" control4
sed -i "s/file=coord/file=coord4/" control4
sed -i "s/file=alpha/file=alpha4/" control4
sed -i "s/file=beta/file=beta4/" control4
sed -i "s/file=mos/file=mos4/" control4
sed -i "s/file=energy/file=energy4/" control4
sed -i "s/file=gradient/file=gradient4/" control4
sed -i "s/file=forceapprox/file=forceapprox4/" control4
sed -i "s/file=twoint/file=twoint4/" control4
sed -i "s/file=uffhessian0-0/file=uffhessian0-04/" control4
sed -i "s/file=ufftopology/file=ufftopology4/" control4
grep file control4




This is a schematic overview of  ComQumX-2QM

# Start with a scf step then loop through the following four steps

# Gradient step (gradient calculation)
\rm *_[123]
ln -fs control1 control
rdgrad >logg1

ln -fs control2 control
rdgrad >logg2


ln -fs force11 force1
ln -fs control1 control
ln -fs comqum.dat1 comqum.dat
\cp gradient1 grad1
offsetf

fixforce_cnsin
fixforce_turboin
fixforce
fixforce_turboout
mv gradient1 g11
mv grad1 gradient1

ln -fs force12 force1
ln -fs control2 control
ln -fs comqum.dat2 comqum.dat
\cp gradient2 grad1
offsetf

fixforce_cnsin
fixforce_turboin
fixforce
fixforce_turboout
mv gradient2 g12
mv grad1 gradient2
\rm control comqum.dat force1

# Relaxation step
ln -fs control1 control
relax >logr
1
ln -fs control2 control
relax >logr
2

ln -fs control1    control
ln -fs comqum.dat1 comqum.dat
ln -fs mm11.pdb  mm1.pdb3058
ln -fs mm11.pdb1 mm1.pdb1
fixcoord1_cnsin

fixcoord1_turboin
fixcoord1
fixcoord1_cnsout

ln -fs control2    control
ln -fs comqum.dat2 comqum.dat
ln -fs mm12.pdb  mm1.pdb
ln -fs mm12.pdb1 mm1.pdb1
fixcoord1_cnsin

fixcoord1_turboin
fixcoord1
fixcoord1_cnsout
\rm control comqum.dat mm1.pdb mm1.pdb1

# Molmech step
# if  protfree then
   \cp mm3.pdb  mm3.old
   \cp mm3.pdb1 mm3.old1
   \rm minimize3.pdb1
   \rm bindividual.pdb1
   cns <mmrun3
  >mmrun3.out
   if [ -f minimize3.pdb1 ]
   then
      \mv minimize3.pdb  mm3.pdb
      \cp minimize3.pdb1 mm3.pdb1
   fi
   cns <bindividual.inp

   if [ -f bindividual.pdb1 ]
   then
      \mv bindividual.pdb  mm3.pdb
      \cp bindividual.pdb1 mm3.pdb1
   fi
#endif

# Scf step (energy calculation)
ln -fs mm11.mtf  mm1.mtf
ln -fs mm11.pdb  mm1.pdb
ln -fs mm11.pdb1 mm1.pdb1
ln -fs mm11.par  mm1.par
cns <mmrun1   >mmrun11.out
\mv mmen1 mmen11
\mv force1 force11

ln -fs mm12.mtf  mm1.mtf
ln -fs mm12.pdb  mm1.pdb
ln -fs mm12.pdb1 mm1.pdb1
ln -fs mm12.par  mm1.par
cns <mmrun1   >mmrun12.out
\mv mmen1 mmen12
\mv force1 force12
\rm
mm1.mtf mm1.pdb mm1.pdb1 mm1.par

cns <mmrun2   >mmrun2.out

ln -fs control1 control
ridft >logd1

ln -fs control2 control
ridft >logd2

ln -fs comqum.dat1 comqum.dat
ln -fs mmen11    mmen1
ln -fs fixenergy.mmin1 fixenergy.mmin
fixenergy_cnsin
ln -fs mmen12    mmen1
ln -fs fixenergy.mmin2 fixenergy.mmin
fixenergy_cnsin
ln -fs control1 control
ln -fs energy1 energy
ln -fs fixenergy.qcin1 fixenergy.qcin
fixenergy_turboin

ln -fs control2 control
ln -fs energy2 energy
ln -fs fixenergy.qcin2 fixenergy.qcin
fixenergy_turboin

fixenergy
-2qm
ln -fs control1 control
ln -fs energy1 energy
fixenergy_turboout

ln -fs control2 control
ln -fs energy2 energy
fixenergy_turboout
\rm control energy fixenergy.qcin comqum.dat mmen1 fixenergy.mmin
checkconv

 

key about pdb files:
mmrun1:  mm1.pdb (no output file)
mmrun2: mm3.pdb -> minimize.pdb (not used)
mmrun2: mm3.pdb -> minimize3.pdb (used by bindividual.inp)
bindividual.inp: minimize3.pdb -> bindividual.pdb (moved to mm3.pdb)


History

9/9-19: First version