Skip to content

Commit c24df44

Browse files
lysis location logging, proliferative antigen tracking, matrigel non-migration option
1 parent 03556f8 commit c24df44

8 files changed

+46
-5
lines changed

src/arcade/patch/agent/cell/PatchCellCART.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,14 @@ private double calculateMichaelisMenten(
380380
int startReceptors,
381381
double alpha,
382382
double beta) {
383+
384+
double correctedStartReceptors = startReceptors;
385+
386+
if (startReceptors == 0) {
387+
correctedStartReceptors = 1;
388+
}
383389
return (targets * contactFraction / (affinity * beta + targets * contactFraction))
384-
* (currentReceptors / startReceptors)
390+
* (currentReceptors / correctedStartReceptors)
385391
* alpha;
386392
}
387393

src/arcade/patch/agent/cell/PatchCellCARTCombined.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public PatchCellContainer make(int newID, CellState newState, MersenneTwisterFas
6060
public void step(SimState simstate) {
6161
Simulation sim = (Simulation) simstate;
6262

63+
if (sim.getSchedule().getTime() == 2880) {
64+
int a = 0;
65+
}
66+
6367
super.age++;
6468

6569
if (state != State.APOPTOTIC && age > apoptosisAge) {

src/arcade/patch/agent/cell/PatchCellCARTCombinedCombinatorial.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,17 @@ protected void checkForBinding(SimState simstate) {
120120
* @param sim the simulation instance
121121
*/
122122
protected void calculateCARS(MersenneTwisterFast random, Simulation sim) {
123+
// T cell cannot bind if no synnotch receptors are available
124+
if (synnotchs == 0) {
125+
if (boundSynNotch != 0) {
126+
boundSynNotch = 0;
127+
}
128+
return;
129+
}
130+
131+
// unbound synnotch should never be negative
123132
int unboundSynNotch = synnotchs - boundSynNotch;
133+
unboundSynNotch = Math.max(0, unboundSynNotch);
124134

125135
double expectedBindingEvents =
126136
bindingConstant
@@ -130,14 +140,26 @@ protected void calculateCARS(MersenneTwisterFast random, Simulation sim) {
130140
* contactFraction
131141
* TAU;
132142

143+
// binding events should not exceed available unbound receptors
144+
expectedBindingEvents = Math.min(expectedBindingEvents, unboundSynNotch);
145+
133146
int bindingEvents = poissonFactory.createPoisson(expectedBindingEvents, random).nextInt();
134147
double expectedUnbindingEvents = unbindingConstant * boundSynNotch * TAU;
148+
149+
expectedUnbindingEvents = Math.min(expectedUnbindingEvents, boundSynNotch);
150+
151+
// unbinding events should not exceed available bound receptors
135152
int unbindingEvents =
136153
poissonFactory.createPoisson(expectedUnbindingEvents, random).nextInt();
137154

138155
boundSynNotch += bindingEvents;
139156
boundSynNotch -= unbindingEvents;
157+
158+
// bound synnotch should never be negative
159+
boundSynNotch = Math.max(0, boundSynNotch);
140160
boundCell.updateSynNotchAntigens(unbindingEvents, bindingEvents);
161+
162+
// synnotch receptors become unavailable after binding
141163
synnotchs = Math.max(0, synnotchs - bindingEvents);
142164
}
143165

src/arcade/patch/agent/cell/PatchCellCARTCombinedInducible.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected void calculateCARS(MersenneTwisterFast random, Simulation sim) {
9696

9797
/** Calculates the number of cars produced for synnotch circuit. * */
9898
protected void synNotchCARCalculation() {
99-
double n = 8;
99+
double n = 4.4;
100100
int newCars =
101101
(int) (maxCars / (1 + Math.pow(synNotchThreshold, n) / Math.pow(boundSynNotch, n)));
102102
cars = Math.max((int) (cars - (carDegradationConstant * cars * TAU)), newCars);

src/arcade/patch/agent/cell/PatchCellCARTCombinedInhibitory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected void calculateCARS(MersenneTwisterFast random, Simulation sim) {
9090

9191
/** Calculates the number of cars produced for receptor circuit. * */
9292
protected void receptorCars() {
93-
double n = 8;
93+
double n = 4.4;
9494
int removeCARs =
9595
(int) (maxCars / (1 + Math.pow(boundSynNotch, n) / Math.pow(synNotchThreshold, n)));
9696
cars = Math.min(cars + (int) (basalCARGenerationRate * TAU), removeCARs);

src/arcade/patch/agent/module/PatchModuleCytotoxicity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import arcade.patch.agent.cell.PatchCellCART;
1010
import arcade.patch.agent.cell.PatchCellTissue;
1111
import arcade.patch.agent.process.PatchProcessInflammation;
12+
import arcade.patch.env.location.PatchLocation;
1213
import arcade.patch.sim.PatchSimulation;
1314
import arcade.patch.util.PatchEnums.Domain;
1415
import arcade.patch.util.PatchEnums.State;
@@ -82,6 +83,8 @@ public void step(MersenneTwisterFast random, Simulation sim) {
8283
eventData.put("tissue-cell-type", target.getPop());
8384
eventData.put("type", "lysis");
8485
eventData.put("timestamp", (int) ((PatchSimulation) sim).getSchedule().getTime());
86+
eventData.put(
87+
"tissue-location", ((PatchLocation) target.getLocation()).getCoordinate());
8588
patchSim.logEvent(eventData);
8689
}
8790
}

src/arcade/patch/agent/module/PatchModuleMigration.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,17 @@ public class PatchModuleMigration extends PatchModule {
2525
/** Time required for cell migration [min]. */
2626
private final double movementDuration;
2727

28+
/** Boolean indicating if cell is on a matrigel. */
29+
private final double matrigel;
30+
2831
/**
2932
* Creates a migration {@link PatchModule} for the given cell.
3033
*
3134
* <p>Loaded parameters include:
3235
*
3336
* <ul>
3437
* <li>{@code MIGRATION_RATE} = cell migration rate
38+
* <li>{@code MATRIGEL} = boolean indicating if cell is on a matrigel
3539
* </ul>
3640
*
3741
* @param cell the {@link PatchCell} the module is associated with
@@ -42,14 +46,15 @@ public PatchModuleMigration(PatchCell cell) {
4246
// Set loaded parameters.
4347
Parameters parameters = cell.getParameters();
4448
migrationRate = parameters.getDouble("migration/MIGRATION_RATE");
49+
matrigel = parameters.getDouble("migration/MATRIGEL");
4550
movementDuration = Math.round(location.getCoordinateSize() / migrationRate);
4651
}
4752

4853
@Override
4954
public void step(MersenneTwisterFast random, Simulation sim) {
5055
if (ticker > movementDuration) {
5156
PatchLocation newLocation = cell.selectBestLocation(sim, random);
52-
if (newLocation == null) {
57+
if (matrigel > 0 || newLocation == null) {
5358
if (cell instanceof PatchCellCART) {
5459
cell.setState(State.PAUSED);
5560
} else {

src/arcade/patch/parameter.patch.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<population id="BOUND_TIME" value="360" description="6 hours" />
4747

4848
<!-- SynNotch specific parameters -->
49-
<population id="SYNNOTCH_THRESHOLD" value="0.1" description="number threshold of total synnotch" />
49+
<population id="SYNNOTCH_THRESHOLD" value="0.01" description="number threshold of total synnotch" />
5050
<population id="K_SYNNOTCH_ON" value="5.1E3" unit="Ms^-1" description="binding kinetic constant" />
5151
<population id="K_SYNNOTCH_OFF" value="9E-5" unit="s^-1" description="unbinding kinetic constant" />
5252
<population id="HILL_SYNNOTCH" value="4.4" description="hill coefficient for synnotch to CAR relationship" />
@@ -59,6 +59,7 @@
5959

6060
<!-- migration module parameters -->
6161
<population.module module="migration" id="MIGRATION_RATE" value="0.24" unit="um/min" description="cell migration rate" />
62+
<population.module module="migration" id="MATRIGEL" value="0" description="boolean indicating if cell is on a matrigel" />
6263

6364
<!-- apoptosis module parameters -->
6465
<population.module module="apoptosis" id="DEATH_DURATION" value="1080" unit="min" description="time required for cell death" />

0 commit comments

Comments
 (0)