xSNP2eGenes | R Documentation

## Function to define eQTL genes given a list of SNPs or a customised eQTL mapping data

### Description

`xSNP2eGenes` is supposed to define eQTL genes given a list of SNPs or a customised eQTL mapping data. The eQTL weight is calcualted as Cumulative Distribution Function of negative log-transformed eQTL-reported signficance level.

### Usage

    xSNP2eGenes(data, include.eQTL = c(NA, "JKscience_CD14",
    "JKscience_LPS2",
    "JKscience_LPS24", "JKscience_IFN", "JKscience_TS2A",
    "JKscience_TS2A_CD14",
    "JKscience_TS2A_LPS2", "JKscience_TS2A_LPS24", "JKscience_TS2A_IFN",
    "JKscience_TS2B", "JKscience_TS2B_CD14", "JKscience_TS2B_LPS2",
    "JKscience_TS2B_LPS24", "JKscience_TS2B_IFN", "JKscience_TS3A",
    "JKng_bcell",
    "JKng_bcell_cis", "JKng_bcell_trans", "JKng_mono", "JKng_mono_cis",
    "JKng_mono_trans", "JKpg_CD4", "JKpg_CD4_cis", "JKpg_CD4_trans",
    "JKpg_CD8",
    "JKpg_CD8_cis", "JKpg_CD8_trans", "JKnc_neutro", "JKnc_neutro_cis",
    "JKnc_neutro_trans", "WESTRAng_blood", "WESTRAng_blood_cis",
    "WESTRAng_blood_trans", "JK_nk", "JK_nk_cis", "JK_nk_trans",
    "GTEx_V4_Adipose_Subcutaneous", "GTEx_V4_Artery_Aorta",
    "GTEx_V4_Artery_Tibial", "GTEx_V4_Esophagus_Mucosa",
    "GTEx_V4_Esophagus_Muscularis", "GTEx_V4_Heart_Left_Ventricle",
    "GTEx_V4_Lung", "GTEx_V4_Muscle_Skeletal", "GTEx_V4_Nerve_Tibial",
    "GTEx_V4_Skin_Sun_Exposed_Lower_leg", "GTEx_V4_Stomach",
    "GTEx_V4_Thyroid",
    "GTEx_V4_Whole_Blood", "GTEx_V6p_Adipose_Subcutaneous",
    "GTEx_V6p_Adipose_Visceral_Omentum", "GTEx_V6p_Adrenal_Gland",
    "GTEx_V6p_Artery_Aorta", "GTEx_V6p_Artery_Coronary",
    "GTEx_V6p_Artery_Tibial",
    "GTEx_V6p_Brain_Anterior_cingulate_cortex_BA24",
    "GTEx_V6p_Brain_Caudate_basal_ganglia",
    "GTEx_V6p_Brain_Cerebellar_Hemisphere", "GTEx_V6p_Brain_Cerebellum",
    "GTEx_V6p_Brain_Cortex", "GTEx_V6p_Brain_Frontal_Cortex_BA9",
    "GTEx_V6p_Brain_Hippocampus", "GTEx_V6p_Brain_Hypothalamus",
    "GTEx_V6p_Brain_Nucleus_accumbens_basal_ganglia",
    "GTEx_V6p_Brain_Putamen_basal_ganglia",
    "GTEx_V6p_Breast_Mammary_Tissue",
    "GTEx_V6p_Cells_EBVtransformed_lymphocytes",
    "GTEx_V6p_Cells_Transformed_fibroblasts", "GTEx_V6p_Colon_Sigmoid",
    "GTEx_V6p_Colon_Transverse",
    "GTEx_V6p_Esophagus_Gastroesophageal_Junction",
    "GTEx_V6p_Esophagus_Mucosa", "GTEx_V6p_Esophagus_Muscularis",
    "GTEx_V6p_Heart_Atrial_Appendage", "GTEx_V6p_Heart_Left_Ventricle",
    "GTEx_V6p_Liver", "GTEx_V6p_Lung", "GTEx_V6p_Muscle_Skeletal",
    "GTEx_V6p_Nerve_Tibial", "GTEx_V6p_Ovary", "GTEx_V6p_Pancreas",
    "GTEx_V6p_Pituitary", "GTEx_V6p_Prostate",
    "GTEx_V6p_Skin_Not_Sun_Exposed_Suprapubic",
    "GTEx_V6p_Skin_Sun_Exposed_Lower_leg",
    "GTEx_V6p_Small_Intestine_Terminal_Ileum", "GTEx_V6p_Spleen",
    "GTEx_V6p_Stomach", "GTEx_V6p_Testis", "GTEx_V6p_Thyroid",
    "GTEx_V6p_Uterus",
    "GTEx_V6p_Vagina", "GTEx_V6p_Whole_Blood"), eQTL.customised = NULL,
    cdf.function = c("empirical", "exponential"), plot = FALSE,
    verbose = TRUE, RData.location =
    "http://galahad.well.ox.ac.uk/bigdata")

### Arguments

`data` | an input vector containing SNPs. SNPs should be provided as dbSNP ID (ie starting with rs). Alternatively, they can be in the format of 'chrN:xxx', where N is either 1-22 or X, xxx is number; for example, 'chr16:28525386'
`include.eQTL` | genes modulated by eQTL (also Lead SNPs or in LD with Lead SNPs) are also included. By default, it is 'NA' to disable this option. Otherwise, those genes modulated by eQTL will be included. Pre-built eQTL datasets are detailed in the section 'Note'
`eQTL.customised` | a user-input matrix or data frame with 4 columns: 1st column for SNPs/eQTLs, 2nd column for Genes, 3rd for eQTL mapping significance level (p-values or FDR), and 4th for contexts (required even though only one context is input). Alternatively, it can be a file containing these 4 columns. It is designed to allow the user analysing their eQTL data. This customisation (if provided) will populate built-in eQTL data
`cdf.function` | a character specifying a Cumulative Distribution Function (cdf). It can be one of 'exponential' based on exponential cdf, 'empirical' for empirical cdf
`plot` | logical to indicate whether the histogram plot (plus density or CDF plot) should be drawn. By default, it sets to false for no plotting
`verbose` | logical to indicate whether the messages will be displayed in the screen. By default, it sets to true for display
`RData.location` | the characters to tell the location of built-in RData files. See `xRDataLoader` for details

### Value

a data frame with following columns:

- `Gene`: eQTL-containing genes

- `SNP`: eQTLs

- `Sig`: the eQTL mapping significant level (the best/minimum)

- `Weight`: the eQTL weight

### Note

Pre-built eQTL datasets are described below according to the data sources.
1. Context-specific eQTLs in monocytes: resting and activating states. Sourced from Science 2014, 343(6175):1246949

- `JKscience_TS2A`: cis-eQTLs in either state (based on 228 individuals with expression data available for all experimental conditions).

- `JKscience_TS2A_CD14`: cis-eQTLs only in the resting/CD14+ state (based on 228 individuals).

- `JKscience_TS2A_LPS2`: cis-eQTLs only in the activating state induced by 2-hour LPS (based on 228 individuals).

- `JKscience_TS2A_LPS24`: cis-eQTLs only in the activating state induced by 24-hour LPS (based on 228 individuals).

- `JKscience_TS2A_IFN`: cis-eQTLs only in the activating state induced by 24-hour interferon-gamma (based on 228 individuals).

- `JKscience_TS2B`: cis-eQTLs in either state (based on 432 individuals).

- `JKscience_TS2B_CD14`: cis-eQTLs only in the resting/CD14+ state (based on 432 individuals).

- `JKscience_TS2B_LPS2`: cis-eQTLs only in the activating state induced by 2-hour LPS (based on 432 individuals).

- `JKscience_TS2B_LPS24`: cis-eQTLs only in the activating state induced by 24-hour LPS (based on 432 individuals).

- `JKscience_TS2B_IFN`: cis-eQTLs only in the activating state induced by 24-hour interferon-gamma (based on 432 individuals).

- `JKscience_TS3A`: trans-eQTLs in either state.

- `JKscience_CD14`: cis and trans-eQTLs in the resting/CD14+ state (based on 228 individuals).

- `JKscience_LPS2`: cis and trans-eQTLs in the activating state induced by 2-hour LPS (based on 228 individuals).

- `JKscience_LPS24`: cis and trans-eQTLs in the activating state induced by 24-hour LPS (based on 228 individuals).

- `JKscience_IFN`: cis and trans-eQTLs in the activating state induced by 24-hour interferon-gamma (based on 228 individuals).

2. eQTLs in B cells. Sourced from Nature Genetics 2012, 44(5):502-510

- `JKng_bcell`: cis- and trans-eQTLs.

- `JKng_bcell_cis`: cis-eQTLs only.

- `JKng_bcell_trans`: trans-eQTLs only.

3. eQTLs in monocytes. Sourced from Nature Genetics 2012, 44(5):502-510

- `JKng_mono`: cis- and trans-eQTLs.

- `JKng_mono_cis`: cis-eQTLs only.

- `JKng_mono_trans`: trans-eQTLs only.

4. eQTLs in neutrophils. Sourced from Nature Communications 2015, 7(6):7545

- `JKnc_neutro`: cis- and trans-eQTLs.

- `JKnc_neutro_cis`: cis-eQTLs only.

- `JKnc_neutro_trans`: trans-eQTLs only.

5. eQTLs in NK cells. Unpublished

- `JK_nk`: cis- and trans-eQTLs.

- `JK_nk_cis`: cis-eQTLs only.

- `JK_nk_trans`: trans-eQTLs only.

6. Tissue-specific eQTLs from GTEx (version 4; incuding 13 tissues). Sourced from Science 2015, 348(6235):648-60

- `GTEx_V4_Adipose_Subcutaneous`: cis-eQTLs in tissue 'Adipose Subcutaneous'.

- `GTEx_V4_Artery_Aorta`: cis-eQTLs in tissue 'Artery Aorta'.

- `GTEx_V4_Artery_Tibial`: cis-eQTLs in tissue 'Artery Tibial'.

- `GTEx_V4_Esophagus_Mucosa`: cis-eQTLs in tissue 'Esophagus Mucosa'.

- `GTEx_V4_Esophagus_Muscularis`: cis-eQTLs in tissue 'Esophagus Muscularis'.

- `GTEx_V4_Heart_Left_Ventricle`: cis-eQTLs in tissue 'Heart Left Ventricle'.

- `GTEx_V4_Lung`: cis-eQTLs in tissue 'Lung'.

- `GTEx_V4_Muscle_Skeletal`: cis-eQTLs in tissue 'Muscle Skeletal'.

- `GTEx_V4_Nerve_Tibial`: cis-eQTLs in tissue 'Nerve Tibial'.

- `GTEx_V4_Skin_Sun_Exposed_Lower_leg`: cis-eQTLs in tissue 'Skin Sun Exposed Lower leg'.

- `GTEx_V4_Stomach`: cis-eQTLs in tissue 'Stomach'.

- `GTEx_V4_Thyroid`: cis-eQTLs in tissue 'Thyroid'.

- `GTEx_V4_Whole_Blood`: cis-eQTLs in tissue 'Whole Blood'.

7. eQTLs in CD4 T cells. Sourced from PLoS Genetics 2017

- `JKpg_CD4`: cis- and trans-eQTLs.

- `JKpg_CD4_cis`: cis-eQTLs only.

- `JKpg_CD4_trans`: trans-eQTLs only.

8. eQTLs in CD8 T cells. Sourced from PLoS Genetics 2017

- `JKpg_CD8`: cis- and trans-eQTLs.

- `JKpg_CD8_cis`: cis-eQTLs only.

- `JKpg_CD8_trans`: trans-eQTLs only.

9. eQTLs in blood. Sourced from Nature Genetics 2013, 45(10):1238-1243

- `WESTRAng_blood`: cis- and trans-eQTLs.

- `WESTRAng_blood_cis`: cis-eQTLs only.

- `WESTRAng_blood_trans`: trans-eQTLs only.

10. Tissue-specific eQTLs from GTEx (version 6p; including 44 tissues). Sourced from http://www.biorxiv.org/content/early/2016/09/09/074450

- `GTEx_V6p_Adipose_Subcutaneous`: cis-eQTLs in tissue "Adipose Subcutaneous".

- `GTEx_V6p_Adipose_Visceral_Omentum`: cis-eQTLs in tissue "Adipose Visceral (Omentum)".

- `GTEx_V6p_Adrenal_Gland`: cis-eQTLs in tissue "Adrenal Gland".

- `GTEx_V6p_Artery_Aorta`: cis-eQTLs in tissue "Artery Aorta".

- `GTEx_V6p_Artery_Coronary`: cis-eQTLs in tissue "Artery Coronary".

- `GTEx_V6p_Artery_Tibial`: cis-eQTLs in tissue "Artery Tibial".

- `GTEx_V6p_Brain_Anterior_cingulate_cortex_BA24`: cis-eQTLs in tissue "Brain Anterior cingulate cortex (BA24)".

- `GTEx_V6p_Brain_Caudate_basal_ganglia`: cis-eQTLs in tissue "Brain Caudate (basal ganglia)".

- `GTEx_V6p_Brain_Cerebellar_Hemisphere`: cis-eQTLs in tissue "Brain Cerebellar Hemisphere".

- `GTEx_V6p_Brain_Cerebellum`: cis-eQTLs in tissue "Brain Cerebellum".

- `GTEx_V6p_Brain_Cortex`: cis-eQTLs in tissue "Brain Cortex".

- `GTEx_V6p_Brain_Frontal_Cortex_BA9`: cis-eQTLs in tissue "Brain Frontal Cortex (BA9)".

- `GTEx_V6p_Brain_Hippocampus`: cis-eQTLs in tissue "Brain Hippocampus".

- `GTEx_V6p_Brain_Hypothalamus`: cis-eQTLs in tissue "Brain Hypothalamus".

- `GTEx_V6p_Brain_Nucleus_accumbens_basal_ganglia`: cis-eQTLs in tissue "Brain Nucleus accumbens (basal ganglia)".

- `GTEx_V6p_Brain_Putamen_basal_ganglia`: cis-eQTLs in tissue "Brain Putamen (basal ganglia)".

- `GTEx_V6p_Breast_Mammary_Tissue`: cis-eQTLs in tissue "Breast Mammary Tissue".

- `GTEx_V6p_Cells_EBVtransformed_lymphocytes`: cis-eQTLs in tissue "Cells EBV-transformed lymphocytes".

- `GTEx_V6p_Cells_Transformed_fibroblasts`: cis-eQTLs in tissue "Cells Transformed fibroblasts".

- `GTEx_V6p_Colon_Sigmoid`: cis-eQTLs in tissue "Colon Sigmoid".

- `GTEx_V6p_Colon_Transverse`: cis-eQTLs in tissue "Colon Transverse".

- `GTEx_V6p_Esophagus_Gastroesophageal_Junction`: cis-eQTLs in tissue "Esophagus Gastroesophageal Junction".

- `GTEx_V6p_Esophagus_Mucosa`: cis-eQTLs in tissue "Esophagus Mucosa".

- `GTEx_V6p_Esophagus_Muscularis`: cis-eQTLs in tissue "Esophagus Muscularis".

- `GTEx_V6p_Heart_Atrial_Appendage`: cis-eQTLs in tissue "Heart Atrial Appendage".

- `GTEx_V6p_Heart_Left_Ventricle`: cis-eQTLs in tissue "Heart Left Ventricle".

- `GTEx_V6p_Liver`: cis-eQTLs in tissue "Liver".

- `GTEx_V6p_Lung`: cis-eQTLs in tissue "Lung".

- `GTEx_V6p_Muscle_Skeletal`: cis-eQTLs in tissue "Muscle Skeletal".

- `GTEx_V6p_Nerve_Tibial`: cis-eQTLs in tissue "Nerve Tibial".

- `GTEx_V6p_Ovary`: cis-eQTLs in tissue "Ovary".

- `GTEx_V6p_Pancreas`: cis-eQTLs in tissue "Pancreas".

- `GTEx_V6p_Pituitary`: cis-eQTLs in tissue "Pituitary".

- `GTEx_V6p_Prostate`: cis-eQTLs in tissue "Prostate".

- `GTEx_V6p_Skin_Not_Sun_Exposed_Suprapubic`: cis-eQTLs in tissue "Skin Not Sun Exposed (Suprapubic)".

- `GTEx_V6p_Skin_Sun_Exposed_Lower_leg`: cis-eQTLs in tissue "Skin Sun Exposed (Lower leg)".

- `GTEx_V6p_Small_Intestine_Terminal_Ileum`: cis-eQTLs in tissue "Small Intestine Terminal Ileum".

- `GTEx_V6p_Spleen`: cis-eQTLs in tissue "Spleen".

- `GTEx_V6p_Stomach`: cis-eQTLs in tissue "Stomach".

- `GTEx_V6p_Testis`: cis-eQTLs in tissue "Testis".

- `GTEx_V6p_Thyroid`: cis-eQTLs in tissue "Thyroid".

- `GTEx_V6p_Uterus`: cis-eQTLs in tissue "Uterus".

- `GTEx_V6p_Vagina`: cis-eQTLs in tissue "Vagina".

- `GTEx_V6p_Whole_Blood`: cis-eQTLs in tissue "Whole Blood".

### See Also

`xRDataLoader`

### Examples

    ## Not run:
    # Load the library
    library(Pi)

    ## End(Not run)

    RData.location <- "http://galahad.well.ox.ac.uk/bigdata_dev"
    ## Not run:
    # a) provide the SNPs with the significance info
    ## get lead SNPs reported in AS GWAS and their significance info (p-values)
    #data.file <- "http://galahad.well.ox.ac.uk/bigdata/AS.txt"
    #AS <- read.delim(data.file, header=TRUE, stringsAsFactors=FALSE)
    ImmunoBase <- xRDataLoader(RData.customised='ImmunoBase',
    RData.location=RData.location)
    gr <- ImmunoBase$AS$variants
    AS <- as.data.frame(GenomicRanges::mcols(gr)[, c('Variant','Pvalue')])

    # b) define eQTL genes
    df_eGenes <- xSNP2eGenes(data=AS[,1], include.eQTL="JKscience_TS2A",
    RData.location=RData.location)

    ## End(Not run)