Module 1 · From DNA to array data · step 1 of 11
1.1SNPs and genotypes
Commands tested on Windows
In short
We read a table describing the DNA sites measured by the array. We count its rows and look at site names, chromosome positions and possible DNA letters to understand what the array measures.
Do this
- Paste in the RStudio ConsoleThe R command in the Command section below
You should see: The annotation contains 299,523 rows.
Command
Module setup, needed before this step
R: module setup
source("R/guided.R")cfg <- guided_init()R command
Type or paste into the RStudio console.
1ann <- guided_table(file.path(cfg$data_dir, "array", "sim2026_array_annotation.tsv"))2cat(nrow(ann), "rows in the annotation\n")head(ann[c("Name", "Chr", "Position_GRCh38", "Ref_Plus", "Alt_Plus")])- Note 1: Read the table describing the DNA sites on the array.
- Note 2: Count the rows and show the first site descriptions.
You need
The checked array annotation file from step 0.5. An annotation (opens in a new tab) is a table that describes each site on the array.
What we do
Learn the difference between a DNA site, an allele and a genotype.
Why
A variant (opens in a new tab) is a position in the DNA where people differ. An allele (opens in a new tab) is one of the possible DNA letters at that position. A single nucleotide polymorphism (SNP) (opens in a new tab) is a variant where one single DNA base changes.
At an ordinary autosomal (opens in a new tab) site, a person carries two copies, one from each parent. A site with the alleles A and G can therefore give three genotypes (opens in a new tab): A/A, A/G or G/G. A missing value is not a fourth allele. The X, Y and mitochondrial chromosomes need different rules for the number of copies. We discuss them at step 4.5.
PLINK terminal equivalent. Optional: you do not need it for the course.
Not applicable: this step needs no PLINK command. The R chunk is the complete command.
R reads or calculates the displayed values without changing the genotype files.
Expected result
Show the expected result
A table with the site name, the chromosome, the GRCh38 (opens in a new tab) position and the two alleles on the plus strand (opens in a new tab). GRCh38 is the version of the human reference genome that gives the positions. The annotation contains 299,523 rows. Array site names are not always rs identifiers.
The tested PLINK version is defined in config.R and recorded in
software_versions.txt. Validation: executable chunks passed on Windows with the supplied simulated dataset.
If something goes wrong
If something goes wrong
Stop at the first error. Check the named input and the previous step. Keep the command and console logs; do not substitute files from a different dataset version. See troubleshooting (opens in a new tab).
Quick check
At a C/T autosomal site, does C/T represent two variants or one genotype?
Show the answer
One genotype at one variant. The person carries one C allele and one T allele.
Files created
None.