DSCI 521: Computing Platforms for Data Science
How to install, maintain, and use the data scientific software “stack”. The Unix operating system, integrated development environments, and problem solving strategies.
Course Learning Objectives
- Use the Unix command line to navigate their computer’s filesystem.
- Define and distinguish between absolute file paths and relative file paths.
- Effectively use local and remote version control software (e.g., Git and GitHub) to organize projects and manage file versions.
- Create, edit and run reproducible literate Python and R code documents (e.g., reports and presentations) using Jupyter and RMarkdown.
- Write and edit Markdown and in-line LaTeX syntax within literate code documents.
- Define and correctly use a project working directory.
- Diagnose and troubleshoot programming and development environment problems, and explain how such problems can be avoided.
Lesson Learning Objectives and Readings
Learning objectives are grouped by week. Some weeks split one set of objectives across several lessons, and some lessons carry more than one set.
Orientation
- Launch JupyterLab
- Use the Notebook interface inside Jupyterlab
- Know your way around the JupyterLab user interface
- Launch RStudio
- Use the
.Rscript and RMarkdown.Rmdinterface inside RStudio - Know your way around the RStudio user interface
- Launch Positron and open an assignment as a folder
- Know your way around the Positron user interface
- Start, switch, and restart an R or Python session
- Run code from a script, a Jupyter notebook, and a Quarto document
Week 1
- Recognize the directory hierarchy as it is commonly represented in diagrams, paths, and file explorer software.
- Distinguish common operators and representations of the different filesystem elements typically used in Bash.
- Explore the filesystem using Bash commands as
ls,pwdandcd. - Translate an absolute path into a relative path and vice versa.
- Use command-line arguments to produce alternative outputs of commands.
- Create, edit, move, and delete files and folders using the command line and Positron.
- Implement SSH authentication
- Differentiate between the use of GitHub as a remote hosting service for version control and Git as a version control system.
- Create a Git repository.
- Implement Git’s clone, add, status, commit, pull, and push operations on the command line and their equivalent use in Positron.
- Understand what implies using the staging area in a Git workflow.
- Recognize the commit as the primary building block for storing a project version characterized by an attached message and a hash that serves as a unique identifier.
Readings
Week 2
- Use the
quartoterminal command to create different quarto projects - Create and edit a Quarto website
- Discover how GitHub can be used to serve static websites
- Modify a GitHub repository to publish a website
Quarto, RMarkdown, and Jupyter Slides
- Understand how Quarto extend R Markdown documents functionalities.
- Explore different data science products to communicate your results: slides, books and websites.
- Create slides using Jupyter Notebook and Quarto slides with
reveal.js - Recognize Jupyter Book, bookdown, and Quarto book as long-form output formats.
- Sharing rendered HTML files publicly via GitHub Pages.
Readings
Week 3
Git: History, Conflicts, and Ignores
- Explore the Git history via
git login the terminal and GitHub. - Compare commits using
git diffin the terminal and GitHub. - Solve merge conflicts at the command line and in Positron.
- Save transitory changes with
git stash. - Manage to avoid pushing specific local files by including a
.gitignore. - Differenciate among different ways to restore your project history (
git reset --hard/--soft,git revert) when working on an older version of a project.
RStudio Projects and Literate Programming
- Create RProjects in RStudio using
hereto define robust file paths. - Detect the basic components of a dynamic document in Jupyter Notebooks and in R Markdown.
- Explain markdown usage in relation to dynamic documents.
- Differentiate between code chunks and code cells in RMarkdown and Jupyter Notebooks.
- Select appropriate code chunk options for RMarkdown.
- Use semantic line breaks for version control files.
- Specify metadata in the YAML header block.
Readings
Week 4
Virtual Environments: uv and renv
- Understand what a computational environment is and how it can ensure the reproducibility of a project
- Differentiate Python, PyPI,
pip,venv, anduv - Distinguish between the packages a project declares (
pyproject.toml,DESCRIPTION) and the packages a project locks (uv.lock,renv.lock) - Manage packages and environments in Python using
uv - Manage packages and environments in R using
renv
Organization of Data Science Projects
- Describe how a data analysis project is organized, and how that organization differs from a code project.
- Distinguish raw data from processed data, and explain why raw data files are never overwritten.
- Apply the three principles of a good file name: machine readable, human readable, and plays well with default ordering.
- Explain how informative file names and locations make a project self-documenting.
Introduction to Regular Expressions (RegEx)
- Understand the basic syntax and functionality of regular expressions (regex) for pattern matching.
- Explore the use of special characters, ranges, and anchors in regex to match specific patterns within text.
- Apply regex to search, extract, and manipulate data in various formats using practical examples.
- Use regular expressions to navigate and organize files within the filesystem.
- Explain why a well-posed question gets a faster and better answer.
- Construct a minimal reproducible example (MRE) for a programming problem.
- Describe a problem clearly, including what you have already tried and the full error message.
Readings
Attributions
Materials were inspired, re-used and re-mixed from the following sources:
- Software Carpentry, specifically the Unix Shell and Git lessons
- Happy Git and GitHub for the useR by Jenny Bryan and the STAT 545 TAs
- Data 8: The Foundations of Data Science, specifically Lab 01
- Data Carpentry Reproducible Science Workshop
License
The UBC Master of Data Science DSCI 521: Computing Platforms for Data Science course materials here are licensed under the Creative Commons Attribution 2.5 Canada License (CC BY 2.5 CA). If re-using/re-mixing please provide attribution and link to this webpage.