Spakowitz Research Group

Theory and Computation of Biological Processes and Soft Materials

Brachiation Fitting to Rheological Data: Dimensional Model Code and Simulated Annealing Algorithm

Written by Pam Cai (posted 9-16-22)

This python repository contains a function to evaluate our model for dynamically associating polymer networks with dimensional units, the algorithm used in our manuscript for fitting the model parameters to a given rheological dataset, and an example dataset to get you started with the code in the repository. To see how the algorithm works, run the simulated annealing script.

1. Cai P., Su B., Zou L., Webber M., Heilshorn S., Spakowitz A. Rheological Characterization and Theoretical Modeling Establish Molecular Design Rules for Tailored Dynamically Associating Polymers. ACS Central Science, in press (2022).

Download package: link


Wormlike Chain Model Statistics (wlcstat)

Written by Andy Spakowitz (posted 3-7-22)

This python repository contains functions to predict the equilibrium and dynamic behavior of polymeric fluids and materials, particularly focusing on semiflexible polymers modeled using the wormlike chain model and several related models. Theoretical background for these functions is systematically developed in the associated pages, including derivations and example calculations. These theoretical developments represent an overview of analytical theory developed in the Spakowitz lab at Stanford University.

Download package: link


Brachiation Theory: Prediction of Rheology of Physically Associating Polymer Gels

Written by Pam Cai (posted 7-16-20)

Brachiation theory predicts the rheological behavior of dynamically-associating polymer networks. The code in this respository calculates the analytical prediction of the rheology of such a polymer network as dictated by brachiation theory.
An example plot of the predicted rheology is included.

1. Cai P., Krajina B., Spakowitz A. Brachiation of a polymer chain in the presence of a dynamic network. Phys. Rev. E, in press (2020).

Download package: link


Master equation solution for the re-establishing epigenetic sequence

Written by Sarah Sandholtz and Quinn MacPherson (posted 7-16-20)

This folder contains the MATLAB code used in [1] for calculating the master equation (ME) solution for methyl speading along a chromosome based on the chromatin structure. A complementary Monte Carlo (MC) simulation (in Fortran) predicts the chromatin configuration from a fixed methylation sequence. Also included in this folder is code used in [1] for identifying neighboring nucleosomes, calculating the correlation between the initial and final methylation sequences, and calculating and plotting the dynamics of methylation reestablishment. The file “README.pdf” contains basic descriptions of the scripts. Raw data for the chromatin configurations from the MC simulations in [1] can be found in the subfolder MCsimdata, and raw data for the methylation sequences in [1] can be found in the subfolder MEdata.

1. S. H. Sandholtz, Q. J. MacPherson, and A. J. Spakowitz. "Physical Modeling of the Heritability and Maintenance of Epigenetic Modifications,” PNAS, in press (2020).

Download package: epiconfer.zip


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., 120, 067802 (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, DOI: 10.1021/acs.macromol.8b00172 (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) NM, 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," Physical Review E, 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, 684-690 (2006)

Download package: jfactor

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).

Download package: fiberModel