Skip to content

Commit

Permalink
add makefile and readme_AD
Browse files Browse the repository at this point in the history
  • Loading branch information
garyzhang91 committed Jun 12, 2018
1 parent a9aa647 commit 3724679
Show file tree
Hide file tree
Showing 3 changed files with 341 additions and 0 deletions.
169 changes: 169 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
ALL = rama coma oops stats befa lipa peptide merg dssp2cm peptmpi cdlearn
TOOLS = tools/extract_distances \
tools/1pga_helix_orientation \
tools/R0003_collect_SS \
tools/num_helix_residues \
tools/count_charged_residues \
tools/icm2icm \
tools/initialize_test \
tools/turn_analyser \
tools/hbond_pattern \
tools/rmsd/rmsd \
tools/rmsd/rmsd_debug \
tools/rmsd/rmsd_dihedral \
tools/energy_landscape_charts/list_large_basins \
tools/checkpoint_split/checkpoint_split \
tools/thermodynamics/thermo \
tools/energy_landscape_charts/beta \
tools/energy_landscape_charts/rmsdbasin \
tools/energy_landscape_charts/rmsdbasin_dihedral

OS = $(shell uname -s)
CFLAGS = -std=c99 -O2 # -D_GNU_SOURCE #-fgnu89-inline
CPP=g++
CPPFLAGS = -Wall -O2
OPENMPFLAGS = -fopenmp
LDFLAGS = -lm
LDFLAGS_DEBUG = -lm

ifeq ($(OS), Linux)
CFLAGS = -std=c99 -Wall -O2 #-Wno-unused-result
CFLAGS_DEBUG = -std=c99 -Wall -O0 -g -DDEBUG #-Wno-unused-result -g
ifneq ($(shell which mpicc),)
MPICC = mpicc
MPILDFLAGS = $(LDFLAGS)
ALL := $(ALL) peptmpi
endif
endif

ifeq ($(OS), Darwin)
CFLAGS = -std=c99 -Wall -O2
CFLAGS_DEBUG = -std=c99 -Wall -O0 -g -arch i386 -DDEBUG
ifneq ($(shell which mpicc),)
MPICC = mpicc
MPILDFLAGS = $(LDFLAGS)
ALL := $(ALL) peptmpi
endif
endif

ifeq ($(OS), SunOS)
CFLAGS = -xO2
ifneq ($(shell which mpcc),)
MPICC = mpcc
MPILDFLAGS = -lmpi $(LDFLAGS)
ALL := $(ALL) peptmpi
endif
endif

all : $(ALL)

tools : $(TOOLS)

rama : aadict.c ramachandran.c vector.c peptide.c rotation.c params.c error.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

coma : aadict.c cm.c params.h error.h
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

oops : oops.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

stats : statistics.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

befa : aadict.c bfactor.c peptide.c rotation.c vector.c params.c error.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

lipa : aadict.c pauling.c peptide.c rotation.c vector.c params.c error.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

#internal cdlearn program
cdlearn : aadict.c energy.c cdlearn.c metropolis.c flex.c peptide.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DLJ_HBONDED_HARD -DLJ_NEIGHBOUR_HARD $(OPENMPFLAGS) $^ $(LDFLAGS) -o $@

cdlearn_debug : aadict.c energy.c cdlearn.c metropolis.c flex.c peptide.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS_DEBUG) -DLJ_HBONDED_HARD -DLJ_NEIGHBOUR_HARD $^ $(LDFLAGS_DEBUG) -o $@

#serial peptide program (MC, nested sampling)
peptide : nested.c aadict.c energy.c main.c metropolis.c flex.c peptide.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c canonicalAA.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@ -g

peptide_debug : nested.c aadict.c energy.c main.c metropolis.c flex.c peptide.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS_DEBUG) $^ $(LDFLAGS_DEBUG) -o $@

#parallel peptmpi program (parallel tempering, nested sampling)
peptmpi : nested.c aadict.c energy.c main.c metropolis.c flex.c peptide.c probe.c random16.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(MPICC) $(CFLAGS) -DPARALLEL $^ $(MPILDFLAGS) -o $@

peptmpi_debug : nested.c aadict.c energy.c main.c metropolis.c flex.c peptide.c probe.c random16.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(MPICC) $(CFLAGS_DEBUG) -DPARALLEL $^ $(LDFLAGS_DEBUG) -o $@

merg : mergie.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

dssp2cm : dssp2cm.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

#TOOLS

tools/extract_distances : aadict.c energy.c tools/tools_main.c metropolis.c peptide.c flex.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DEXTRACT_DISTANCES $^ $(LDFLAGS) -o $@

tools/1pga_helix_orientation : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c flex.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DHELIX_ORIENTATION $^ $(LDFLAGS) -o $@

tools/R0003_collect_SS : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c flex.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DR0003_SSBOND $^ $(LDFLAGS) -o $@

tools/num_helix_residues : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c probe.c flex.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DNUM_HELIX_RESIDUES $^ $(LDFLAGS) -o $@

tools/count_charged_residues : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c flex.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DCOUNT_CHARGED_RESIDUES $^ $(LDFLAGS) -o $@

tools/icm2icm : tools/icm2icm.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

tools/initialize_test : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c flex.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DINITIALIZE_TEST $^ $(LDFLAGS) -o $@

tools/turn_analyser : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c flex.c probe.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DTURN_ANALYSER $^ $(LDFLAGS) -o $@

tools/hbond_pattern : tools/tools_main.c aadict.c energy.c metropolis.c peptide.c probe.c flex.c rotation.c vector.c params.c error.c checkpoint_io.c vdw.c
$(CC) $(CFLAGS) -DHBOND_PATTERN $^ $(LDFLAGS) -o $@

tools/rmsd/rmsd : aadict.c peptide.c tools/rmsd/rmsd.c tools/rmsd/rmsd_main.c rotation.c vector.c flex.c params.c metropolis.c energy.c error.c vdw.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

tools/rmsd/rmsd_debug : aadict.c peptide.c tools/rmsd/rmsd.c tools/rmsd/rmsd_main.c rotation.c vector.c flex.c params.c metropolis.c energy.c error.c vdw.c
$(CC) $(CFLAGS_DEBUG) $^ $(LDFLAGS_DEBUG) -o $@

tools/rmsd/rmsd_dihedral : aadict.c peptide.c tools/rmsd/rmsd.c tools/rmsd/rmsd_main.c flex.c rotation.c vector.c params.c metropolis.c energy.c error.c vdw.c
$(CC) $(CFLAGS) -DRMS_DIHEDRAL $^ $(LDFLAGS) -o $@

tools/energy_landscape_charts/list_large_basins : tools/energy_landscape_charts/list_large_basins.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

tools/checkpoint_split/checkpoint_split : tools/checkpoint_split/checkpoint_split.c tools/checkpoint_split/rmsd.c params.c vector.c rotation.c aadict.c peptide.c metropolis.c energy.c error.c vdw.c
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

#CPP TOOLS

tools/thermodynamics/thermo : tools/thermodynamics/thermo.cpp
$(CPP) $(CPPFLAGS) $^ $(LDFLAGS) -o $@

tools/energy_landscape_charts/beta : tools/energy_landscape_charts/beta.cpp
$(CPP) $(CPPFLAGS) $^ $(LDFLAGS) -o $@

tools/energy_landscape_charts/rmsdbasin : tools/energy_landscape_charts/rmsdbasin.cpp
$(CPP) $(CPPFLAGS) $(OPENMPFLAGS) $^ $(LDFLAGS) -o $@

tools/energy_landscape_charts/rmsdbasin_dihedral : tools/energy_landscape_charts/rmsdbasin.cpp
$(CPP) $(CPPFLAGS) $(OPENMPFLAGS) -DRMS_DIHEDRAL $^ $(LDFLAGS) -o $@

wrap :
tar -zcvf crankite.tar.gz README ChangeLog TODO COPYING Makefile *.[ch] viewer.ps *.sh *.awk engh-huber-2001.txt peptide-contacts.txt *.py tests tools

clean :
$(RM) $(ALL) $(TOOLS)
148 changes: 148 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
CRANKITE
A Fast Polypeptide Backbone Conformation Sampler

CRANKITE is a suite of programs for simulating backbone conformations of
polypeptides and proteins. The core of the suite is an efficient Metropolis
Monte Carlo sampler of backbone conformations in continuous three-dimensional
space in atomic details. In contrast to other programs relying on local
Metropolis moves in the space of dihedral angles, the sampler utilizes local
crankshaft rotations of rigid peptide bonds in Cartesian case. The sampler
allows fast simulation and analysis of secondary structure formation and
conformational changes for proteins of average length.


1. Compilation and Usage

The package provides Makefile recognized by GNU make (or gmake), which builds
the suite. So fire up "make"! Most programs in the suite are controlled through
various options given on the command line. Invalid options (or the valid option
"-h") trigger the output of usage notes. The following programs are provided in
the suite from most to least important.

peptide
The Metropolis polypeptide backbone conformation sampler. A very short
simulation can be run by using a command like

./peptide -r 1000x25 -t 201 d1ctf__.pdb

This will read the initial conformation from file d1ctf__.pdb, perform
25,000 Metropolis moves, while recording a contact map and a snapshot
conformation every 1000 steps. The output will have 25 contact maps and
25 snapshots. To get help with more options one can use "./peptide -h".

peptmpi
The same as peptide, but compiled for parallel-tempered simulations
using MPI.

lipa
Converts dihedrals to a 3D-structure in PDB format. Each input line
should start from a 1-letter residue id and dihedral angles phi and psi
separated by spaces, e.g. "Q -57 -47". Optionally, the valence angle
tau and the cis/trans angle omega can be given in the fourth and fifth
positions. The sixth optional angle is interpreted as a chi_1 dihedral
to add an gamma side chain atom.

The omitted phi and psi angles are assigned random values appropriate
for polypeptides to minimize clashes. This feature can be used to
create a random coil conformation by providing a sole residue id in
each line of input.

This program is an approximate inverse of rama and one can pipe rama
output through lipa to recreate the original structure. This inversion
is not ideal, because it assumes reasonable but not precise values for
ignored and omitted bond lengths angles. This program can be used to
create an arbitrary initial conformation for "peptide".

rama
Calculates backbone dihedrals for a polypeptide in PDB format. In
addition, valence geometry of each CA atom is characterized in terms of
an N-CA-C valence angle tau and a normalized solid angle formed by
three bonds with heavy atoms. The solid angle is positive for L-amino
acids and negative for D-amino acids. Side-chain dihedral angles
chi_1 are also reported. Other calculated characteristics of local
polypeptide conformation include CA-CA and CB-CB distances between
adjacent residues, pseudo-dihedral angles CB-CA-CA-CB, etc.

coma
Calculates a contact map for a protein structure in a PDB file.
Contacts are defined by a cut-off distance between CA or CB atoms. Some
of this functionality is also integrated in "peptide". The program can
also produce a distance matrix.

befa
Produces a mean structure with B-factors for the multiple models in an
NMR-style PDB file. Calculation of B-factors for a simulation
trajectory is reliable only if the trajectory is very short (less than
100 steps per residue).

stats
Basic statistical pipe tool to calculate means, standard deviations,
extreme values, and statistical inefficiencies for a stream of data.

merg.sh
Merges and sorts output files that are produced during a Sun MPI
parallel-tempered run using "mprun -B". The files to be merged should
be listed on the command line. The script and the merg executable are
useful only on Sun clusters.

cdlearn.sh
An example script to set up Contrastive Divergence learning (see below)
from a dataset of PDB structures. The script uses 2 parameters: the
number of available cluster nodes and a file with the list of PDB id's.
This script distributes tasks over cluster nodes using PBS (Portable
Batch System). Each node receives a PBS job diverge.pbs.

viewer.sh
PDB viewer produces a stereo pair in a printable PostScript format. It
uses a PDB file name as a command line parameter. PDB files are parsed
by the oops executable that is called from the script.

By default, all the programs read data from the standard input (stdin) and
write to the standard output (stdout), so that one can use them in a pipeline.
If a file name is given on the command line, the input is redirected from this
file. The option "-o file_name" allows one to redirect the output to a file.
This is an example of a pipeline that involves most programs in the suite

./rama d1ctf__.pdb | ./lipa | ./peptide -r 500x10 | ./befa | ./coma

Here, rama calculates dihedral angles for d1ctf__ and passes them to lipa to
recreate a 3d structure, which is passed to peptide for a short simulation
producing 10 snapshots, then befa averages them, and finally coma produces a
contact map for the average structure.

We implemented an alternative way of setting initial conformation for
"peptide". One can enter a sequence of residues directly on the command line,
e.g.,

./peptide -r 4096x200 ABCDEFGHabcdefgh

This will run simulations on the 16-residue polypeptide, starting from the
first 8 residues in alpha-helical state and the last 8 residues in beta-strand
conformation.

The default force-field used by peptide includes hard-core van der Waals
repulsions and square-well interpeptide hydrogen bonding. One can also specify
Go-type interactions between side-chains by providing a regularized contact
map. For example,

./peptide -r 4096x200 -p _B=beta-16.in WHATISMYSMEARARM

where the file beta-16.in (provided in the package) contains the regularized
contact map corresponding to 16-residue beta-hairpin. The above example starts
simulations from alpha-helical conformation and turns it into a beta-hairpin in
less than 15 seconds on a 3.2 GHz Pentium D system.

The peptide's option "-p" is perhaps the most powerful option, which allows one
to control many parameters of the program, including force-field constants.
This option is intended to be customizable and flexible. To learn more about
this option in the current version, we would like to refer the reader to the
source code.


2. Conclusion

CRANKITE was created as an extremely light-weight suite not overburdened with
excessive command line options and configuration files. While usable as is,
to unlock its full power, one will need to familiarize oneself with CRANKITE
internals. CRANKITE source code is available without any warranty under
the terms of GNU General Public License version 2.
24 changes: 24 additions & 0 deletions README_AD
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
folding with AutoDock potential:

example usage:

peptide -r 10000x3000 -t 2 apgvgvapgvgv -p Bias=NULL,external=5,con8,2,1.0,external2=4,con8,2,1.0,Opt=1,0.5,0.5,-0.5 -o output.pdb

external=5,con8,2,1.0
This calls the autodock grid maps. It will look for rigidReceptor.*.map.
con8 is the a file indicating the residues to score, usually just all residue number.
2 is a thermo factor that is an addition to the original temperature.
1.0 calls the reconstruction of side chain during the scoring.

external2=4,con8,2,1.0
This calls the cyclic procedure to create an artificial peptide bond between first and last residue.
con8 is meaningless right now, but can be used to indicate the location of the cyclic bond in the future.
2 is the thermo factor, and it will overwrite the previous one in external.
1.0 is meaningless right now, but can be used to flag the cyclic bond type, etc.

Opt=1,0.5,0.5,-0.5
This calls the optimizing/docking procedure. Opt=0 is to use regular MC.
The following 3 numbers is the weight of the target energy in the optimizing procedure.
In the example above:
targetE = 0.5 * totalE + 0.5 * externalE + (-0.5) * firstlastE
Note that totalE includes internalE, externalE and firstlastE. So the above weights scale down the internal energy by a factor of 2 and remove the energy between the first and last residues. The default weights are set to be 1, 0, 0.

0 comments on commit 3724679

Please sign in to comment.