Rix with Bruno Rodrigues
https://github.com/b-rodrigues/r-medicine-rix
Definition of reproducibility - recover exactly the same resutls from an analysis (replicate)
1) How easy for someone else to use your code?
2) How easy to update the project? (data/package/etc)
3) How easy to reuse the code yourself?
4) How stable is the output through time?
Reproducibility exists on a spectrum.
The R version used, the package version, OS, and hardware can all potentially impact your ability to reproduce an analysis.
Reproducibility is not trivial.
Reproducibility tools:
-
renv
- package management and env documentation - does not allow you to restore R version, old package installs often fail :( or require a lot of effort -
docker
- capture system level libraries/compute env - build images and run containers - has all software and code needed for project. Combined withrenv
you are happy :)- useful and widely used
- checkour rocker project
- steep learning curve
- basically setting up a linux os
- can create a single point of failure
- not designed for reproducibility
What is Nix?
Package manager - any piece of software (firefox, R, r packages, python packages)
- 120k pieces of software
- Extremely fresh
Nix facilitates gold standard reproducibility because its designed with reproducibility in mind. Nix deals with everything by writing a “nix expression” written in nix. Nix always builds packages in the exact same way. Rix provides an friendly R based interface for Nix.
Can start your nix file from renv.lock file! You can use targets in nix.
You can add an IDE and work interactively in your preferred IDE.
nix expressions can be used with CI and even in containers.
can add any system_pkgs
found here: https://search.nixos.org/packages
Nix uses WSL on windows. If you can’t have WSL, you cant use windows.
Any pain points when collaborating?
- if you’re using nix, use nix. Local install of R/r packages can be disrupted by nix.
- some issues with mac - certain system tools may not be available on macos (e.g. chromium dependencies)
Last Mile - how do we make this more accessible for field focused collegues?
- Need to have someone on the team that is very close to field focused people and very technically savvy e.g. research software engineer
My thoughts:
- Looking forward to playing around with this!
- Some of the requirements make it impracticle for certain types of collaborators.
- It might be a good idea to use
targets
andrenv
throughout development and wrap everything up in nix and docker at specific release points.
Enjoy Reading This Article?
Here are some more articles you might like to read next: