An agent-based framework for the simulation of biological cell systems and more.
Project description
https://saythanks.io/inbox#badge-modal
An agent-based framework for the simulation of biological cell systems (although it could conceivably do more).
This was created to simulate cancer growth, taking into account nutrients and cell migration while allowing to couple mutations and ancestry logging to study tumour phylogeny reconstruction algorithms.
Example
A use case integrated in the repository:
from cellsystem import *
# The cell system will simulate cell growth
# while tracking the steps in that process.
system = CellSystem(grid_dimensions=(10, 10))
# Initialize the first cell
# in the middle of the grid
system.seed()
New cell 0 added @ (5, 5)
# Take 35 steps forward in time
system.run(steps=30)
Cell no. 0 dividing @ (5, 5) New cells: 2 @ (4, 5) and 1 @ (6, 6) Cell no. 2 mutating @ site (4, 5) (father 0) Initial mutations: [] Initial genome: AAAAAAAAAA Final mutations: [(3, 'C')] Final genome: AAACAAAAAA Cell no. 1 dividing @ (6, 6) New cells: 4 @ (6, 6) and 3 @ (5, 6) Cell no. 2 death @ site (4, 5) (father 0) Cell no. 3 migrating from site (5, 6) (father 1) New site: (4, 5) Cell no. 4 death @ site (6, 6) (father 1) Cell no. 3 dividing @ (4, 5) New cells: 6 @ (3, 6) and 5 @ (3, 5) ... ... ...
# Prepare to explore the simulation logs
history = system['log']
# First, let's see the cells' evolution in time and space!
history.geometry().show()
# Remove the cells that died somewhere along the way
history.geometry(prune_death=True).show()
# Prepare styling for the trees
tree_style = {'show_leaf_name' : True,
'mode' : 'c', # Circular tree
'arc_start' : -135, # Degrees
'arc_span' : 270 } # Degrees also
# Lookup the tree formed by cellular division
history.ancestry().show(styling=tree_style)
# Now, remove cells that are no longer alive
history.ancestry(prune_death=True).show(styling=tree_style)
# Now, check out the tree formed by the mutations
history.mutations().show(styling=tree_style)
# Remove genomes with no living representatives.
history.mutations(prune_death=True).show(styling=tree_style)
For more examples and usage, please refer to the [Wiki](wikigoeshere.com).
Meta
Ad115 – @Andresio115 – a.garcia230395@gmail.com
Distributed under the MIT license. See LICENSE for more information.
Contributing
Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
Fork the repository on GitHub to start making your changes to a feature branch, derived from the master branch.
Write a test which shows that the bug was fixed or that the feature works as expected.
Send a pull request and bug the maintainer until it gets merged and published.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cellsystem-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b210dacdad620a75288206d20a5e204c3a0412b5837bb5e5592823a198b0d602 |
|
MD5 | e56bb9cc64c82796972ea267e5391449 |
|
BLAKE2b-256 | 1166ee6b9cf8d6d3843d6f24dcd60c7378d797068b80fe13ad31fd4df3339055 |