vargen_custom: Get variants related to specific genes.

View source: R/VarGen.R

vargen_customR Documentation

Get variants related to specific genes.

Description

Alternative to vargen_pipeline for a set of custom genes. The variants are fetched from the following sources:

  • GENE: get variants on the genes

  • FANTOM5: get the variants on the enhancers / promoters of the genes

  • GTEx: get variants impacting the expression of the genes in specific tissues.

  • GWAS: get variants related to the phenotype of interest from the gwas catalog

Usage

vargen_custom(
  vargen_dir,
  gene_ids,
  fantom_corr = 0.25,
  outdir = "./",
  gtex_tissues,
  gwas_traits,
  gene_mart,
  snp_mart,
  verbose = FALSE
)

Arguments

vargen_dir

directory with the following file (can be generated with vargen_install)

gene_ids

list of ensembl gene IDs of interest

fantom_corr

the minimum correlation (z-score) to consider a FANTOM5 enhancer/gene association valid (default: 0.25). A z-score greater than 0 represents an element greater than the mean, this means that this association has more correlation than random motifs.

outdir

the output directory, some files will be written during the running of this function

gtex_tissues

a vector containing the name of the "signif_variant_gene_pairs.txt.gz" files. Output from select_gtex_tissues can be used.

gwas_traits

a vector with the trait of interest (as characters). The list of available traits can be obtained with list_gwas_traits

gene_mart

optional, a connection to ensembl gene mart, can be created using connect_to_gene_ensembl (If missing this function will be used to create the connection).

snp_mart

optional, a connection to ensembl snp mart, can be created using connect_to_snp_ensembl (If missing this function will be used to create the connection).

verbose

if TRUE, will print progress messages (default: FALSE)

Value

a data.frame with the variants fetched from OMIM, FANTOM5, GTEx and GWAS. The data.frame will contain the following columns:

  • chr (chromosome)

  • pos (position of the variant)

  • rsid (variant ID)

  • ensembl_gene_id ("gene id" of the gene associated with the variant)

  • hgnc_symbol ("hgnc symbol" of the gene associated with the variant)

  • source ("omim", "fantom5", "gtex" or "gwas")

  • trait (an empty string for the gene, fantom and gtex variants, since this comes from a list of genes, no omim id is associated with them. Contains the gwas trait for the gwas variants. )

Examples

# Simple query
vargen_install(install_dir = "./vargen_data/")

vargen_custom(vargen_dir = "./vargen_data/",
              gene_ids = c("ENSG00000166603", "ENSG00000155846"),
              outdir = "./", verbose = TRUE)

# With gwas and gtex
adipose_tissues <- select_gtex_tissues(gtex_dir = "./vargen_data/GTEx_Analysis_v8_eQTL/",
                                       tissues_query = "adipose")
vargen_custom(vargen_dir = "./vargen_data/",
              gene_ids = c("ENSG00000166603", "ENSG00000155846"),
              outdir = "./", verbose = TRUE,
              gtex_tissues = adipose_tissues,
              gwas_traits = "Obesity")

MCorentin/vargen documentation built on Feb. 6, 2024, 2:32 p.m.