bagherilab / CARCADE

CAR T-cell ARCADE Biological Modeling Framework
GNU General Public License v3.0
2 stars 0 forks source link

Agent-based model of CAR T-cell therapies in dish and tissue contexts

Code structure overview

carcade.jar is a compiled jar of the model, with the required library MASON and other libraries (listed below) included.

The src/ directory contains all source files for the model.

The docs/ directory contains class documentation (javadoc), sample input XML files (sample_input), and sample output JSON files (sample_output). The documentation can be viewed in a web browser at https://bagherilab.github.io/CARCADE/javadoc/index.html. There is also a README file in the docs/ directory with more details on the sample input and output files.

Building from source

The model can be built from source. The following libraries are required:

Running the model

The model can be run either command line or GUI (which can use a 2D rendering).

When using command line, first navigate to the directory holding this file. Then:

java arcade.Main XML [(--vis)] [(-v|--view) VIEW]

    XML
        Path to .xml setup file
    [(--vis)]
        Flag for running with GUI
    [(-v|--view) VIEW]
        Selects the GUI view: 2D (default).

For example, to run the model with setup file setup.xml in GUI mode with a 2D view:

java arcade.Main setup.xml --vis --view 2D

Note that running the model with visualization (either directly from the arcade.jar or using the --vis flag) is significantly slower than without visualization.

You can run also the model from a .jar using the carcade.jar file. For example, running the simulation with setup file setup.xml, without a GUI, and using the .jar file:

$ java -jar carcade.jar setup.xml

Setup file structure

The model uses an .xml file that describes the setup of the simulations, agents, and environments. Attributes in brackets ([]) are optional. Values in ALL CAPS should be replaced with actual values. The basic structure of the file is:

<set prefix="PREFIX" path="PATH">
    <series name="NAME" start="START" end="END" days="DAYS">
        <simulation type="TYPE" radius="RADIUS" height="HEIGHT" margin="MARGIN">
            <!-- SIMULATION TAGS HERE -->
        </simulation>
        <agents initialization="INIT" plate="PLATE">
            <!-- AGENTS TAGS HERE -->
        </agents>
        <environment coordinate="COORD">
            <!-- ENVIRONMENT TAGS HERE-->
        </environment>
    </series>
    ...
</set>

A group of simulations series is called a set. The setup XML can only include one set.

A simulation series is a group of simulations that only differ in the random seed. Each <series> includes <simulation>, <agents>, and <environment> tags that define various parts of the series. A set can include multiple <series> tags.

The simulation tag describes the size and type of the simulation. Nested tags include various profilers and checkpointing for the simulation.

The agents tag describes the agents initialization and type of plating. Nested tags include definitions of the various cell populations to include (as well as cell modules and/or population parameters) and any helpers.

The environment tag describes the coordinate system of the environment. Nested tags include environment parameters and components.

<simulation> tags

<profilers>

Profilers save the simulation state to .json files at the selected interval. Different profilers will save different types of information. These are not used when the model is run as a GUI.

<profilers>
    <profiler type="growth" interval="INTERVAL" suffix="SUFFIX" />
    <profiler type="parameter" interval="INTERVAL" suffix="SUFFIX" />
    <profiler type="graph" interval="INTERVAL" suffix="SUFFIX" />
    <profiler type="lysis" interval="INTERVAL" suffix="SUFFIX" />
    ...
</profilers>

<checkpoints>

Checkpoints save certain parts of the simulation to a .checkpoint file, which can later be loaded. These are included when the model is run as a GUI, although the seed may not match. They can either be class SAVE or LOAD, depending on if the checkpoint is being saved from or loaded to the simulation.

<checkpoints>
    <checkpoint type="cells" class="CLASS" name="NAME" path="PATH" day="DAY" />
    <checkpoint type="graph" class="CLASS" name="NAME" path="PATH" day="DAY" />
    ...
</checkpoints>

<agents> tags

<populations>

Populations define the cell populations included in the simulation. Within each population, you can also optionally define variables and modules.

<populations>
    <population type="TYPE" fraction="FRACTION">
        <variables>
            <variable id="PARAMETER_NAME" value="VALUE" scale="SCALE" />
            ...
        </variables>
        <modules>
            <module type="TYPE" complexity="COMPLEXITY" />
            ...
        </modules>
    </population>
    ...
</populations>

The population tag describes the type and fraction of a cell population included in the model.

The variable tag lists parameters for the population that are either set to a new value or scaled from the default value. Unless modified, default values are used for all cell parameters. Either or both value and scale attributes can be applied, with value applied first.

The module tag lists the tissue cell modules. When undefined, complex metabolism and complex signaling are used by default. CAR T-cell agents do not need specified modules, as they use default metabolism modules for CAR T-cell agents and subtype-specific inflammation modules for CAR T-cell agents.

<helpers>

Helpers define the various helper agents included in the simulation. Depending on the type, different attributes are required.

<helpers>
    <helper type="convert" delay="DELAY" population="POPULATION" />
    <helper type="insert" delay="DELAY" populations="POPULATIONS" bounds="BOUNDS"/>
    <helper type="wound" delay="DELAY" bound="BOUNDS" />
    <helper type="treat" delay="DELAY" dose="DOSE" ratio="RATIO" />
    ...
<helpers>

<environment> tags

<globals>

Globals define environment parameters that are changed, analogous to the population-specific variables. Note that some global parameters may only apply to certain components. Unless modified, default values are used for global parameters. Either or both value and scale attributes can be applied, with value applied first.

<globals>
    <global id="PARAMETER_NAME" value="VALUE" scale="SCALE" />
    ...
<globals>

<components>

Components define various components included in the simulation. Depending on the type, different attributes are required. At least one sites type component must be specified.

<components>
    <component type="sites" class="source" x="X" y="Y" z="Z" />
    <component type="sites" class="pattern" />
    <component type="sites" class="graph" layout="LAYOUT"
        left="LEFT" right="RIGHT" top="TOP" bottom="BOTTOM" />
    ...
<components>