How to write (and set) a run script

Running your code from top to bottom by default

Shahar Zaks avatar
Written by Shahar Zaks
Updated over a week ago


A vital reproducibility habit is to always write a master script. This script should run through all of your analyses in their proper order. It will 

  • Help readers know exactly how your steps are linked together; 

  • Reduce all labor required of readers to execute a single script; and 

  • Help you, the author, figure out if everything runs as you think, from top to bottom.


  • Hover over a file;

  • Click the dropdown menu that appears on it;

  • Select Set as File to Run:

You'll then get a 'run' script, as shown above, that executes your main script. This file is a shell script and can be modified as you see fit to run your analyses -- and also to take care of system-level commands (e.g. creating symbolic links).

What makes a good master script?

First, your run script should run headlessly, meaning that it does not require user input, nor expect a pop-up display, during runtime. 

Second, you should presume that user will not be monitoring their runs continuously, Therefore, please:

  • have logical default parameters;

  • reproduce as many of your results as possible without users' needing to choose anything;

  • run continuously without pause or delay.

Did this answer your question?