The Template R Operator is a template repository for the creation of R operators in Tercen. An overview of steps for developing an operator are:
- Create a new GitHub repository using this template
- Clone the newly created repository to your development environment (we recommend using VS Code)
- Describe your operator specifications in the README file
- Develop the operator (with or without assistance from the Tercen Agents)
- Initialise or update the R packages environment using
renv. - Push your changes and install the operator in Tercen
Detailed information can be found in the Tercen developer's guide.
After creating your operator from this template, complete the following steps:
- Update
operator.json:- Change
nameanddescription - Update
authorsto your organization - Update
containerto match your repo:ghcr.io/YOUR_ORG/YOUR_REPO:main - Update
urlssimilarly - Configure
propertiesfor your operator's parameters
- Change
- If using minimal base image, uncomment and configure the Dockerfile accordingly
- Run
renv::init()locally and commitrenv.lock - Push your changes to trigger the CI workflow
- Important: Make the Docker package publicly accessible (see below)
By default, GitHub Container Registry (ghcr.io) packages inherit the repository's visibility settings. If your repository is private, the Docker image will also be private, and Tercen/BioNavigator will fail to pull it with an error like:
Error response from daemon: denied
To fix this, you have two options:
-
Make the package public (recommended if repo stays private):
- Go to
https://github.com/orgs/YOUR_ORG/packages - Find your operator package
- Click "Package settings"
- Under "Danger Zone", click "Change visibility" and select "Public"
- Go to
-
Make the repository public:
- This automatically makes associated packages public
This template provides two base image options:
| Option | Base Image | Use Case |
|---|---|---|
| Full runtime (default) | tercen/runtime-r44:4.4.3-8 |
Most dependencies included, easier setup |
| Minimal runtime | tercen/runtime-r44-minimal:4.4.3-2 |
Smaller image, requires adding build dependencies |
If using the minimal runtime, uncomment the relevant lines in the Dockerfile and add any system dependencies your R packages require. Common dependencies:
gcc g++ musl-dev make- C/C++ compilation (most R packages)gfortran- Fortran compiler (statistical packages, linear algebra)curl-dev openssl-dev- HTTP/SSL supportcargo rust- Rust toolchain (some modern R packages)build-base linux-headers libxml2-dev- Required for installing R packages from GitHub that need compilation (e.g., pamgene packages)
This template includes a .gitattributes file with commented-out LFS tracking rules for common large file types (.rds, .csv, .pdf, images). If your operator requires large data files:
- Install Git LFS:
git lfs install - Uncomment the relevant lines in
.gitattributesfor file types you need to track - Run
git lfs trackto verify your patterns - Commit the updated
.gitattributesbefore adding large files
Below is the operator README standard structure.
The Template R operator is a template repository for the creation of R operators in Tercen.
| Input | . |
|---|---|
x-axis |
type, description |
y-axis |
type, description |
row |
type, description |
column |
type, description |
colors |
type, description |
labels |
type, description |
| Settings | . |
|---|---|
input_var |
parameter description |
| Output | . |
|---|---|
output_var |
output relation |
Operator view |
view of the Shiny application |
Details on the computation.