Skip to content

Commit 9bcc8b0

Browse files
authored
Refactoring and finishing touches (#59)
* Unify the inference session title in UI. * Unify naming of the inference session on the backend. * Add propagating var id change into properties. * Add note regarding web-based docs. * Refactoring + documenting main TypeScript components. * Fix issue in network sampling. * Add new version of the example sketch. * Update installation instruction. * Update older todos. * Add initial version of the manual. * Instructions, refactoring, selenium tests. * Update manual. * Reorganize data folder, add additional data files. * Add instructions for tauri on linux. * Add tutorial video. * Update project structure description.
1 parent 58fb0e3 commit 9bcc8b0

File tree

89 files changed

+1212
-437
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1212
-437
lines changed

README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,21 @@ Sketchbook presents a way to design all these components and more.
99

1010
Once you finish designing your sketch, you can run the state-of-the-art synthesis algorithms and symbolically compute all BNs consistent with your requirements. You can then sample individual BNs, or export the results for further analysis with libraries like [AEON.py](https://pypi.org/project/biodivine-aeon/).
1111

12-
### Citation
12+
#### Manual and tutorial
13+
14+
In the provided `manual.pdf`, we discuss the details regarding
15+
- installation,
16+
- editing BN sketches in Sketchbook,
17+
- running BN inference in Sketchbook,
18+
- format and syntax used.
19+
20+
We also provide an introduction to Sketchbook using a short video tutorial that you can find as `tutorial.mp4`.
21+
This tutorial covers basics on how to edit an sketch and run the inference.
22+
For more details and explanations, see the manual.
23+
24+
The installation is also summarized below, with an additional development guide.
25+
26+
#### Citation
1327

1428
If you used Sketchbook for some academic work, we'd be very happy if you could cite it using the following publication:
1529

@@ -33,12 +47,17 @@ Alternatively, if you want to build the tool locally, the instructions are provi
3347

3448
The following instructions describe the local installation of the application and relevant frameworks. We recommend using the pre-built binaries described in the previous section.
3549

36-
For a summary of all technologies and detailed project structure, see `project-docs/ARCHITECTURE.md`. The directory `project-docs` also contains other documents relevant to the design/development.
50+
For a summary of all technologies and detailed project structure, see `project-docs/architecture.md`. The directory `project-docs` also contains other documents relevant to the design/development.
51+
52+
We also provide web-based Rust documentation (including internal modules), currently hosted on [these GitHub pages](https://ondrej33.github.io/biodivine_sketchbook/). Instructions to generate Rust documentation locally are given below.
53+
3754

3855
### Installation of dependencies
3956

4057
First, make sure you have Rust and NPM installed. For Rust, we recommend following the instructions on [rustlang.org](https://www.rust-lang.org/learn/get-started). For instructions on NPM and Node installation, feel free to check [their website](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
4158

59+
On some Linux distributions, additional packages might be needed for developing with Tauri. We recommend checking the [setup instructions by Tauri](https://v1.tauri.app/v1/guides/getting-started/prerequisites/).
60+
4261
We have tested the app using the following versions:
4362
- npm 10.9.0
4463
- node 22.11.0
@@ -48,10 +67,9 @@ Then, after cloning the repository, run `npm install` to download all JS/TS depe
4867

4968
### Building the app
5069

51-
To build a release version of the app, run `npm run build`. Note that the first build can take a few minutes as the application backend needs to be compiled. Subsequent builds should be a lot faster.
52-
To properly build the full installation file for the app, you can also use `cargo tauri build`. It will create an installation bundle at `src-tauri/target/release/bundle`.
70+
To build a release version of the app, run `npm run tauri build`. It will create an installation bundle at `src-tauri/target/release/bundle/` (the exact path will be displayed at the end of the command's standard output). Note that the first build can take a few minutes as the application backend needs to be compiled. Subsequent builds should be a lot faster.
5371

54-
To start the application in debug mode, run `npm run tauri dev`. Note that upon startup, the application window can be unresponsive for a few seconds when using development mode. This is because the whole application is running in debug mode without any optimizations. This startup delay should be substantially reduced when using the release binaries produced by `npm run build`.
72+
To start the application in debug mode, run `npm run tauri dev`. Note that upon startup, the application window can be unresponsive for a few seconds when using development mode. This is because the whole application is running in debug mode without any optimizations. This startup delay should be substantially reduced when using the release binaries produced by `npm run tauri build`.
5573

5674
### Static analysis, tests, documentation
5775

@@ -75,15 +93,20 @@ cargo doc --no-deps --document-private-items
7593
```
7694

7795
#### End-to-end tests
78-
We also utilize an end-to-end Selenium-based testing framework. Note that these tests require additional dependencies, and they are limited for Linux and Windows (due to MacOS issues with WebDriver).
96+
We also utilize an end-to-end Selenium-based testing framework. Note that these tests require additional dependencies, and they are limited for Linux and Windows (due to MacOS issues with WebDriver). You should also update the test configs based on your system.
97+
98+
You can follow this [detailed tutorial](https://jonaskruckenberg.github.io/tauri-docs-wip/development/testing.html) for setup. In short, you should install `tauri-driver` (with `cargo install tauri-driver`), and then you will need either `WebKitWebDriver` on Linux or `Microsoft Edge Driver` on Windows (make sure that you have updated Microsoft Edge too). The mocha test runner can be installed with `npm install mocha chai selenium-webdriver`. You might need to update the configuration at the top of the testing script `test/test.js`, mainly the path to your Sketchbook binary and to your webdriver.
7999

80-
You can follow this [detailed tutorial](https://jonaskruckenberg.github.io/tauri-docs-wip/development/testing.html) for setup. In short, you should install `tauri-driver` (with `cargo install tauri-driver`), and then you will need either `WebKitWebDriver` on Linux or `Microsoft Edge Driver` on Windows (make sure that you have updated Microsoft Edge too). The mocha test runner can be installed with `npm install mocha chai selenium-webdriver`.
81-
To run the tests, first build the app with `cargo tauri build` and then use `npx mocha` (you might need a longer timeout, like `npx mocha --timeout 20000`).
100+
To run the tests, first build the app with `cargo tauri build` and then use `npx mocha` (you might need a longer timeout, like `npx mocha --timeout 20000`).
82101
The framework was tested on Windows with `Microsoft Edge WebDriver` version `130.0.2849.89`.
83102
However, note that we found the testing framework a bit unstable when the testing machine is overloaded with other tasks. Sometimes, the tests do not go through due to internal WebDriver issues, and we are investigating this.
84103

85-
### Benchmarks
104+
## Benchmarks and data
86105

87106
The benchmark models, results, and more details are in `data/benchmarks`.
88107
There is also a README with further instructions, you can follow it.
89108
Tldr, to run the performance benchmarks, you can use python and execute them all with `python3 run_performance_eval.py`.
109+
110+
Sketches and datasets relevant to cases studies on biological models and real datasets are in `data/real_cases`. There is also a README with further details.
111+
112+
An example sketch used to introduce the framework is in `data/small_example`. Sketch is available in AEON and JSON format. We also provide results of the inference and the resulting sampled BN candidate.

data/load-results-aeon-py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import zipfile
44

55
# Path to the zip archive with results
6-
zip_file_path = Path("real_cases/results-tlgl.zip")
6+
zip_file_path = Path("real_cases/tlgl/results.zip")
77

88
# Filenames inside the zip archive
99
bn_filename = "derived_model.aeon"

data/readme.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This folder contains various models, benchmarks, and datasets. The structure is following:
2+
3+
- `benchmarks` | Multiple sketches used for performance evaluation. Also contains expected output and metadata. Check `benchmarks/readme.md` for more details.
4+
- `real_cases` | Sketches and datasets relevant to cases studies on biological models and real datasets. Check `real_cases/readme.md` for more details.
5+
- `small_example` | An example sketch used to introduce the framework. Sketch is available in AEON and JSON format. We also provide results of the inference and the resulting sampled BN candidate.
6+
- `test_data` | Sketches and datasets for testing purposes. Used to test importing and inference.
7+
- `load-results-aeon-py.py` | Python script illustrating how to load a results archive exported by Sketchbook and load it into `aeon-py` library. You need to install python and biodivine_aeon library first (`https://pypi.org/project/biodivine-aeon/`). Script is just for illustration, so the path is fixed.
8.24 KB
Binary file not shown.

data/real_cases/readme.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
A real case studies collected and adapted to BN sketches framework:
1+
A real case studies collected and adapted to BN sketches framework. The Arabidopsis is discussed in the Sketchbook thesis, while TLGL in our original theoretical paper.
22

3-
1) Apoptosis case study:
3+
1) Arabidopsis sketch:
44
- background: This model and expected attractor data is taken from [this paper](https://doi.org/10.3389/fgene.2018.00039) about the BN inference tool Griffin. Originally, the model was developed by La Rota et al. in [this paper](https://doi.org/10.1105/tpc.111.092619).
55
- model: We use the fully unspecified model directly as is.
66
- properties: We use two fixed-point properties adapted from the Griffin paper.
77
- candidates after static: 4761711360
88
- candidates after all: 439296
99

10-
2) TLGL case study:
10+
2) TLGL sketch:
1111
- background: The original model was developed by Saadatpour et al. in [this paper](https://doi.org/10.1371/journal.pcbi.1002267). It is a reduced version of the model developed by Zhang et al. in [this article](https://doi.org/10.1073/pnas.0806447105). The experimental attractor data comes [this work](https://doi.org/10.1371/journal.pcbi.1002267) as well.
1212
- model: We use a partially specified version of the reduced model, only assuming that Apoptosis must inactivate all variables.
1313
- properties: We use a fixed-point property for a "healthy attractor" (cell death) and a complex attractor property for a "diseased attractor", based on provided data regarding the T-LGL state.
1414
- candidates after static: 1296
15-
- candidates after all: 486
15+
- candidates after all: 486
16+
17+
For both cases, we present the constructed sketch (in AEON and JSON format) and inference results produced by Sketchbook as a zip archive. There can be also additional datasets or other relevant model files.

data/real_cases/results-tlgl.zip

-9.73 KB
Binary file not shown.

data/real_cases/tlgl/results.zip

8.87 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
2.44 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
v_3 -| v_1
2+
v_1 -?? v_2
3+
v_2 -? v_3
4+
v_1 -> v_3
5+
v_3 -?? v_3
6+
$v_1: !v_3
7+
$v_2: v_1
8+
$v_3: ((v_1 & (!v_2 | v_3)) | (!v_1 & v_3))

data/small_example/resulting-BN.aeon

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
v_3 -| v_1
2-
v_1 -?? v_2
3-
v_2 -? v_3
4-
v_1 -> v_3
5-
v_3 -?? v_3
6-
$v_1: !v_3
7-
$v_2: v_1
8-
$v_3: ((v_1 & (!v_2 | v_3)) | (!v_1 & v_3))
1+
#position:C:196.222646417978,222.1758650941348
2+
$C:(B & C) | (!A & B)
3+
B -> C
4+
A -| C
5+
C ->? C
6+
#position:A:24.815603034996407,225.86087672588792
7+
$A:C
8+
C -?? A
9+
#position:B:102.24128185543081,79.45256430306468
10+
$B:A
11+
A -> B
188 Bytes
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
C -?? A
2+
B -> C
3+
A -| C
4+
C ->? C
5+
A -> B
6+
$A: g(C)
7+
$B: A
8+
$C: B & h(A, C)
9+
#position:B:102.24128,79.45257
10+
#position:C:196.22264,222.17586
11+
#position:A:24.815603,225.86087
12+
#!dataset:d1:#`{"name":"dataset 1","id":"d1","annotation":"Example steady-state dataset with two attractor observations.","observations":[{"id":"o1","name":"observation 1","annotation":"","dataset":"d1","values":"111"},{"id":"o2","name":"observation 2","annotation":"","dataset":"d1","values":"000"}],"variables":["A","B","C"]}`#
13+
#!dynamic_property:dynamic_1:#`{"id":"dynamic_1","name":"Exists state reaching two attractors","annotation":"","variant":"GenericDynProp","formula":"\\exists {a}: \\exists {b}: \\exists {c}: ( \\jump{c}: ( EF {a} & EF {b} & ( \\jump {a}: AG EF {a} ) & ( \\jump {b}: ( AG EF {b} & ~EF {a} ) ) ) ) "}`#
14+
#!dynamic_property:dynamic_2:#`{"id":"dynamic_2","name":"Observations of dataset d1 are in attractors","annotation":"","variant":"HasAttractor","dataset":"d1","observation":null}`#
15+
#!function:g:#`{"id":"g","name":"g","annotation":"","arguments":[["Unknown","Unknown"]],"expression":""}`#
16+
#!function:h:#`{"id":"h","name":"h","annotation":"","arguments":[["Unknown","Unknown"],["Unknown","Unknown"]],"expression":""}`#
17+
#!static_property:essentiality_A_B:#`{"id":"essentiality_A_B","name":"Regulation essentiality property","annotation":"","variant":"RegulationEssential","input":"A","target":"B","value":"True","context":null}`#
18+
#!static_property:essentiality_A_C:#`{"id":"essentiality_A_C","name":"Regulation essentiality property","annotation":"","variant":"RegulationEssential","input":"A","target":"C","value":"True","context":null}`#
19+
#!static_property:essentiality_B_C:#`{"id":"essentiality_B_C","name":"Regulation essentiality property","annotation":"","variant":"RegulationEssential","input":"B","target":"C","value":"True","context":null}`#
20+
#!static_property:monotonicity_A_B:#`{"id":"monotonicity_A_B","name":"Regulation monotonicity property","annotation":"","variant":"RegulationMonotonic","input":"A","target":"B","value":"Activation","context":null}`#
21+
#!static_property:monotonicity_A_C:#`{"id":"monotonicity_A_C","name":"Regulation monotonicity property","annotation":"","variant":"RegulationMonotonic","input":"A","target":"C","value":"Inhibition","context":null}`#
22+
#!static_property:monotonicity_B_C:#`{"id":"monotonicity_B_C","name":"Regulation monotonicity property","annotation":"","variant":"RegulationMonotonic","input":"B","target":"C","value":"Activation","context":null}`#
23+
#!static_property:monotonicity_C_C:#`{"id":"monotonicity_C_C","name":"Regulation monotonicity property","annotation":"","variant":"RegulationMonotonic","input":"C","target":"C","value":"Activation","context":null}`#
24+
#!variable:A:#`{"id":"A","name":"A","annotation":"","update_fn":"g(C)"}`#
25+
#!variable:B:#`{"id":"B","name":"B","annotation":"","update_fn":"A"}`#
26+
#!variable:C:#`{"id":"C","name":"C","annotation":"","update_fn":"B & h(A, C)"}`#

0 commit comments

Comments
 (0)