Setting up¶
Developing a Modelblocks modelblocks module requires careful handling of software dependencies, Snakemake requirements, and datasource locations.
This section details how a Modelblocks developer should handle each of these cases to ensure their module is reproducible in the long term.
Software environments: pixi¶
The first step is ensuring you have an appropriate tool to manage your software environments.
We require developers to use pixi as their package management tool because it provides much needed stability to software projects.
In particular:
- It automatically maintains a stable lockfile (
pixi.lock). This helps ensure that modules can be rerun using the exact versions of installed packages, and avoids human errors when updating dependencies. - It provides multi-platform support which helps with our aim to develop modules that can run on the most popular operating systems (Windows, MacOS, Linux).
Installing pixi
Follow the installation instructions on the pixi documentation.
For unix-like systems, you can do:
Project templating: Modelblocks template¶
The second step is to ensure that your module has little friction with other modules.
We require developers to use our standardised Snakemake project template, which has the following advantages:
- It follows our Convention in terms of file structure, interfacing, tests, and environment management.
- Provides pre-made continuous integration via pre-commit.ci and GitHub actions, tested in all major platforms.
- Enables developers to easily keep up with the Convention via
copier's update functionality. - Allows your module to be featured in the Modelblocks website.
Running the template
Up to date instructions are available in the template's README.
Generally:
pixi global install copier # (1)!
mkdir module_name & cd module_name # (2)!
copier copy https://github.com/modelblocks-org/data-module-template.git # (3)!
- Install
copieras a global tool in your machine viapixi. - Create and open your project folder
- Start the templating process
The templater will ask you a few questions, which will be used to pre-fill files in your project.