MGHome page

GWAS course

Course map

0 of 64 steps done

Start with step 0.1Install R

Saved in this browser only.

Step 2.4

Module 2 · Files and formats · step 4 of 8

2.4First overview

Commands tested on Windows

In short

We measure the share of missing DNA results for each sample and each site. These reports help us find possible problems before we choose what to remove.

Do this

You should see: You get a sample report and a variant report.

Command

Module setup, needed before this step

R: module setup

source("R/guided.R")cfg <- guided_init()

Blue: PLINK option · Orange: value you can change · Green: file name

R command

Type or paste into the RStudio console.

1out <- guided_path(cfg, "2.4", "missing")2run_plink(cfg, c("--pfile", guided_path(cfg, "2.2"), "--missing", "--out", out))3smiss <- guided_table(paste0(out, ".smiss"))vmiss <- guided_table(paste0(out, ".vmiss"))4summary(as.numeric(smiss$F_MISS))summary(as.numeric(vmiss$F_MISS))
  1. Note 1: Choose the names for the reports of missing results.
  2. Note 2: Measure missing results for each sample and each variant.
  3. Note 3: Read both reports into R.
  4. Note 4: Summarise the share of missing results in each report.

You need

You need the native files from 2.2.

What we do

We measure how much data is missing, before we decide which samples or sites to remove.

Why

The call rate (opens in a new tab) is the fraction of genotypes that were observed. Missingness is one minus the call rate. A missing genotype is also called a no-call.

A sample report asks whether a well has many no-calls. A variant report asks whether a site fails in many wells. We look at both, because they point to different problems.

What each option does

Each option, with the modifiers under the option they belong to.
Option or modifierWhat it does
--pfile

Reads the PGEN, PVAR and PSAM files named results/guided/s2-2_state.

--missing

Writes separate reports of missing DNA results for samples and variants without removing any data.

--out

Starts the report file names with results/guided/s2-4_missing.

Every command also uses --threads 2 (PLINK runs at most two tasks at the same time) and --memory 2048 (PLINK uses at most about 2 GB of memory).

PLINK terminal equivalent. Optional: you do not need it for the course.

Blue: PLINK option · Orange: value you can change · Green: file name

Terminal equivalent: plain PLINK 2

Select any option to see what it does. Do not paste terminal commands into the R console.

Command

bin/plink2

No option selected. Each underlined part of the command is an option you can open.

Use bin\plink2.exe on Windows.

Expected result

Show the expected result

You get a sample report and a variant report. Some values are much worse than the main group. No samples and no variants are removed at this step.

The tested PLINK version is defined in config.R and recorded in software_versions.txt. Validation: executable chunks and the expected counts passed on Windows.

If something goes wrong

If something goes wrong

Stop at the first error message. Check the input file named in the message. Check that the previous step finished. Keep the command and the console output (the text printed in R). Do not use files from a different version of the dataset. See troubleshooting (opens in a new tab).

What this check can reveal

It can reveal a well that performed badly, probes (the DNA pieces on the chip that detect a variant) that failed, or groups of affected samples. A threshold is a rule for deciding. It does not tell you the cause of the problem.

Quick check

If F_MISS is 0.03, what is the call rate?

Show the answer

0.97, or 97%.

Files created

s2-4_missing.smiss, .vmiss and the logs.