### 2-, 3-, and 4-Point Correlation Function Calculator for Semiflexible Block and Random Copolymers

#### Written by Quinn MacPherson, Shifan Mao, Andrew Spakowitz (posted 1-27-18)

This Python code calculates and plots the 2-, 3-, and 4-point structural correlation functions of wormlike chains. Based on such correlations, it also calculates and plots the 2nd, 3rd, and 4th order vertex functions (Γ) of semiflexible polymer mixtures. The types of polymers include diblock copolymers, and random copolymers. And the types of mixtures include pure polymer melts, and polymer solutions. Examples of applying this code include calculating fluctuation-corrected phase diagrams of diblock copolymers [1], and calculating phase transitions of diblock and random copolymer solutions [2]. See the "README" file for further details.

1. S. Mao, Q. J. MacPherson, and A. J. Spakowitz. "Polymer semiflexibility induces non-universal phase transitions in diblock copolymers,” *Phys. Rev. Lett.*, accepted (2018).

2. S. Mao, Q. J. MacPherson, C. Liu, and A. J. Spakowitz. "Thermodynamic Model of Solvent Effects in Semiflexible Diblock and Random Copolymer Assembly," *Macromolecules*, submitted (2018).

Download package: Vertex.zip

### Particle-Field Monte Carlo Simulation of Semiflexible Random Copolymers

#### Written by Quinn MacPherson, Shifan Mao, Andrew Spakowitz (posted 5-19-17)

This folder contains the Fortran code for finding the equilibrium distribution for a melt of wormlike chains with random chemical sequences [1]. Interactions are handled via a discretized field.
The basic info is in README.txt while the more extended documentation is in README.pdf. Parallel tempering over the Flory-Huggins parameter is accomplished with MPI with one process per replica. The run script "runwlcsim.sh" performs a simulation. The particular inputs are set for relatively rigid polymers near the triple point (see Ref. 1).

1. S. Mao, Q. J. MacPherson, J. Qin, and A. J. Spakowitz. "Field-theoretic simulations of random copolymers with structural rigidity,”
*Soft Matter*, doi: 10.1039/c7sm00164a (2017).

Download package: WLC_field_MC.zip

### Matlab Scripts to Calculate the Structure Factor and Spinodal Decomposition of Semiflexible Random Copolymers

#### Written by Shifan Mao, Quinn MacPherson, Andrew Spakowitz (posted 4-20-16)

This folder contains Matlab scripts to calculate and plot the
structure factor and spinodal decomposition of an A-B semiflexible random copolymer based
on a polymer field theoretic formulation [1].
For a given
chemical correlation λ, number of monomers N, and monomer length (in Kuhn segments) N_{M},
this package calculates the melt
structure factor (density-density correlations),
the spinodal Flory-Huggins parameter χ_{S},
and critical wavemode of phase segregation q^{*}.
The folder "functions" provides functions "s2invwlc" and "kmaxwlc" that
calculate the structure factor of semiflexible (wormlike chain model) random
copolymer ("s2invwlc") and the critical wavemode (location of peak) in the structure factor ("kmaxwlc").
Similar codes
can be found for flexible random copolymers based on the Gaussian chain model ("s2invgc" and "kmaxgc")
and for perfectly rigid random copolymers ("s2invrr" and "kmaxrr").
See the "README" file for further details.

1. S. Mao, Q. J. MacPherson, S. S. He, E. Coletta, and A. J. Spakowitz. "Impact of Conformational and Chemical Correlations on Microphase Segregation in Random Copolymers," *Macromolecules*, **DOI: 10.1021** (2016).

Download package: randcopoly.zip

### Plot Generator for the Velocity-Velocity Correlation Function between Chromosome Loci Modeled as Dynamically Coupled Rouse Segments

#### Written by Thomas Lampo (posted 12-21-15)

This Matlab code calculates and plots the velocity-velocity correlation function between two chromosome loci modeled as connected monomers of a Rouse polymer in a viscoelastic medium [1].
To generate the plots, the Matlab scripts use interpolation on numeric data tables of calculated correlations values. There are three adjustable parameters: the subdiffusive scaling exponent "alpha", the timescale between position measurements "delta" (scaled by inter-segment relaxation time), and the plot range in terms of time divided by "delta". The output is an array of velocity-velocity correlation function vectors, which are plotted in a figure. See the Read_Me file for further details.

1. T. J Lampo, A. S. Kennard, and A. J. Spakowitz. "Physical modeling of dynamic coupling between chromosome loci," Biophysical Journal, 110, 1, 338 (2015).

Download package: VVCF.zip

### Simulations of the Wormlike Chain Model at Arbitrary Discretization: Simulations and parameter calculations for the dssWLC model

#### Written by Elena Koslover (posted 5-16-14)

This package includes simulation software for simulating discrete wormlike chains and Matlab scripts to generate parameters for such simulations. The methods for these simulations leverage our analytical theory for the discrete shearable stretchable wormlike chain model (dssWLC) [1-3]. The simulation code can be used to run Brownian Dynamics or Monte Carlo simulations of the dssWLC model, and several example calculations are provided in the software package. The parameter scripts generate the parameters for use in these simulations. The file doc/README.pdf contains detailed instructions and examples for compiling and using the packages.

1. E. F. Koslover and A. J. Spakowitz. "Multiscale dynamics of semiflexible polymers from a universal coarse-graining procedure," PRE, 90, 013304 (2014).

2. E. F. Koslover and A. J. Spakowitz. "Discretizing elastic chains for coarse-grained polymer models," Soft Matter, 9, 7016 (2013).

3. E. F. Koslover and A. J. Spakowitz. "Systemic Coarse-Graining of Microscale Polymer Models as Effective Elastic Chains," Macromolecules, 46, 2003 (2013).

Download package: dssWLCcode.tar.gz

### J-factor Calculator: DNA Looping Probability From the Wormlike Chain Model

#### Written by Elena Koslover (posted 7-9-2013)

This Matlab code calculates the J-factor for a twisted wormlike chain. That is, it finds the probability density of one end of a semiflexible polymer matching up in position and orientation to the other end. The calculations make use of the full partition function for a wormlike chain with twist [1]. The function "jfactor" can be used in the matlab workspace with the input variables described in the file jfactor.m. With the default parameters supplied, calculations are accurate for chain lengths above about two persistence lengths. On the first run, the calculation generates a single large data file (a process that can take tens of minutes). Subsequent calculations make use of this data file and will run in seconds.

1. Spakowitz, A. J. "Wormlike chain statistics with twist and fixed ends", Europhys. Lett. 73(5) pp. 684-690 (2006)

### fiberModel Package: Modeling Regular Chromatin Fibers

#### Written by Elena Koslover (posted 11-29-2010)

The code in this package finds locally optimized structures of regular helical chromatin fibers, taking into account the elasticity of the DNA linkers and steric packing of cylindrical nucleosomes and linker DNA. In addition, the code can be used more generically to find optimal paths of a discretized wormlike chain with fixed end conditions (e.g., looping of DNA or of a single nucleosome). Local minimization, certain geometry constraints, and basin hopping to search through different local minima are all implemented. The file doc/README.pdf contains detailed instructions and examples for compiling and using the package.

May 19, 2015: Package updated with fix of bug in the input structure subroutine (inputstruct.f90).