一种基于agent的生物细胞系统仿真框架等。
cellsystem的Python项目详细描述
一种基于agent的生物细胞系统仿真框架。
这是为了模拟癌症的生长,考虑到营养和细胞迁移,同时允许跟踪突变、细胞分裂和细胞位置历史,以研究肿瘤系统发育重建算法。
安装
您可以从pypi安装它:
$ pip install cellsystem
示例
存储库中集成的用例:
>>>fromcellsystemimport*# The cell system will simulate cell growth# while tracking the steps in that process.>>>system=CellSystem(grid_shape=(100,100))# Initialize the first cell# in the middle of the grid>>>system.seed()Newcell0added@(50,50)# Take 35 steps forward in time>>>system.run(steps=30)Cellno.0mutating@site(50,50)(fatherNone)Initialmutations:[]Initialgenome:AAAAAAAAAAFinalmutations:[(4,'G')]Finalgenome:AAAAGAAAAACellno.0dividing@(50,50)Newcells:1@(49,50)and2@(50,51)Cellno.2dividing@(50,51)Newcells:3@(51,52)and4@(51,52)Cellno.4mutating@site(51,52)(father2)Initialmutations:[(4,'G')]Initialgenome:AAAAGAAAAAFinalmutations:[(4,'G'),(7,'A')]Finalgenome:AAAAGAAAAACellno.1death@site(49,50)(fatherNone)Cellno.3death@site(51,52)(father2)Cellno.4mutating@site(51,52)(father2)Initialmutations:[(4,'G'),(7,'A')]Initialgenome:AAAAGAAAAAFinalmutations:[(4,'G'),(7,'A'),(2,'T')]Finalgenome:AATAGAAAAACellno.4migratingfromsite(51,52)(father2)Newsite:(50,52).........# Prepare to explore the simulation logs>>>history=system['log']# First, let's see the cells' evolution in time and space!>>>history.worldlines().show()# Remove the cells that died somewhere along the way>>>history.worldlines(prune_death=True).show()
>>>tree_style={'show_leaf_name':True,...'mode':'c',# Circular...'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)
几乎模拟的每个方面都是可定制的。你可以添加几种不同类型的相互作用的细胞系, 另外,具有不同几何形状和扩散的世界,具有其他可记录特征的细胞, 其他种类的原木。改变每个细胞的死亡率、移动速度等,甚至增加新的细胞行为!
目前,用于这样做的文档分散在类文档字符串中,但是一个好的开始是 通过监视cellsystem.CellSystem类的源。
贡献
- 检查打开的问题或打开一个新的问题,开始围绕功能想法或错误的讨论。
- forkthe repository在github上,开始对从master分支派生的功能分支进行更改。
- 编写一个测试,显示错误已修复或功能按预期工作。
- 发送一个pull请求并对维护程序进行bug操作,直到它被合并并发布。