Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,962 changes: 817 additions & 1,145 deletions Manifest.toml

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name = "CellBasedModels"
uuid = "388cb286-f2b1-4654-a3bb-2e137a39c658"
authors = ["Gabriel Torregrosa Cortés"]
version = "0.1.0"
version = "0.1.1"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Expand All @@ -22,19 +21,17 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
julia = "1.8"
CSV = "0.10, 1"
CUDA = "4"
CUDA = "4, 5"
DataFrames = "1, 2"
DifferentialEquations = "7"
Distributions = "0.25, 1"
GLMakie = "0.8"
GeometryBasics = "0.4"
JLD2 = "0.4, 1"
MacroTools = "0.5"
OrderedCollections = "1"
ProgressMeter = "1.7"
SpecialFunctions = "2"
julia = "1.8"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
29 changes: 21 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,60 @@

The dockerfile makes an image that contains a set of relevant packages for the use with CellBasedModels. A list can be seen in `environment.yaml`.

Constructed images are already deposited in [dsblab/cellbasedmodels](https://hub.docker.com/repository/docker/dsblab/cellbasedmodels), so there is not need of building the image except if you want to extend further capabilities.
Constructed images are already deposited in [https://hub.docker.com/r/dsblab/cellbasedmodels](https://hub.docker.com/r/dsblab/cellbasedmodels), so there is not need of building the image except if you want to extend further capabilities.

# Running the image

> **NOTE Multithreading**
> Docker images are by default exposed to all the threads but you have to provide the number of threads to the execution yu have to define the variable `JULIA_NUM_THREADS` inside the docker as shown in the examples below. More information can be seen in the [documentation](https://docs.julialang.org/en/v1/manual/multi-threading/).


## Interactive Shell

Start the container in interactive format.

```shell
docker run -it \
docker run -it --rm \
--mount type=bind,source="$(pwd)",target=/home \
dsblab/cellbasedmodels:v0.1.0 julia
dsblab/cellbasedmodels:v0.1.0 julia --threads 4
```

## Script

To execute directly a bash script simply

```shell
docker run \
docker run --rm \
--mount type=bind,source="$(pwd)",target=/home \
dsblab/cellbasedmodels:v0.1.0 /bin/bash -c "<bash_script.sh>"
```

and a julia script

```shell
docker run \
docker run --rm \
--mount type=bind,source="$(pwd)",target=/home \
dsblab/cellbasedmodels:v0.1.0 /bin/bash -c "julia <julia_script.py>"
dsblab/cellbasedmodels:v0.1.0 /bin/bash -c "export JULIA_NUM_THREADS=4; julia <julia_script.py>"
```

## Jupyter lab

If you want to work interactively with a jupyter notebook.

```shell
docker run -it \
docker run -it --rm \
-p 8888:8888 \
--mount type=bind,source="$(pwd)",target=/home \
dsblab/cellbasedmodels:v0.1.0
dsblab/cellbasedmodels:v0.1.0 /bin/bash -c "export JULIA_NUM_THREADS=4; jupyter lab --allow-root --ip 0.0.0.0"
```

# Comments on docker flags

There are many flags for dockers. In here I briefly resume some of the ones used in the examples above.

- `-it`: Says the docker you are going to use it in interactive mode.
- `--rm`: Remove the image once finished the job.
- `-p`: Which port to show the connection
- `-mount type=X,...`: Mount the folder so its content is accessible inside the docker.

You can then view the Jupyter Notebook by opening `http://localhost:8888` in your browser, or `http://<DOCKER-MACHINE-IP>:8888` if you are using a Docker.
2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

version=v0.1.0

# docker build . -t dsblab/cellbasedmodels:$version
docker build . -t dsblab/cellbasedmodels:$version
docker push dsblab/cellbasedmodels:$version
10 changes: 9 additions & 1 deletion docker/install.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ using Pkg

packages = [
"IJulia",
"CellBasedModels",
"CSV",
"DataFrames",
"Plots",
Expand All @@ -17,4 +16,13 @@ packages = [
for package in packages
Pkg.add(package)
eval(string("using ",package))
end

packages = [
("CellBasedModels","develop"),
]

for (package, version) in packages
Pkg.add(Pkg.PackageSpec(name=package; rev=version))
eval(string("using ",package))
end
2 changes: 1 addition & 1 deletion docs/src/Usage_Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ Once defined the rules, you can define specific algorithms for the computation o
- `platform` argument to define the type of platform in which you want to evolve the model.
- `agentAlg`, `modelAlg` and `mediumAlg` to define the integrator that you want to use. You can use our own integrators provided in the submodule `CBMIntegrators` that may be faster in general but in complex cases with stiff operation or in which you need high precission, you can always use the integrators from `DifferentialEquations.jl` suite.
- `agentSolveArgs`, `modelSolveArgs` and `mediumSolveArgs` to define additional arguments required by the integrators to work. This arguments are the ones present when definind a problem in `DifferentialEquations.jl`.
- `neighbors` algorithm. This defines the way of computing neighbors. This step is one of the most cost expensive in ABMs and the correct selection of algorithm can really afect your computational efficientcy. We provide several possible algorithms in the submodule `CBMNeighbors`.
- `neighborsAlg` algorithm. This defines the way of computing neighbors. This step is one of the most cost expensive in ABMs and the correct selection of algorithm can really afect your computational efficientcy. We provide several possible algorithms in the submodule `CBMNeighbors`.

You should have seen some of this arguments declared in the code above.

Expand Down
2 changes: 2 additions & 0 deletions docs/src/Usage_Community.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ Once we have defined a model and constructed an initial community, we can evolve

In the following schema we describe the basic collection of functions provided by the package to evolve the model, where some functions perform automatically all the step that are described on the right.

```@raw html
<table>
<thead>
<th colspan=3> Functions </th>
Expand Down Expand Up @@ -293,6 +294,7 @@ In the following schema we describe the basic collection of functions provided b
</tr>
</tbody>
</table>
```

Depending on the control that the user wants to have on the call of the evolution functions, they can decide to use one of the three column schemas proposed above.

Expand Down
Binary file removed docs/src/assets/Development.gif
Binary file not shown.
Binary file removed docs/src/assets/development.gif
Binary file not shown.
228 changes: 202 additions & 26 deletions examples/Aggregation.ipynb

Large diffs are not rendered by default.

3,229 changes: 2,162 additions & 1,067 deletions examples/Bacteries.ipynb

Large diffs are not rendered by default.

186 changes: 186 additions & 0 deletions examples/CellSorting.ipynb

Large diffs are not rendered by default.

137 changes: 122 additions & 15 deletions examples/Development.ipynb

Large diffs are not rendered by default.

534 changes: 534 additions & 0 deletions examples/Implementation.ipynb

Large diffs are not rendered by default.

Loading
Loading