Skip to content
Snippets Groups Projects
Commit f8eb0d30 authored by encinass1u's avatar encinass1u
Browse files

Replace single_cell_prolif_migr.py

parent be76dae2
No related branches found
No related tags found
1 merge request!2Update README.md
...@@ -8,7 +8,7 @@ import random ...@@ -8,7 +8,7 @@ import random
from scipy import ndimage from scipy import ndimage
from bio2mslib.inout.inout import WriteData as WD from bio2mslib.inout.inout import WriteData as WD
import os import os
from Gts_selection import L, Lx, Ly from Gts_selection import L
from bio2mslib.analysis.models import CellModels as DM from bio2mslib.analysis.models import CellModels as DM
from matplotlib.pyplot import figure from matplotlib.pyplot import figure
...@@ -21,18 +21,20 @@ if os.path.isdir(path_simulation) == False : ...@@ -21,18 +21,20 @@ if os.path.isdir(path_simulation) == False :
os.mkdir(path_simulation) os.mkdir(path_simulation)
#Reopening choosen surface #Reopening choosen surface
with open('Gts_Sample_100.cvs', 'rb') as csv_file: with open('Gts_Sample.cvs', 'rb') as csv_file:
Gts = pickle.load(csv_file) Gts = pickle.load(csv_file)
# #Visual preentation in image of the matrix
# im1 = plt.imshow(Gts, cmap="bone")
# plt.show()
#Gs is ground seeded, a copy of the choosen surface to seed the cells, #Gs is ground seeded, a copy of the choosen surface to seed the cells,
Gs = copy.deepcopy(Gts) Gs = copy.deepcopy(Gts)
#uni_cell is the seeding of a single cell inside the treated surface. #uni_cell is the seeding of a single cell inside the treated surface.
uni_cell = Gs[(86,8)] uni_cell = Gs[(8,8)]
Gs[(86,8)] = 1 Gs[(8,8)] = 1.5
plt.title("Gts, Inital seeding",
size=20)
#images of the cell in the surface
couture= plt.imshow(Gs, cmap="bone")
plt.show()
#Variable deffinition for PDE proliferation & migration model #Variable deffinition for PDE proliferation & migration model
Cd = 1*10**-5 #Cell density Cd = 1*10**-5 #Cell density
...@@ -48,20 +50,21 @@ time_lapse = 0.1 ...@@ -48,20 +50,21 @@ time_lapse = 0.1
Gscopy = copy.deepcopy(Gs) Gscopy = copy.deepcopy(Gs)
Laplace = ndimage.laplace(Gs) Laplace = ndimage.laplace(Gs)
#Migration #Migration
iter = 0 iter = 1
while iter<= 15: while iter<= 5:
for mi in range(1, len(Lx)-1): for mi in range(1, L-1):
for mj in range(1, len(Ly)-1): for mj in range(1, L-1):
x = random.randint(-1,1)#horizontal value for the movement of the cell x = random.randint(-1,1)#horizontal value for the movement of the cell
y = random.randint(-1,1)#vertival value for the movement of the cell y = random.randint(-1,1)#vertival value for the movement of the cell
if Gs[mi,mj]==1 and (x != 0 or y!= 0) and ((mi+x)<len(Lx)) and ((mj+y)< len(Ly)): if Gs[mi,mj]==1.5 and (x != 0 or y!= 0) and ((mi+x)<L) and ((mj+y)< L):
Gs[mi+x,mj+y]= 1 Gs[mi+x,mj+y]= 1.5
Gs[mi,mj]=0 Gs[mi,mj]+=0
#Proliferation after migration #Proliferation after migration
Gs[mi,mj] = Gscopy[mi,mj] + dt*Dm*Laplace[mi,mj]*(1-(Gscopy[mi,mj]/Cdmax))+CRgrw*1*Gscopy[mi,mj]*(1-(Gscopy[mi,mj]/Cdmax)) Gs[mi,mj] = Gscopy[mi,mj] + dt*Dm*Laplace[mi,mj]*(1-(Gscopy[mi,mj]/Cdmax))+CRgrw*1*Gscopy[mi,mj]*(1-(Gscopy[mi,mj]/Cdmax))
if Gs[mi,mj]>0 and Gs[mi,mj]!=0.7 and Gs[mi,mj]!=0.5 : if Gs[mi,mj]>0 and Gs[mi,mj]!=1 :
Gs[mi,mj]=1 Gs[mi,mj]=1.5
zoom = True plt.title('Cell migration & proliferation '+str(iter),
size=20)
im2 = plt.imshow(Gs, cmap="bone", norm = None) im2 = plt.imshow(Gs, cmap="bone", norm = None)
plt.show() plt.show()
name = 'Single_cell_SMAT_sample'+str(iter)+'.png' name = 'Single_cell_SMAT_sample'+str(iter)+'.png'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment