This folder contains the codes required to obtain the data used in the paper: 'Control of superselectivity by crowding in three-dimensional hosts' by Andrew T. R. Christy, Halim Kusumaatmaja and Mark A. Miller, published in Physical Review Letters.

The code is developed by Andrew T. R. Christy (andrewchristy93@gmail.com)

CODE FOR SIMULATING A POLYMER CLIENT EXPLORING A CUBOID SYSTEM WHERE ONE CUBE IS OCCUPIED BY RECEPTORS (AND CROWDERS)
License: GPL3

**********************************************************************************************************************************************
SETUP.f08 is a code to set up the slab configurations of the scaffold
interactionsetup.txt is the parameter file for setting up the initial configuration of the scaffold (an annotated file is included in this archive)
2systemsetupclient.txt is the parameter file for the simulation runs (annotated file is included in this archive)
directionalbindingRUN.f08 is the simulation code for the directional binding binding case
isotropicbindingRUN.f08 is the simulation code for the isotropic binding case
**********************************************************************************************************************************************

Compile SETUP.f08 using the following command: gfortran -o setup SETUP.txt
Create a folder at chosen receptor density (e.g 0.4scaffold) and copy the file interactionsetup.txt into this folder. Following this, set the values in the setup file and run the setup code using: ../setup
The main output for this file is movetagged.vft, which gives the coordinates of the crowders and receptors for t independent scaffolds (where t is the integer adjacent to the keyword 'time' in interactionsetup.txt)


Compile directionalbindingRUN.f08/isotropicbindingRUN.f08 using the following command: gfortran -o run <filename>.txt
To study a client exploring the system you have just produced, go back to the root folder (the one containing the .f08 files) and make a folder for your chosen client, e.g. decavalent_linker_5. Then copy the file 2systemsetupclient.txt into this folder. Edit this file to choose which snapshot of the scaffold simulation to use, add in the path to the scaffold trajectory e.g. ../0.4_scaffold/ and ensure all of the other inputs are correct. Then run the simulation using the command: ../run

The main output files are move.vtf and bonddate.dat. 

move.vtf can be visualised using VMD, just navigate to the folder and run: vmd move.vtf

bonddate.dat contains the number of times the client is bound and where it is located. It also give the number of times m client beads are bound. The data in bonddate.dat is as follows:
totalbindevents(1),totalbindevents(2),totalbindevents(3),locb(1),locb(2),bindinghist(:)
totalbindevents(1) = number of times the client is bound to the scaffold and its centre of mass is also in the scaffold box
totalbindevents(2) = number of times the client is bound to the scaffold and its centre of mass is in the empty box
totalbindevents(3) = number of times the client is unbound 
locb(1)= the number of times each client bead is bound
bindinghist(:) = the number of times the client is bound by m beads, where binding hist is an array from m=0 to m=client length

