Skip to content

Feature extended asym div#385

Open
drbergman wants to merge 6 commits intoMathCancer:developmentfrom
drbergman:feature-extended-asym-div
Open

Feature extended asym div#385
drbergman wants to merge 6 commits intoMathCancer:developmentfrom
drbergman:feature-extended-asym-div

Conversation

@drbergman
Copy link
Collaborator

extended asym div that allows for any combo of cell types for both daughter cells. Thank you @davidlzhou for contributing!

See the new sample project for how to use.

Config

<cycle code="5" name="live">
  <phase_transition_rates units="1/min">
    <rate start_index="0" end_index="0" fixed_duration="true">0.005</rate>
  </phase_transition_rates>
  <extended_asymmetric_division enabled="True">
    <extended_asymmetric_division_probability name1="type0" name2="type0" units="dimensionless">1.0</extended_asymmetric_division_probability>
  </extended_asymmetric_division>
</cycle>

Note: Order of name1 and name2 attributes does not matter. A hash map on unordered pairs of integers is used to get/set the relevant probabilities.

Behaviors

extended asymmetric division to <type1> and <type2>

Note: Order does not matter. A hash map on unordered pairs of integers is used to get/set the relevant probabilities.

drbergman and others added 6 commits January 15, 2025 13:41
- Thanks @davidlzhou for development and testing!!
- subsumes standard asymmetric division
    - old syntax still works: "asymmetric division to <cell_type>"
    - note: this syntax relies implicitly on the cell type the rule is being assigned to
    - hence, we need to an int to index these distinctly from the extended asym div rules
    - but they will still access the new extended asym div hash maps to get/set probabilities
- uses pairs of ints (cell types) as keys into hash map for asym div probabilities
- behaviors implemented
    - "extended asymmetric division to <cell_type_1> and <cell_type_2>"
- sample project added: `make extended-asym-div-sample`
- get and set functions for safe access to asymmetric_division_probabilities
    - asymmetric_division_probability functions to give robust getter access
    - set_asymmetric_division_probability functions to provide safe setter access
- reorganize so asym div functionality is inside phenotype.cpp and standard_models.cpp
- simplify write with new getters
@drbergman
Copy link
Collaborator Author

drbergman commented Feb 11, 2026

Note, when merging into dev, this block will be needed to make the resume addition work in multicell ds:

        if (create_cells)
		{
			pCell->phenotype.cycle.asymmetric_division.asymmetric_division_probabilities.clear();
			pCell->phenotype.cycle.asymmetric_division.asymmetric_division_probabilities.reserve(n_cell_types * (n_cell_types + 1) / 2);
		}
		for ( int i1 = 0; i1 < n_cell_types; i1++ )
		{
			for ( int i2 = i1; i2 < n_cell_types; i2++ )
			{
				fread(&dTemp, sizeof(double), 1, fp);
				if (debug_print)
				{ std::cout << " phenotype.cycle.asymmetric_division.set_asymmetric_division_probability(" << i1 << "," << i2 << ", " << dTemp << ")" << std::endl; }
				if (create_cells)
				{ pCell->phenotype.cycle.asymmetric_division.set_asymmetric_division_probability(i1, i2, dTemp); }
			}
		}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants