MCellR lets you leverage the power of bionetgen's rule based modeling within the reaction-diffusion simulator MCell.
Using mdlr2mdl.py, you can convert MDLR files into MDL files. MDLR is similar to MDL except it has bionetgen-style syntax for portions of the molecule definitions, reactions, releases, and reaction data. After creating the MDL files using mdlr2mdl.py, the simulation should be run using a special feature branch of MCell (nfsim_diffusion). As the simulation runs, MCell will call the NFsim library as needed in order to find reaction partners.
- In build folder, run
python requirements.py
. This file will download and compile, bionetgen, nfsim, nfsimCinterface, and MCell. (May need troubleshooting) - Create a file called mcellr.yaml in the mcellRules directory.
- Set the path to bionetgen, which should be ./mcellRules/build/bionetgen/bng2/BNG2.pl.
- Set the "libpath" which should be in ./mcellRules/build/mcell/lib if you ran requirements.py.
- Look at mcellr.yaml.template for a reference.
- Run the following command:
python mdlr2mdl.py -ni ./fceri_files/fceri.mdlr -o ./fceri_files/fceri_mdl
(use Python 2, not 3, for this part). - This will create the following files within the fceri_files
directory:
- fceri.mdlr.xml
- fceri.mdlr_total.xml
- fceri_mdl.seed.mdl
- tfceri_mdl.reactions.mdl
- fceri_mdl.output.mdl
- fceri_mdl.molecules.mdl
- fceri_mdl.main.mdl
- Now use the following command to run newly created mdl file:
./build/mcell/build/mcell ./fceri_files/fceri_mdl.main.mdl -n ./fceri_files/fceri.mdlr_total.xml
- This will create the following output files in the main mcellRules directory:
- fceri.mdlr_total.xml.gdat
- fceri.mdlr_total.xml_reactions.gdat
For a general overview of MDL, please see the quick reference guide.
MDLR is an extension of MDL using bionetgen style syntax. All of the MDL blocks (e.g. DEFINE_MOLECULE, DEFINE_REACTIONS, etc) are prefaced with a pound sign like this:
#DEFINE_MOLECULES {
..
}
#DEFINE_REACTIONS {
..
}
For molecules, the names are treated like bionetgen molecules like
Syk(tSH2,lYpY,aYpY) in the following example:
#DEFINE_MOLECULES
{
Syk(tSH2,l~Y~pY,a~Y~pY)
{
DIFFUSION_CONSTANT_3D = 8.51e-7
}
}
This example shows a molecule named Syk with three different components (tSH2, l, and a). Two of the components (l and a) each have two different states (Y and pY).