Module 0 · 8 steps
Prepare your computer
Install R, RStudio and PLINK 2, download the course package and run the setup check.
Where to put the project
Windows: C:\GWAS_course.
Mac: your home folder (in Finder press Cmd + Shift + H), so the path is /Users/yourname/GWAS_course.
Do not use Desktop, Documents, Downloads, OneDrive, Dropbox or iCloud Drive: PLINK may fail there.
Already set up somewhere else? Close the project, move the whole GWAS_course folder (with data and bin), open GWAS_course.Rproj from the new place and run step 0.8 again.
In this module
- Before you start
- Nothing except the project folder. The first code chunk checks it.
- Where the module ends
- This module has no checkpoint.
The notebook is a Quarto file (.qmd). Open it in RStudio from the project folder.
At a glance
What you will do. You will install three free programs: R (opens in a new tab) (the language that runs our commands), RStudio (a window that makes R easier to use) and PLINK 2 (opens in a new tab) (a program that analyses genotype files). You will download the course files and the course data. Then you will run a setup check that shows your computer is ready.
What you will learn.
- How to find out which system and processor your computer has.
- How to install R, RStudio and PLINK 2.
- How to open a project and run a command in the console.
- Why checksums and a setup check protect your work.
- The routine you will use in every step: read, run, compare.
How long it takes. About 90 minutes. Package installation at 0.5 and the large data download at 0.7 take the longest.
Your progress: 0 of 8 steps done
Saved in this browser only. Nothing is sent anywhere.
Steps
- 0.1Install RFind your system and processor, then install R.
- 0.2Install RStudioInstall RStudio Desktop and open it.
- 0.3Download and extract the projectDownload and extract the whole source project.
- 0.4Open the project and check ROpen the project, then open this notebook.
- 0.5Install the R packagesInstall the R packages used by the course.
- 0.6Put PLINK 2 in bin/The project package already contains PLINK 2 Beta 1.4 for Windows, macOS (Apple Silicon and Intel) and Linux.
- 0.7Request the password and download the dataRequest the course password, then download the matching encrypted data with download_course_data().
- 0.8Run the setup checkRun the setup check.
Recap
- You found your operating system and processor, and installed R, RStudio and PLINK 2.
- You downloaded the course project and the encrypted data, and checked them with SHA-256 checksums.
- The archive reported
Course data are ready: 108 files verified. - The setup check ran PLINK on 20 variants and printed
Preflight passed. - The starting data have 2,016 sample wells and 299,523 variants, which represent 2,000 simulated people.
- You learned the routine for every step: read, run, compare.
How to use this guide {#using-this-guide}
Use the same routine at every step: read, run, compare. Follow these actions:
- Read "What we do", "Why" and "You need".
- Run the command in the console.
- Open "Show the expected result" and compare it with your result.
- If your result differs, open "If something goes wrong".
- Answer the quick check.
A successful check at step 0.8. Keep the output files and the notebook together in their documented places. The glossary (opens in a new tab) explains the terms used in the course, including quality control, alleles and association.
Every file that the steps create is saved in the folder results/guided/ of the project. The list "Files created" at the end of each step gives the file names. To look at a file in RStudio, open the Files pane, click results, then guided.
Read the list of checkpoints that came with your package. This command changes no files:
source("R/guided.R")
cfg <- guided_init()
where_am_i(data_dir = cfg$data_dir, work_dir = cfg$out)
Terminal equivalent: call the R helper through Rscript after you set the same project paths. There is no PLINK command that reports course progress. A checkpoint (opens in a new tab) is a saved state of the course files at the end of a step. The helper check_step("3.2") compares step 3.2 with a supplied checkpoint. The helper restore_checkpoint("3.2") rebuilds the state after step 3.1, so that you can restart step 3.2. Both protect existing output folders.
Before you start the analysis, every state in the updated checkpoint index is not verified. Full genotype sets exist at 2.8, 3.8, 4.6 and 5.7. The other states are rebuilt from stored lists and transformations. Diagnostic and analysis files have their own small checkpoints. The list has about 30 rows, one for each saved state.
A missing checkpoint does not mean that you failed the analysis. The course package may not supply the baseline, lists or index that the checkpoint needs. Ask for the matching updated package. Do not mix versions. A copied list alone does not recreate the genotypes.
To restart step 4.2, which completed step's files do you need?
<details><summary>Show the answer</summary>Step 4.1, from the same course data version.</details>Next: Module 1 explains how the array data arise, from a DNA sample to a scanned chip.