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
Merge requests
!2
Update README.md
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Update README.md
Student
into
main
Overview
0
Commits
51
Pipelines
0
Changes
1
Merged
encinass1u
requested to merge
Student
into
main
3 years ago
Overview
0
Commits
51
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
f8eb0d30
Prev
Next
Show latest version
1 file
+
20
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
f8eb0d30
Replace single_cell_prolif_migr.py
· f8eb0d30
encinass1u
authored
3 years ago
Cell_behavior_initial_steps/single_cell_prolif_migr.py
+
20
−
17
Options
@@ -8,7 +8,7 @@ import random
from
scipy
import
ndimage
from
bio2mslib.inout.inout
import
WriteData
as
WD
import
os
from
Gts_selection
import
L
,
Lx
,
Ly
from
Gts_selection
import
L
from
bio2mslib.analysis.models
import
CellModels
as
DM
from
matplotlib.pyplot
import
figure
@@ -21,18 +21,20 @@ if os.path.isdir(path_simulation) == False :
os
.
mkdir
(
path_simulation
)
#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
)
# #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
=
copy
.
deepcopy
(
Gts
)
#uni_cell is the seeding of a single cell inside the treated surface.
uni_cell
=
Gs
[(
86
,
8
)]
Gs
[(
86
,
8
)]
=
1
uni_cell
=
Gs
[(
8
,
8
)]
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
Cd
=
1
*
10
**-
5
#Cell density
@@ -48,20 +50,21 @@ time_lapse = 0.1
Gscopy
=
copy
.
deepcopy
(
Gs
)
Laplace
=
ndimage
.
laplace
(
Gs
)
#Migration
iter
=
0
while
iter
<=
1
5
:
for
mi
in
range
(
1
,
len
(
Lx
)
-
1
):
for
mj
in
range
(
1
,
len
(
Ly
)
-
1
):
iter
=
1
while
iter
<=
5
:
for
mi
in
range
(
1
,
L
-
1
):
for
mj
in
range
(
1
,
L
-
1
):
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
if
Gs
[
mi
,
mj
]
==
1
and
(
x
!=
0
or
y
!=
0
)
and
((
mi
+
x
)
<
len
(
Lx
)
)
and
((
mj
+
y
)
<
len
(
Ly
)
):
Gs
[
mi
+
x
,
mj
+
y
]
=
1
Gs
[
mi
,
mj
]
=
0
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
.5
Gs
[
mi
,
mj
]
+
=
0
#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
))
if
Gs
[
mi
,
mj
]
>
0
and
Gs
[
mi
,
mj
]
!=
0.7
and
Gs
[
mi
,
mj
]
!=
0.5
:
Gs
[
mi
,
mj
]
=
1
zoom
=
True
if
Gs
[
mi
,
mj
]
>
0
and
Gs
[
mi
,
mj
]
!=
1
:
Gs
[
mi
,
mj
]
=
1.5
plt
.
title
(
'
Cell migration & proliferation
'
+
str
(
iter
),
size
=
20
)
im2
=
plt
.
imshow
(
Gs
,
cmap
=
"
bone
"
,
norm
=
None
)
plt
.
show
()
name
=
'
Single_cell_SMAT_sample
'
+
str
(
iter
)
+
'
.png
'
Loading