Module 1 · From DNA to array data · step 4 of 11
1.4From sample to scanned chip
Commands tested on Windows
In short
We read the sample sheet and count measurements on each laboratory plate. We count labelled repeat measurements and check that the sheet has 2,016 rows, because one person can have more than one measurement.
Do this
- Paste in the RStudio ConsoleThe R command in the Command section below
You should see: Twenty-one plates, each with 96 wells, give 2,016 measurements.
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.
1sheet <- read.csv(file.path(cfg$data_dir, "lab_export", "sample_sheet.csv"), colClasses = "character")2table(sheet$Plate)sum(nzchar(sheet$Replicate_of))3stopifnot(nrow(sheet) == 2016L)- Note 1: Read the sample sheet as text to preserve sample labels.
- Note 2: Count measurements on each plate and labelled repeat measurements.
- Note 3: Check that the sheet contains 2,016 measurements.
You need
The sample sheet from step 0.5. The sample sheet (opens in a new tab) lists every well with its plate, its sample name and any replicate label.
What we do
Follow the identity of a sample through a plate and a laboratory well.
Why
Several laboratory steps come before the export. The laboratory extracts the DNA, checks its concentration, copies it, cuts it into pieces, hybridises it to the chip, stains it and scans it.
A plate (opens in a new tab) is a tray that holds laboratory wells processed together. A well is one small hole in the tray that holds one sample. A well can contain a technical replicate (opens in a new tab), which is a second measurement of the same person. So one row in a laboratory file is not always one unique person.
A batch effect (opens in a new tab) is a systematic difference caused by how samples were processed, for example by a faulty plate. It is not caused by the phenotype (opens in a new tab), the trait that we study.
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
Twenty-one plates, each with 96 wells, give 2,016 measurements. Sixteen wells are labelled as technical replicates. The simulation started from 2,000 people.
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
A plate has 96 wells and two are replicates of other wells. Must it contain 96 different people?
Show the answer
No. A well is one measurement. A person is one biological individual.
Files created
None.