Package: wlcsim
What iswlcsim?A project started by the Spakowitz lab for carrying out various polymer physics
calculations, especially multi-scale, coarse-grained simulation and theory
relating to semiflexible polymers. The library has been applied largely to
simulate DNA, and to compare results from polymer field theory to measurements
of biological polymer systems, but ouruniversal coarse graining procedureand ourfieldtheoreticresultsshould be
broadly applicable to any semiflexible polymer system.For example, combining our coarse graining procedure withfield theoretic
simulations,
we wereable to simulatethe
phase segregation of an entire chromosome due to H3K9 methylation.There are two largely independent codebases that are each calledwlcsim.
One is a Fortran program that implements our universal coarse graining procedure
to allow Monte Carlo and Brownian dynamics simulations of semiflexible polymers
with high discretization lengths (i.e. with a very small number of beads). The
Monte Carlo routines in this codebase are highly optimized, and integrated with
our field theoretic simulations. For details seewlcsimf.There is an associated Python package,wlcsim, which can be used to help
process the output of our Fortran code, but also contains much easier to use
Monte Carlo and Brownian dynamics routines. For more details on this package,
see thewlcsimpydocs.The remainder of this section focusus on the FORTRAN code. The features of this
codebase are described infeatures.Setting up a Fortran simulationTo define the system you would like to simulate, set the approparte valuessrc/defines.inc.  Discriptions of each parameter are found along with their
definitions insrc/defines.inc.  In pracatice, the best approach is often to
start from examples provided ininput/example_defines/.Some parameters that MUST be set are given default values that prevent the code
from compiling. This is on purpose so that the code is not accidentally run with
something arbitrary for these values (like the length of the chain, the
persistence length, etc).For tips on setting up and running simulations seetips.Running the Fortran codeSimply typingmakein the top level directory will build the simulator from
source. The executable created (wlcsim.exe) will data from theinput/directoyr and write its output to thedatadirectory.  To force a rerun
without having to manually delete all the old output files, you can also simply
typemake runat any time.By default, specifying multiple polymers just simulates them in parallel in the
same reaction volume, no interactions are assumed.To scan parameters, the Python scriptscan_wlcsim.pyshould be used. It
takes care of saving the current git commit_hash, all inputs, etc. into a
unique directory, and preventing race conditions even on shared filesystems,
among other things.To perform parallel tempering using MPI for multiprocessing using 10 threads
first compile usingmakethen typempirun-np10 wlcsim.exe.  For more
details on parallel tempering seeparallel_temp.OutputThere are several ways to easily visualize simulation output. There are PyMol
scripts in thevizualizationdirectory,python-mwlcsim.plot_wlcsimfrom the repo’s top level directory will launch a GUI designed to visualize BD
simulations, and one can of course simply use the output in thedatadirectory, which contains rank two arrays of shapenum_beads*num_polymers-by-3, with one file per time point.For more details seeoutput.DisclaimerThis codebase is internal to the Spakowitz lab and is not guaranteed to be
bug-free at any point. For battle-tested versions of our software, please see
the links in the relevant papers.