xDefineHIC | R Documentation

## Function to extract promoter capture HiC-gene pairs given a list of SNPs

### Description

`xDefineHIC` is supposed to extract HiC-gene pairs given a list of SNPs.

### Usage

    xDefineHIC(
    data = NULL,
    entity = c("SNP", "chr:start-end", "data.frame", "bed", "GRanges"),
    include.HiC = c(NA, "Monocytes", "Macrophages_M0", "Macrophages_M1",
    "Macrophages_M2",
    "Neutrophils", "Megakaryocytes", "Endothelial_precursors",
    "Erythroblasts",
    "Fetal_thymus", "Naive_CD4_T_cells", "Total_CD4_T_cells",
    "Activated_total_CD4_T_cells", "Nonactivated_total_CD4_T_cells",
    "Naive_CD8_T_cells",
    "Total_CD8_T_cells", "Naive_B_cells", "Total_B_cells", "PE.Monocytes",
    "PE.Macrophages_M0", "PE.Macrophages_M1", "PE.Macrophages_M2",
    "PE.Neutrophils",
    "PE.Megakaryocytes", "PE.Erythroblasts", "PE.Naive_CD4_T_cells",
    "PE.Naive_CD8_T_cells", "Combined", "Combined_PE"),
    GR.SNP = c("dbSNP_GWAS", "dbSNP_Common", "dbSNP_Single"),
    verbose = TRUE,
    RData.location = "http://galahad.well.ox.ac.uk/bigdata",
    guid = NULL
    )

### Arguments

`data` | NULL or an input vector containing SNPs. If NULL, all SNPs will be considered. If a input vector containing SNPs, SNPs should be provided as dbSNP ID (ie starting with rs) or in the format of 'chrN:xxx', where N is either 1-22 or X, xxx is number; for example, 'chr16:28525386'. Alternatively, it can be other formats/entities (see the next parameter 'entity')
`entity` | the data entity. By default, it is "SNP". For general use, it can also be one of "chr:start-end", "data.frame", "bed" or "GRanges"
`include.HiC` | genes linked to input SNPs are also included. By default, it is 'NA' to disable this option. Otherwise, those genes linked to SNPs will be included according to Promoter Capture HiC (PCHiC) datasets. Pre-built HiC datasets are detailed in the section 'Note'

`GR.SNP`

the genomic regions of SNPs. By default, it is 'dbSNP_GWAS', that is, SNPs from dbSNP (version 146) restricted to GWAS SNPs and their LD SNPs (hg19). It can be 'dbSNP_Common', that is, Common SNPs from dbSNP (version 146) plus GWAS SNPs and their LD SNPs (hg19). Alternatively, the user can specify the customised input. To do so, first save your RData file (containing an GR object) into your local computer, and make sure the GR object content names refer to dbSNP IDs. Then, tell "GR.SNP" with your RData file name (with or without extension), plus specify your file RData path in "RData.location". Note: you can also load your customised GR object directly

`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
`guid` | a valid (5-character) Global Unique IDentifier for an OSF project. See `xRDataLoader` for details

### Value

If input data is NULL, a data frame with following columns:

- `from`: baited genomic regions (baits)

- `to`: preyed (other end) genomic regions of interactions (preys)

- `score`: CHiCAGO scores quantifying the strength of physical interactions between harbors and partners

If input data is not NULL, a list with two components: "df" and "ig". "df" is a data frame with following columns:

- `from`: 'from/bait' genomic regions

- `to`: 'to/prey' genomic regions

- `score`: CHiCAGO scores quantifying the strength of physical interactions between baits and preys

- `from_genes`: genes associated with 'from/bait' genomic regions

- `to_genes`: genes associated with 'to/prey' genomic regions

- `SNP`: input SNPs (in query)

- `SNP_end`: specify which end SNPs in query fall into (either 'bait/from' or 'prey/to')

- `SNP_harbor`: genomic regions harbors the SNPs in query

- `Context`: the context in which PCHiC data was generated

"ig" is an object of both classes "igraph" and "PCHiC", a direct graph with nodes for genomic regions and edges for CHiCAGO scores between them. Also added node attribute is 1) 'target' storing genes assocated and 2) 'SNP' for input SNPs (if the node harboring input SNPs). If several cell types are queried, "ig" is actually a list of "igraph"/"PCHiC" objects.

### Note

Pre-built HiC datasets are described below according to the data sources.
1. Promoter Capture HiC datasets in 17 primary blood cell types. Sourced from Cell 2016, 167(5):1369-1384.e19

- `Monocytes`: physical interactions (CHiCAGO score >=5) of promoters (baits) with the other end (preys) in Monocytes.

- `Macrophages_M0`: promoter interactomes in Macrophages M0.

- `Macrophages_M1`: promoter interactomes in Macrophages M1.

- `Macrophages_M2`: promoter interactomes in Macrophages M2.

- `Neutrophils`: promoter interactomes in Neutrophils.

- `Megakaryocytes`: promoter interactomes in Megakaryocytes.

- `Endothelial_precursors`: promoter interactomes in Endothelial precursors.

- `Erythroblasts`: promoter interactomes in Erythroblasts.

- `Fetal_thymus`: promoter interactomes in Fetal thymus.

- `Naive_CD4_T_cells`: promoter interactomes in Naive CD4+ T cells.

- `Total_CD4_T_cells`: promoter interactomes in Total CD4+ T cells.

- `Activated_total_CD4_T_cells`: promoter interactomes in Activated total CD4+ T cells.

- `Nonactivated_total_CD4_T_cells`: promoter interactomes in Nonactivated total CD4+ T cells.

- `Naive_CD8_T_cells`: promoter interactomes in Naive CD8+ T cells.

- `Total_CD8_T_cells`: promoter interactomes in Total CD8+ T cells.

- `Naive_B_cells`: promoter interactomes in Naive B cells.

- `Total_B_cells`: promoter interactomes in Total B cells.

- `Combined`: promoter interactomes combined above; with score for the number of significant cell types plus scaled average.

2. Promoter Capture HiC datasets (involving active promoters and enhancers) in 9 primary blood cell types. Sourced from Cell 2016, 167(5):1369-1384.e19

- `PE.Monocytes`: physical interactions (CHiCAGO score >=5) of promoters (baits) with the other end (enhancers as preys) in Monocytes.

- `PE.Macrophages_M0`: promoter-enhancer interactomes in Macrophages M0.

- `PE.Macrophages_M1`: promoter-enhancer interactomes in Macrophages M1.

- `PE.Macrophages_M2`: promoter-enhancer interactomes in Macrophages M2.

- `PE.Neutrophils`: promoter-enhancer interactomes in Neutrophils.

- `PE.Megakaryocytes`: promoter-enhancer interactomes in Megakaryocytes.

- `PE.Erythroblasts`: promoter-enhancer interactomes in Erythroblasts.

- `PE.Naive_CD4_T_cells`: promoter-enhancer interactomes in Naive CD4+ T cells.

- `PE.Naive_CD8_T_cells`: promoter-enhancer interactomes in Naive CD8+ T cells.

- `Combined_PE`: promoter interactomes combined above; with score for the number of significant cell types plus scaled average.

### See Also

`xRDataLoader`

### Examples

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

    ## End(Not run)

    RData.location <- "http://galahad.well.ox.ac.uk/bigdata"
    ## Not run:
    # a) provide the SNPs with the significance info
    data(ImmunoBase)
    data <- names(ImmunoBase$AS$variants)

    # b) extract HiC-gene pairs given a list of AS SNPs
    PCHiC <- xDefineHIC(data, include.HiC="Monocytes", GR.SNP="dbSNP_GWAS",
    RData.location=RData.location)
    head(PCHiC$df)

    # c) visualise the interaction (a directed graph: bait->prey)
    g <- PCHiC$ig
    ## a node with SNPs colored in 'skyblue' and the one without SNPs in 'pink'
    ## the width in an edge is proportional to the interaction strength
    xPCHiCplot(g, vertex.label.cex=0.5)
    xPCHiCplot(g, glayout=layout_in_circle, vertex.label.cex=0.5)

    ## End(Not run)