All the model files are in model_files directory. This directory has 4
subdirectories: long_dend, which contains model files for spatial
simulations of a 20 um long dendrite; model_70_percent, model_100_percent and model_120_percent
contain files for simulations of a short dendrite. model_100_percent is the basal model, model_70_percent and
model_120_percent were used for robustness evaluation.  All the scripts used in
analysis and to generate the figures are in directory scripts.

To successfully run a model, you need the master model file, which
specifies reaction file, initial conditions file, morphology file,
stimulation file and output config file.

Run the simulation using version 2.1.10 of NeuroRD.
This version of the java program is called stochdiff2.1.10.jar and is located in scripts/.
To run NeuroRD:
java -jar stochdiff2.1.10.jar <model_file>

NeuroRD generates two files: one
ending with '-mesh.txt', which specifies morphology, the other ending
with '-conc.txt' containing amounts of molecular species (specified in
output config file) in the region specified in output config file.

Names of master model files
start with
"Model_one_short_dendrite_PKAc_times_3_switching_L_pump_neurogranin_"
for the short dendrite simulations and
"Model_long_dendrite_PKAc_times_3_switching_L_pump_neurogranin_" for
the long dendrite simulations. Initial conditions file names start
with "IC_switching_steady_L_pump_neurogranin", reaction file names
start with
"Reac_gradedkdiff_PKAc_times_3_gigs_switching_L_pump_neurogranin",
stimulation files start with "Stim_" and morphology files start with
"morph". If the master file (or any other file) was used for
simulations of bath application of bAR agonists and antagonists, or
blocked PKA conditions, it is also indicated in the file
name. Probably the safest thing is to have all the model files (of a
particular model) in one directory.

An alternative method of running the simulations is to use the python script:
generate_initial_specie_information.py

usage:
python get_initial_specie_information.py <model_master_file> <length of the simulation> [other options]

get_initial_specie_information.py will make a new master_file with the ending runtime_[length of the simulation].xml

If you run get_initial_specie_information.py without specifing the runtime, the script will run the simulations for one simulation step and generate a new master model file <master model file>_runtime_<simulation step>.xml and a new output file <master model file>_whole_output.xml.
The output config specifies providing output for every molecule in the simulation.
It will generate a new output config file (using initial conditions file)
unless one specifies not to (e.g. for the long dendrite simulations).  

This python script is very convenient for simulating the short dendrite,
however, for simulations of the longer denrite, you might want to use
a custom output config file (only getting output of a subset of the molecules) 
to make the simulations a bit faster and concentration files smaller.

--help
gives all the options of get_initial_specie_information.py (also how
to specify custom output file).

Additional information on generate_initial_specie_information.py:
If you use this python script to run your simulations, you will have to change the neurord path
inside the code or specify it in command line using --path. If you use
it without --no_run switch, the model will either run for a specified
time (in ms) or for dt and add runtime_{specified time} to the models
filename. I run my models with --segment_concentrations and
--segment_list=PSD,head,neck to get concentrations in the spine and
dendrite. You can get_initial_specie_information.py also to generate
concentrations while model is still running.
One can use the same python script to perform just the analysis with a --no_run switch.
--chosen_species will prevent generating the output config file and instead use the custom one specified in the master model file.

I use make_figures.py to look at concentrations of individual molecular species.

To generate Tables S1 and S2 use check_thresholds.py and
check_thresholds_dendrite.py respectively. Both scripts also contain
information about the path of data files used to generate
tables. Please update them to match your directory tree.

Running multispine models I also use
get_initial_specie_information.py. Here I specify a custom output file
(Long_dend_output.xml) because the data files are huge and difficult
to analyze. I use --segment_concentrations and then use
make_full_spines.py to obtain specie concentrations in the spines. For
species used in dendritic signature I use extract.py. I generated
figures using averaged traces (obtained with make_average.py). I use
multispine_statistics.py to get duration above the threshold for
individual traces. To generate figure 10 use new_way_spines.py (with
averaged traces).

config.py and config_long.py are the main files governing figures, specifying which
file names to use to plot data. You will have to update those paths to
match your directory tree. function.py contains all the functions I used.
Fig 3 was generated using Epac_comparison.py
Fig 4 was generated using 2_panel_signatures.py
Fig 5 was generated using 4_panel_figure.py
Figs 6&7 were generated using
synaptic_tags_camkii_calibration_standard_paradigms_only_epac.py
Figs 8&9 were generated using propranolol_carvedilol.py
Fig 10 was generated using glurs_2_panel.py
Fig 11 was generated using new_way_spines.py To extract data from conc
files I used extract.py and make_full_spines.py
Fig 11 was generated using fig_12.py, model files are in fig_12 directory

