Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
School_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
encinass1u
School_project
Commits
f8eb0d30
Commit
f8eb0d30
authored
3 years ago
by
encinass1u
Browse files
Options
Downloads
Patches
Plain Diff
Replace single_cell_prolif_migr.py
parent
be76dae2
No related branches found
No related tags found
1 merge request
!2
Update README.md
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cell_behavior_initial_steps/single_cell_prolif_migr.py
+20
-17
20 additions, 17 deletions
Cell_behavior_initial_steps/single_cell_prolif_migr.py
with
20 additions
and
17 deletions
Cell_behavior_initial_steps/single_cell_prolif_migr.py
+
20
−
17
View file @
f8eb0d30
...
@@ -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
<=
1
5
:
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
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment