Skip to content

Commit

Permalink
Update docs and repo description.
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrej33 committed Dec 3, 2024
1 parent 93e54d5 commit fb1c4e3
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 10 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Biodivine Sketchbook

SketchBook is a multi-platform application for the synthesis of Boolean network models.
Sketchbook is a multi-platform application for the synthesis of Boolean network models.
It provides a user-friendly interface for designing a Boolean network sketch and inferring admissible BNs.
You can find the newest version of the Sketchbook at [this Github repository](https://github.com/sybila/biodivine-sketchbook).

Boolean network sketches, introduced in [this paper](https://doi.org/10.1093/bioinformatics/btad158), serve as a method for integrating various kinds of prior knowledge and experimental data. The sketch consists of an influence graph, partially specified update functions, update function properties, and dynamic properties (including experimental data).
Sketchbook presents a way to design all these components and more.
Expand All @@ -21,7 +22,7 @@ Bioinformatics, 39(4), https://doi.org/10.1093/bioinformatics/btad158.
## Installation

We provide pre-built binaries and installation files for the application in the [release section](https://github.com/sybila/biodivine-sketchbook/releases) (includes versions for Windows, Linux and macOS).
To start using Sketchbook, download binary for your operating system - you choose between `.app` and `.dmg` for macOS, `.AppImage`, `.deb` and `.rpm` for Linux, or `.exe` and `.msi` for Windows.
To start using Sketchbook, choose the latest release, download binary for your operating system - you choose between `.app` and `.dmg` for macOS, `.AppImage`, `.deb` and `.rpm` for Linux, or `.exe` and `.msi` for Windows.
If you need a different pre-built binary for a specific platform, let us know!

> Note that the binaries are not signed with official developer certificates, so macOS and Windows will most likely require you to grant special permissions to run the app. **On newer versions of macOS, the message is that the app is "corrupted". This is still the same issue regarding app certificates. You should run `xattr -c /path/to/biodivine-sketchbook.app` to ["enable" the app](https://discussions.apple.com/thread/253714860?sortBy=rank).**
Expand Down
51 changes: 49 additions & 2 deletions project-docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ This document gives a general rationale behind the chosen architecture and techn

Overall, you should be able to work with the source code comfortably from Visual Studio Code, although IntelliJ IDEA may be preferable for the Rust portion.

We use standard `cargo` utilities for Rust testing and linting. For TypeScript static analysis, we use [ESLint](https://eslint.org/). For some further TypeScript unit-testing, we use [vitest](https://vitest.dev/) that is recommended in Tauri docs. For some limited end-to-end testing, we utilize [WebDriver](https://www.w3.org/TR/webdriver/) based approach recommended by Tauri. We go with `selenium-webdriver` framework and `mocha` test runner. More details are in the main README, or see this [Tauri testing tutorial](https://jonaskruckenberg.github.io/tauri-docs-wip/development/testing.html)
We use standard `cargo` utilities for Rust testing and linting. For TypeScript static analysis, we use [ESLint](https://eslint.org/). For some further TypeScript unit-testing, we use [vitest](https://vitest.dev/) that is recommended by Tauri. For some limited end-to-end testing, we utilize [WebDriver](https://www.w3.org/TR/webdriver/) based approach recommended by Tauri. We go with `selenium-webdriver` framework and `mocha` test runner. More details are in the main README, or you can see this [Tauri testing tutorial](https://jonaskruckenberg.github.io/tauri-docs-wip/development/testing.html)

## Project structure

We first list the most important components of the project repository, mainly various source folders and configuration files. After that, we add more details on how the Rust back-end code is structured.

- `vite.config.ts` | Configuration for the Vite build system (HTML/JS/CSS processing). Most stuff is generated by Tauri, there's just some extra code related to properly building UIKit and to declaring multiple entry points for different windows.
- `tsconfig.json` | Configuration for the TypeScript compiler. Generated by Tauri for now. Later we might want to make it a bit more restrictive.
- `package.json` and `package-lock.json` | List of `npm` dependencies (and its frozen variant). Mostly just Tauri, UIkit, Less, PostHTML, some packages with types declarations, and testing frameworks.
Expand All @@ -36,9 +38,54 @@ We use standard `cargo` utilities for Rust testing and linting. For TypeScript s
- `tauri.conf.json` | Mostly default Tauri config. Might need tweaking once we start working more with windows.
- `icons` | Icon logo files for the app.  
- `resources` | Any kind of files that should be bundled together with the code and easily accessible. For now, we use it to store example models (that must not get lost).  
- `Cargo.toml`, `build.rs` and `src` | Mostly standard Rust project.
- `Cargo.toml`, `build.rs` and `src` | Mostly standard Rust project (with dependencies in Cargo file and backend code in src). The hierarchy of the source directory is described in the following section `Backend modules hierarchy`.
- `test` | Folder for end-to-end tests with `selenium` and `mocha` frameworks. For now just very simple example.
- `project-docs` | A directory to collect design/documentation regarding the project's architecture, technologies, design, and more. This is not meant as tool documentation for users, but for developers.
- `data` | A directory with all the models, benchmarks, and datasets. Basic information is given in section `Data folder`

### Backend modules hierarchy

Below, we give introduction into the hierarchical structure of the Rust modules (inside of the `src-tauri/src` folder).
We do not cover the files on the lowest levels of the hierarchy, just the important parts to get to know the project.
More details can be found in the Rust documentation that you can generate with `cargo doc --no-deps --document-private-items`.

Note that unit tests are mostly defined within the same file as the tested functionality, as is usual in Rust. In the list below, we mention few modules solely targeting more extensive integration tests.

- `main.rs` | Main entry point for the application, starts Tauri and sets up event listeners.
- `logging.rs` | Custom logging macros.
- `lib.rs` | Library file encompassing all top-level Rust modules.
- `algorithms` | Module with all the main internal algorithms and low-level implementation details.
- `eval_dynamic` | Algorithms and wrappers for evaluation of dynamic properties.
- `eval_static` | Algorithms and wrappers for evaluation of static properties.
- `fo_logic` | Parsing and evaluation for the FOL formulas.
- `analysis` | Module to handle the state and high-level computation for the inference analysis session.
- `_test_inference` | Tests for the whole inference computation pipeline.
- `app` | Module defining the core structures and traits behind the application's architecture (like sessions, events, undo-redo stack).
- `state` | Structures for managing application state and event handling.
- `analysis` | Skeleton of the analysis session.
- `editor` | Skeleton of the editor session.
- `bin` | Sources for additional binaries that can be run from CLI.
- `run_inference.rs` | Program for running the inference on the given sketch from CLI.
- `sketchbook` | Module to handle the state of the sketch and the editor session.
- `data_structs` | Simplified structures that are used for communication with frontend and for serialization of more complex internal structs.
- `layout` | State management for the layouts of the network editor.
- `model` | State management for the main model - variables, regulations, update functions, supplementary functions, ...
- `observations` | State management for the observations and datasets.
- `properties` | State management for the static and dynamic properties.
- `dynamic_props` | Structures for various dynamic properties.
- `static_props` | Structures for various static properties.
- `_tests_events` | Tests for processing of the most significant events.
- `_sketch` | Implementation of the API for the `Sketch` structure, import/export of the sketch, and so on.

### Data folder

Directory `data` contains various models, benchmarks, and datasets. The structure is following:
- `benchmarks` | Multiple sketches used for performance evaluation. Also contains expected output and metadata. Check `benchmarks/readme.md` for more details.
- `real_cases` | Sketches and datasets relevant to cases studies on biological models and real datasets. Check `real_cases/readme.md` for more details.
- `small_example` | An example model used to introduce the framework.
- `test_data` | Sketches and datasets for testing purposes. Used to test importing and inference.
- `load-results-aeon-py.py` | Python script to load 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/`).


## Architecture notes (early stage)

Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/algorithms/eval_static/prepare_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod tests {
.unwrap();
assert_eq!(graph_fol_expected.unit_colors(), graph_fol.unit_colors());

// test FOL graph creation automatically from property
// test deriving FOL context automatically from property
let fol_prop = ProcessedStatProp::mk_fol("doesntmatter", "3 x: true");
let property_list = vec![fol_prop];
let graph_fol = prepare_graph_for_static_fol(&bn, &property_list, "a", None).unwrap();
Expand Down
10 changes: 5 additions & 5 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
extern crate lazy_static;
extern crate core;

/// Algorithms for the inference process.
/// All the internal algorithms for the inference process and low-level computation details.
pub mod algorithms;
/// State of the inference analysis tab and solvers.
/// State of the inference analysis and solvers.
pub mod analysis;
/// General functionality for window mechanism, event stack, tab management, and more.
/// General functionality for session management, windows, event stack, tab management, and more.
pub mod app;
/// Logging utilities.
/// Custom logging utilities.
pub mod logging;
/// State of the sketchbook editor tab.
/// State of the BN sketch, and management for most of the editor tab.
pub mod sketchbook;

0 comments on commit fb1c4e3

Please sign in to comment.