CNS

The current version is 1.3

The program is located in 
/temp4/bio/CNS  (garm)
/lunarc/nobackup/projects/bio/CNS

The program is run by (it also sets some environmental variables):
cns
(link to $CNS_SOLVE/bin/cns)


A web-based manual is found in file:/temp4/bio/Cns/cns_solve_1.3/doc/html/cns_solve.html
 
The home page of CNS is: http://cns-online.org/v1.3/.
 

Help etc
You can get some more info and commands by
csh
source /temp4/bio/CNS/cns_solve_1.3/cns_solve_env
cns_web (will start the web manual)
cns_info (will give some fundamental information)
cns_header task-file (to extract the input parameter section from a task file)
cns_edit [-help] [-def defaults-file] task-file (to edit a task file)
cns_transfer -def defaults-file -inp task-file [-out output-file] (to transfer defaults to a task file without the HTML interface).
When running cns interactively, you can get help by typing:


help

help-global
help-datatypes
To find out if there was any error in the batch job.


grep ERR output_file


Useful commands


Comments

To read in a simple protein structure

topology @CNS_TOPPAR:protein.top end                {Read in the topology file}
parameter @CNS_TOPPAR:protein.param end     {Read in the protein parameters}
segment chain coordinates @pdb end end     {Define the structure}

do (name="CD1") (name CD and resname ile)           {Change the name of CD1 in ILE}
do (name="O") (name OT1)           {Change the name of terminal oxygen}
do (name="OXT") (name OT2)           {Change the name of terminal oxygen}
coordinates @pdb   {Read coordinates; warnings will be issued for hydrogens}



To construct a generate file
  1. Set up a CNS generate file .

  2. You should typically change:
    1. pdb file names
    2. names of other pdb files (water, ligands, etc.)
    3. names of the topology and parameter files for the ligands.
    4. optionally set the occupancy set flag to true (if alternate configurations have been removed)
    5. crystal data (space group and dimensions)
     
  3. Run CNS with this file to obtain a structure file (generate.mtf)

  4. cns <generate.inp >generate.out
    This yields also a pdb-file (generate.pdb)
     
  5. Check that the calculation was sucessful with

  6. grep ERR generate.out
    grep WRN generate.out
    grep INFO generate.out

    ( %READC-WRN: still    511 missing coordinates (in selected subset)    can be ignored)
    If there many errors, you have probably forgot to add an END row in all the pdb files.


To construct a minimize.inp file

  1. Run CNS on the web again to construct the refinement:minimize.inp sample file.

  2. Typically you shall change (for the other fields, default values are normally OK):
    1. structure file name =mm3.mtf
    2. parameter file names, if any (do not forget water.param)
    3. coordinate file name =mm3.pdb
    4. reflection file name
    5. resolution range
    6. number of minimisation steps = 0
    7. crystal data (space group and dimensions)
    8. Possibly also fixed atoms
     
  3. Test this program by running

  4.      cns <minimize.inp >minimize.out
         Check the result, using:
         grep ERR mmrun2.out
         grep WRN mmrun2.out
         grep INFO mmrun2.out


To calculate the number of atoms
show sum (1) (all)
evaluate ($natom=$result)    {NB $natom becomes a real number, not an integer}

Compilation

This procedure worked excellently on gefion and aurora 5/10-16 (version 1.3)

On garm, husmodern and whenim64, I instead had to do
make g77install

I also tried:
cd /home/bio/Bin
ln /usr/local/pgcc/bin/pg77 fort77
cd -
make install
but this gave a large number of warnings, some errors and no executable code.

8/6-09 Recompilation on milleotto:
Had to change bin/getarch to recognize the new machine.
make g77install

9/6-09 Compilation on milleotto with cns-1.21:
make install worked well

I got
lex refloat.l
make[4]: lex: Command not found
make[4]: *** [refloat] Error 127
make[3]: *** [utils] Error 2
make[2]: *** [compile-utils] Error 2
make[1]: *** [utils] Error 2

but the program worked

9/6-09 Compilation on gefion with cns-1.21:
Neither
make install
make install compiler=gfortran
make install compiler=ifort
make install compiler=g77
worked

12/6-14 Compilation of cns-1.3
Failed on gefion (no icc).
Successful (make install) on platon.

5/10-16 Compilation of cns-1.3
make install worked nicely on gefion and aurora

2/4-20 Compilation of cns-1.3
make install worked on kebnekaise, but program failed with:
%SETFPEPS increase value of MXFPEPS2 and recompile
%SETFPEPS error encountered: Could not determine machine epsilon

After searching internet, I found this page:
https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54

I changed the subroutine SETFPEPS in machvar.f (in 
cns_solve_1.3/intel-x86_64bit-linux/source) to

       SUBROUTINE SETFPEPS
c     UR: I replaced the old routine with this from internet:
c https://ask.bioexcel.eu/t/cns-errors-before-after-recompilation/54/16
C
       IMPLICIT NONE
C I/O
       INCLUDE 'numbers.inc'
       INCLUDE 'machvar.inc'
C
C     Determine the machine epsilon i.e. the smallest FPEPS such that both
C     1+FPEPS and 1-FPEPS are different from 1.
C
C     local
       DOUBLE PRECISION ONEDP
       DOUBLE COMPLEX DBCOMP
C
C     external
C     NONE
C
C     begin
C
C     ONEDP doesn’t really need to be defined - EPSILON() only needs to know
C     the type
       ONEDP=(1.00)
       FPEPS = EPSILON(ONEDP)
       DBCOMP = DCMPLX(ZERO,ZERO)
       CALL DECLAR('FP_EPSILON', 'DP', ' ', DBCOMP, FPEPS)
       RETURN
       END


then make cns_solve (still in that directory).
After that cns seems to work.

2/2-21 Compilation on Tetralith (cns-1.3)

4/2-21 Compilation of nCNS on Tetralith

4/2-21 Compinling nCNS on Kebnekaise