Code

The Code folder contains all the scripts used in the Capsule. You can add folders or files to the /code folder by pressing the plus signs at the top of the File Navigator or by uploading them. Using the drop-down menu, you can drag and drop code files and folders from your local computer and upload them to the /code folder.

For reproducibility purposes, files written to the /code folder during a Reproducible Run are deleted once it’s completed.

A run file (i.e., driver script) is the entry point into the Capsule during a Reproducible Run, and automates an end-to-end workflow.

The key file paths to know for use in your Capsule code are /code , /data , /results , and /scratch. These correspond to the panes in the workspace:

  • code

  • data

  • results

  • scratch

Use relative paths where possible – for example, ../data and ../results – this simplifies the process for those who download the code to run things locally.

The initial working directory will be /code when your code is run. You will hardly need to refer to it if you use relative paths.

If you have code in a subfolder, add .. where necessary, for example

load('../../data/my_data.csv'). This will go up two parent directories and look for ./data/my_data.csv.