GDSAnnotator: Whole-genome variant annotation data manipulation using GDS files

GPLv3GNU General Public License, GPLv3

Introduction

Variant annotation is a critical step in genomic data analysis, facilitating the interpretation of genetic variations and their potential biological significance. As large-scale whole-genome sequencing studies continue to expand, efficient storage, retrieval, and manipulation of variant annotation data have become increasingly important. The Genomic Data Structure (GDS) file format offers a scalable and storage-efficient solution for large genomic datasets, enabling rapid access and computational efficiency.

GDSAnnotator is an R package designed for fast and memory-efficient annotation of variants stored in GDS files. It integrates seamlessly into Bioconductor tools, and utilizes external data resources, e.g., Ensembl Variant Effect Predictor (VEP), SnpEff, gnomAD and FAVOR (Functional Annotation of Variants Online Resource), to provide comprehensive functional annotations, including predicted variant effects and functional characteristics of non-coding variants. Compared to a plain text file, GDS format is 30-40 times more space-efficient when storing whole-genome annotations of FAVOR.

Storing variant annotations in a GDS file was introduced by FAVOR with the annotated GDS (aGDS) format, in which the FAVOR functional annotations of the variants of a study are added to the SeqArray GDS file holding the genotypes. GDSAnnotator generalizes this format to annotation GDS files of any source, with or without genotypes: a whole-genome annotation database (FAVOR, gnomAD, Ensembl VEP, SnpEff, ...) is kept as one GDS file per chromosome and queried by position and alleles, and the annotations of the variants of a study are written into its genotype GDS file; with the FAVOR annotations, this produces an aGDS file.

Installation

Coming soon (the package is being prepared for submission). Once it is available:

if (!requireNamespace("BiocManager", quietly=TRUE))
    install.packages("BiocManager")
BiocManager::install("GDSAnnotator")

Key functions in GDSAnnotator

Function Description
seqToGDS_FAVOR Convert FAVOR CSV files to GDS
seqToGDS_gnomAD Convert gnomAD VCF files to GDS
seqToGDS_VEP Convert Ensembl VEP VCF output to GDS
seqToGDS_SnpEff Convert SnpEff VCF output to GDS
seqAnnotate Annotate variants using the annotation stored in GDS
seqAnnotateVCF Annotate the variants of a VCF file
seqAnnotateGDS Annotate the variants of a SeqArray GDS file
seqAnnotList List the annotations stored in the GDS file
seqValueCounts Calculate the counts of unique values
seqAnnotStat Calculate the summary statistics of variants and annotations
seqAnnotReport Generate a summary report in HTML, Markdown or R Markdown format
seqAnnotGeneTable Per-gene annotation counts, broken down by impact

Example

library(GDSAnnotator)

# FAVOR essential dataset of chromosome 22 (subset)
annot_gds <- system.file("extdata", "favor_chr22_sub.gds", package="GDSAnnotator")

# list the annotations in the gds file (return a DataFrame)
(ann <- seqAnnotList(annot_gds))
## DataFrame with 30 rows and 4 columns
##                       name     type       trait description
##                <character> <factor> <character> <character>
## 1         apc_conservation     Real     Float32          NA
## 2      apc_conservation_v2     Real     Float32          NA
## 3          apc_epigenetics     Real     Float32          NA
## 4   apc_epigenetics_active     Real     Float32          NA
## 5   apc_epigenetics_repr..     Real     Float32          NA
## ...                    ...      ...         ...         ...
## 26  genecode_comprehensi..  Logical       Int32          NA
## 27              genehancer  Logical       Int32          NA
## 28                linsight  Real        Float32          NA
## 29              cadd_phred  Real        Float32          NA
## 30                    rdhs  Logical       Int32          NA

varnm <- ann$name  # use all annotation
snp <- c("22-10510007-T-C", "22-10510038-T-C", "22-10510282-G-C",
    "22-10510303-G-C"  # a fake SNP, return NA
    )  # a list of variants

seqAnnotate(snp, annot_gds, varnm)
## Open ‘favor_chr22_sub.gds’ [1,000 variants]
## [favor_chr22_sub.gds]  # of variants found: 3
## [30] ..............................
## DataFrame with 4 rows and 30 columns
##   apc_conservation apc_conservation_v2 apc_epigenetics apc_epigenetics_active  ...
##          <numeric>           <numeric>       <numeric>              <numeric>
## 1         2.583288            2.232373       0.0874126               0.226559
## 2         4.766045            4.498693       0.0750365               0.226559
## 3         0.393781            0.323713       0.1819110               0.226559
## 4               NA                  NA              NA                     NA
## ......

See also