Keeping Track of Code & Using VS Code¶
A short tooling block on running your QIIME2 work in a way you can actually reproduce six months from now: editing scripts in VS Code with the Remote-SSH connection to Alpine, keeping a running command log, and (optionally) versioning everything with git.
What this lecture covers¶
- Installing VS Code and the Remote - SSH extension
- Connecting to Alpine and editing files on the cluster directly
- Running QIIME2 commands from a
commands.shscript vs typing them ad-hoc - A reproducibility workflow: every command goes in a script, every script goes in a folder you can re-run end-to-end
- Optional: putting that folder under
gitso you can diff your analysis history
Hands-on follow-along¶
For now, the workshop runs commands interactively in the terminal, but make a habit of pasting each command you run into a notes.sh or commands.sh file so you have a re-runnable record.
Keeping Track of Commands on Alpine¶
- Navigate to OnDemand.
- Navigate to the
scratchdirectory. - Select New File.
- Enter a name for your file, such as
commands_test.sh. - Open the drop-down menu next to the file name and click Edit.
- You can now edit your text file. Make sure to save before exiting.
The Alpine text editor is convenient, but it cannot check your code for errors. For that reason, we recommend keeping track of commands in VS Code, especially for Windows users.
Installing and Using VS Code¶
- Follow this link to download the version of VS Code for your computer.
- Open VS Code.
- Under Start, click New File.
- Enter a name for your file. We will use
2026_qiime2_workshop_commands, and select a text file. You can always change the file type later. - Once the new document is open, go to the bottom-right corner where it says Markdown and change the language to PowerShell. We found that this does the best job of flagging the kinds of command errors Windows users were running into.
Notes on command record keeping: Whatever you use to track your commands, make sure it is a plain text file. Both .txt and .sh files work. A .txt file is plain text, while a .sh file is an executable script, which we will discuss more later. Be sure to record every command you run for future reproducibility.