Module 1 · From DNA to array data · step 7 of 11
1.7The export
Commands tested on Windows
In short
We check that the three genotype files are present and that their sizes agree with the sample and DNA site counts. We confirm that they contain 2,016 sample wells and 299,523 sites before we begin the analysis.
Do this
- Paste in the RStudio ConsoleThe R command in the Command section below
You should see: 2,016 sample wells and 299,523 variants.
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.
1initial <- check_bed(cfg$input)2print(initial)stopifnot(initial$samples == 2016L, initial$variants == 299523L)- Note 1: Check the matching genotype files and count their samples and DNA sites.
- Note 2: Display the counts and check the expected starting totals.
You need
The matched laboratory export from step 0.5, and the ideas from steps 1.1 to 1.6.
What we do
Understand how the reports relate to the genotype files used for the analysis.
Why
The report excerpts show how calls are labelled. The complete genotype table for the course is stored in a matching BED/BIM/FAM set (opens in a new tab). The BED file stores the genotypes in a compact binary form. The BIM file describes the variants. The FAM file describes the samples and their order.
These three files belong together as one set. In module 2 we convert them to the native PLINK 2 format, called PGEN/PVAR/PSAM. We check the sample identity and order during the conversion.
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
2,016 sample wells and 299,523 variants. No QC has been applied yet. The first FAM file has no case/control phenotype.
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
Can you combine a BED from one release with a FAM from another if their sample counts match?
Show the answer
No. Equal counts do not prove that the sample identity, the order or the genotypes match.
Files created
None.