See Boyle, Berri and Cohen, Gait modulation in C. elegans: an integrated neuromechanical model, Front. Comput. Neurosci., 2012.
This file is based on the original readme.txt in the Supplemental data.
Installation guide:
-
Clone this project:
git clone https://github.com/OpenSourceBrain/CelegansNeuromechanicalGaitModulation.git
-
Go to "WormSim" directory.
cd WormSim
-
Set idaInstallDir:
idaInstallDir=
pwd
/Sundials -
Go to sundials-2.3.0 directory, configure & make:
cd sundials-2.3.0
./configure CC=g++ --prefix=$idaInstallDir --disable-mpi --disable-fcmix
make
make install -
Look carefully at the resulting output and check for any error messages (there shouldn't be any...). Fix and repeat step 4 if necessary. An error you may see will indicate 'machine 'make' not recognized'. This means that your build (and potentially host) machine are not set correctly for configure. If this is the case, and assuming you are running a 64-bit, x86 processor, try running the following commands instead:
cd sundials-2.3.0
./configure CC=g++ --build=x86_64 --host=x86_64 --prefix=$idaInstallDir --disable-mpi --disable-fcmix
make
make install -
You should now be able to proceed to running the simulator.
-
The whole integrated model is in worm.cc. Edit this to change any aspects of the model e.g. different environments (water -> intermediate -> agar, with and without objects).
-
To compile the program, make sure you're in the "Model" directory.
-
Enter the command "make".
-
Check the resulting output for errors (some warnings are unfortunately inevitable, but they shouldn't be a problem), fix and re-run "make" if necessary.
-
Enter the command "./program" and wait for it to complete.
-
"program" will generate a file called "simdata.csv", and possibly also "objects.csv" (if objects are being used).
-
Open the appropriate viewer program, found in "WormSim/MatlabSupport/", in Matlab. If you don't have access to Matlab, Octave will work, or should be possible to reproduce this viewer in another language by examining the code and translating it as appropriate.
-
Run the viewer to visualize the model behaviour.
-
Summary:
cd ../Model
make
./program
cd ../MatlabSupport
matlab WormView.m -
WormView has the option of exporting all of the frames of your simulation as jpg files (in order to stitch them together to make a video), but it requires the export_fig package available here: (https://www.mathworks.com/matlabcentral/fileexchange/23629-export-fig).