Introduction to GWASinspector

Comprehensive, efficient and easy to use quality control of genome-wide association study results

Alireza Ani

2019-07-31

Overview

This vignette introduces the GWASinspector package, its general form and how to run the algorithm on multiple GWAS files:

Check our website for further information and reference data sets.


Installation

  1. The easiest way to get GWASinspector is to install it from CRAN:

  2. Alternatively, you can use the installation function and zipped package from our website:


Available functions

This package includes functions for checking prerequisite libraries on the local machine, setting up QC parameters and running the QC on GWAS result files.


Required files

Reference panels

Comparing result files with an standard reference panel is the most important part of the QC process. This reference is used to check the alleles in the datasets and to ensure they are all in the same configuration (same strand, same coded alleles) in the post-QC data.

We have created databases from the most popular refernece panel (e.g. HapMap, 1000G, HRC) which are available from our website. Database files are in SQLite format and can be downloaded as a compressed file.

Some reference panles include more than one population which should be set as a parameter in the configuration file before running the algorithm.

The header-translation table

Column names in the input files might be different among cohorts. For example, CODED_ALLELE and EFFECT_ALLELE have the same defintion and both should be converted to the same name when compared together. The simplest way is to use a table for translate popular column names to a standard name for consistency of the output files.

A sample file including common terms is provided as part of the package and could be used as a template. The file contains a two-column table, with the left column containing the standard column-names and the right the alternatives.

configuration file

INI file format is used for configuring the desired parameters and settings for running the algorithm and has three componenets:

Key or property
The basic element contained in an INI file is the key or property. Every key has a name and a value, delimited by an equals sign (=). The name appears to the left of the equals sign.
Sections
Keys mare grouped into arbitrarily named sections. The section name appears on a line by itself, in square brackets ([ and ])
Comments
Semicolons (;) at the beginning of the line indicate a comment. Comment lines are ignored.

Key-names and section-names should not be edited or renamed. Otherwise the algorithm will not work properly.

A sample file is included in the package which should be used as a template. File paths and QC parameters are are set according to comments and examples in the file.


Step-by-step guide to run a QC

This walkthrough explains how to run QC on a sample result file.

Step 1: make sure the package is installed correctly

After installation, try loading the package with the following command. You might see some warnings but the package should load successfully without any errors.

require(GWASinspector)

Step 2: check R environment

local machine and R environment can be explored by running the following function.

system.check()

This provides information about existing and missing libraries. There are some optional libraries that can be used for better user experience. Refer to the manual for further information.

Step 3: download the standard allele-frequency reference datasets

Standard allele-frequency reference datasets are available from our website. This file should be decompressed and copied in the references folder (dir_references parameter of the config file).

Step 4: get the header-translation table

A copy of this file can be copied to a local folder by running this command. This is a text file which includes most common variable/header names and can be edited according to user specifications. This file should be copied in the references folder (dir_references parameter of the config file).

The default name of this file is alt_headers.txt. header_translations field should be edited in the configuration file accrodingly if this name is changed by user.

Notice: Duplicated entries will stop the algorihtm.

Step 5: get the configuration file

This is a text file and is used for configuring the desired parameters and settings for running the algorithm. A sample file can be copied to local folder by running the following command (config.ini).

The default name of this file is config.ini. This can be changed by user.

Step 6: modify the parameters in the configuration file

Please refer to the configuration file or package manual for full detail of parameters.

Step 7: run the QC function

QC functions starts with the following command. Please refer to the package manual for full detail of parameters.

inspect('/path/to/configuration/file')

All result files and reports are saved in the output folder. An exhaustive log file indicates all steps and can be used for localization of any problems during this run.