A cellular automaton featuring structural variants in cells.
- create the grid of cells.
- Colour every mutation with a random colour.
- Mutation probability sample from a distribution.
- Model cell data as n bases rather than genomic regions.
- Mutation on a 'x' number of bases chosen at random.
- Impl Distribution for SvState in order to randomly sample a Sv State for mutation.
- Colors as a function of the total state of the genome.
- Model 3 broad type of mutations as the 3 channels of colour { gain: red, loss: blue, inv: green}
- With every mutation, slowly decrease the corresponding channel by the difference over NATURAL_SELECTION and prop of genome affected till it reaches black
- Pause functionality.
- Local natural selection.
- Model germline mutations as border colour --> can be used to track lineages.
- Model somatic mutations as the fill colour --> to check heterogeneity.
- Model the entire grid as a tissue.
- Find nearby cells (6 nearby cells).
- Differing strength of natural selection as a function of selection strength of nearby cells.
- Show generation as a label somewhere.
- Each cell starts with no mutations.
- Each cell has a genome which is a flattened vector, where each bin is represented by n_sv times. The vector has 0 and 1s only.
- Cells cycle through at constant times.
- Some cells will randomly have lower natural selection threshold for the duration of one S phase. This is environmental perturbation and will start things off for mutations to snowball.
- Will make this interactive at later stages.
- At every G1 phase, it picks a neighbour number at random [0, 7].
- Boundary checking needs to be done for the cells at the boundary, which will have lower number of neighbours.
- Then it does a hamming distance calculation between that neighbour and itself. Implemented using XOR between the flattened vectors
- The hamming distance is converted to natural selection by (1 - dist). So the motivation is the cell is trying to be like one of its neighbours.
- Mutation probability is sampled from a beta distribution.
- A single bin ID is chosen at random. One bin mutation per S phase
- The bin is mutated with a SV type chosen at random.
- Mutation happens only when the bin is reference. If it is already mutated, nothing is done.