Background and introduction

Gene expression is regulated by binding of transcription factors (TF) to genomic DNA. However, many binding sites are in distal regulatory regions, such as enhancers, that are hundreds of kilobases apart from genes. These regulatory regions can physically interact with promoters of regulated genes by chromatin looping interactions. These looping interaction can be measured genome-wide by chromatin conformation capture techniques such as Hi-C or ChIA-PET [@Rao2014; @Tang2015]. Despite many exciting insights into the three-dimensional organization of genomes, these experimental methods are not only elaborate and expansive but also have limited resolution and are only available for a limited number of cell types and conditions. In contrast, the binding sites of TFs can be detected genome-wide by ChIP-seq experiment with high resolution and are available for hundreds of TFs in many cell type and conditions. However, classical analysis of ChIP-seq gives only the direct binding sites of targeted TFs (ChIP-seq peaks) and it is not trivial to associate them to the regulated gene without chromatin looping information. Therefore, we provide a computational method to predict chromatin interactions from only genomic sequence features and ChIP-seq data. The predicted looping interactions can be used to associate TF binding sites (ChIP-seq peaks) or enhancers to regulated genes and thereby improve functional downstream analysis on the level of genes.

In this vignette, we show how to use the R package r Biocpkg("sevenC") to predict chromatin looping interactions between CTCF motifs by using only ChIP-seq data form a single experiment. Furthermore, we show how to train the prediction model using custom data.

A more detailed explanation of the sevenC method together with prediction performance analysis is available in the associated preprint [@Ibn-Salem2018].

Installation

To install the sevenC package, start R and enter:

# install.packages("BiocManager")
BiocManager::install("sevenC")

Predict chromatin looping interactions

Basic usage example

Here we show how to use the r Biocpkg("sevenC") package with default options to predict chromatin looping interactions among CTCF motif locations on the human chromosome 22. As input, we only use CTCF motif locations and a single bigWig file from a STAT1 ChIP-seq experiment in human GM12878 cells [@Dunham2012].

Get motif pairs

library(sevenC)

# load provided CTCF motifs in human genome
motifs <- motif.hg19.CTCF.chr22

# get motifs pairs
gi <- prepareCisPairs(motifs)

Add ChIP-seq data and compute correaltion

# use example ChIP-seq bigWig file
bigWigFile <- system.file("extdata", "GM12878_Stat1.chr22_1-30000000.bigWig", 
  package = "sevenC")

# add ChIP-seq coverage and compute correaltion at motif pairs
gi <- addCor(gi, bigWigFile)
# check if on windows to prevent bigWig reading errors from rtracklayer
if (.Platform$OS.type == 'windows') {
  # use motif data with ChIP-seq coverage
  motifs <- motif.hg19.CTCF.chr22.cov
  gi <- prepareCisPairs(motifs)
  gi <- addCovCor(gi)

} else {
  # use example ChIP-seq bigWig file
  bigWigFile <- system.file("extdata", "GM12878_Stat1.chr22_1-30000000.bigWig", 
    package = "sevenC")

  # add ChIP-seq coverage and compute correaltion at motif pairs
  gi <- addCor(gi, bigWigFile)
}

Predict loops

# predict looping interactions among all motif pairs
loops <- predLoops(gi)

More detailed usage example

Here we show in more detail each step of the loop prediction process. Again, we want to predict chromatin looping interactions among CTCF motif locations on chromosome 22 using a ChIP-seq for STAT1 in human GM12878 cells.

Prepare CTCF motif pairs

First, we need to prepare CTCF motif pairs as candidate anchors for chromatin loop interactions. We use CTCF motif hits in human chromosome 22 as provide by r Biocpkg("sevenC") package. In general, any CTCF motifs can be used if provided as GRanges. To use the motif similarity score as a predictive feature, the motif data should contain -log~10~ transformed p-values describing the significance of each motif hit. Here, we use CTCF motif sites as provided from the JASPAR genome browser tracks [@Khan2018]. The objedt motif.hg19.CTCF.chr22 in the r BiocStyle::Biocpkg("sevenC") package contains CTCF motif locations on chromosome 22. For more information on the motif data set, see ?motif.hg19.CTCF.

library(sevenC)

# load provided CTCF motifs
motifs <- motif.hg19.CTCF.chr22

The CTCF motif are represented as GRanges object from the r BiocStyle::Biocpkg("GenomicRanges") package. There are r length(motifs) CTCF motif locations on chromosome 22. The genome assembly is hg19. one metadata column named score shows motif match similarity as -log~10~ transformed p-value.

Add ChIP-seq signals at motifs sites

To predict loops, we need the ChIP-seq signals at all motif sites. Therefore, we read an example bigWig file with ChIP-seq signals.

An example file with only data on a subset of chromosome 22 is provided as part of the r BiocStyle::Biocpkg("sevenC") package. The full file can be downloaded from ENCODE [@Dunham2012] here. The file contains for each position in the genome the log-fold-change of ChIP-seq signals versus input control.

# use example ChIP-seq bigWig file
bigWigFile <- system.file("extdata", "GM12878_Stat1.chr22_1-30000000.bigWig", 
  package = "sevenC")

We add ChIP-seq signals to all motifs in a window of 1000 bp using the function addCovToGR() as follows.

# read ChIP-seq coverage 
motifs <- addCovToGR(motifs, bigWigFile)
# check if OS is windows
if (.Platform$OS.type == 'windows') {
  motifs <- motif.hg19.CTCF.chr22.cov
} else {
  # read ChIP-seq coverage 
  motifs <- addCovToGR(motifs, bigWigFile)
}

This adds a new metadata column to motifs holding a NumericList with ChIP-seq signals for each motif location.

motifs$chip

Please note, on Windows systems, reading of bigWig files is currently not supported. See help(rtracklayer::import.bw) for more information. Users on Windows need to get ChIP-seq signals around motif sites as a NumierList object. A NumericList l with ChIP-signal counts around each motif list can be added by motifs$chip <- l.

Build pairs of motifs as candidate interactions

Now we build a dataset with all pairs of CTCF motif within 1 Mb and annotate it with distance, motif orientation, and motif score.

gi <- prepareCisPairs(motifs, maxDist = 10^6)

gi

The function prepareCisPairs() returns a GInteractoin object from the r BiocStyle::Biocpkg("InteractonSet") package, representing all motif pairs within the defined distance. The metadata columns of the GInteractoin object hold the genomic distance between motifs in bp (dist), the orientation of motifs (strandOrientation), and the motif score as -log~10~ of the motif hit p-value (score_1, score_2, and score_min). Note, that the function prepareCisPairs() is a wrapper for three individual functions that perform each step separately and allow more options. First, getCisPairs() is used to builds the GInteractoin object. Than addStrandCombination() adds the four possible strand combinations of motifs pairs. Finally, addMotifScore() adds the minimum motif score for each pair. These genomic features are used later as predictive variables.

Compute ChIP-seq similarity at motif pairs

Now, we compute the similarity of ChIP-seq signals for all motif pairs as the correlation of signals across positions around motif centers. Thereby, for two motifs the corresponding ChIP-seq signal vectors that were added to motifs before, are compared by Pearson correlation. A high correlation of ChIP-seq signals at two motifs indicates a similar ChIP-seq coverage profile at the two motifs. This, in turn, is characteristic for physical interaction via chromatin looping, where ChIP signals are found on both sides with a similar distance to motif centers [@Ibn-Salem2018]. The correlation coefficient is added as additional metadata column to gi.

# add ChIP-seq coverage and compute correaltion at motif pairs
gi <- addCovCor(gi)

Predict loops

Now we can predict chromatin loops integrating from the ChIP-seq correlation and other genomic features in a logistic regression model. This is implemented in the predLoops() function.

loops <- predLoops(gi)

loops

The predLoops() function returns a subset of motif pairs that are predicted to interact. The interactions are annotated with ChIP-seq correlation in column cor_chip. The column pred holds the predicted interaction probability according to the logistic regression model.

Note, that without specifying further options, the function predLoops() uses a default model that was optimized for several transcription factor ChIP-seq datasets by using experimental chromatin loops from Hi-C and ChIA-PET for validations [@Ibn-Salem2018]. However, users can specify custom features using the formula argument and provide custom parameters using the betas argument. Furthermore, per default the predLoops() function report only looping interactions that reach a minimal prediction score threshold. The fraction of reported loops can be modified using the cutoff argument.

Downstream analysis with predicted chromatin loops

Linking sets of regions

Predicted loops are represented as GInteraction and can, therefore, be used easily for downstream analysis with functions from the r BiocStyle::Biocpkg("InteractonSet") package. For example, linking two sets of regions (like ChIP-seq peaks and genes) can be done using the linkOverlaps function. See the vignette from the r BiocStyle::Biocpkg("InteractonSet") package for more details and examples on working with GInteraction objects.

Write predicted loops to an output file

Since looping interactions are stored as GInteraction objects, they can be exported as BEDPE files using functions from r BiocStyle::Biocpkg("GenomicInteractions") package. These files can be used for visualization in genome browsers or the Juicebox tool.

library(GenomicInteractions)

# export to output file
export.bedpe(loops, "loop_interactions.bedpe", score = "pred")

Train prediction model using custom data

Here, we show how to use r BiocStyle::Biocpkg("sevenC") to build and train a logistic regression model for loop prediction.

Prepare motif pairs and add ChIP-seq data

First, we need to build the pairs of motifs as candidates and add the ChIP-seq data as shown above.

# load provided CTCF motifs
motifs <- motif.hg19.CTCF.chr22

# use example ChIP-seq coverage file
bigWigFile <- system.file("extdata", "GM12878_Stat1.chr22_1-30000000.bigWig", 
  package = "sevenC")

# add ChIP-seq coverage
motifs <- addCovToGR(motifs, bigWigFile)

# build motif pairs
gi <- prepareCisPairs(motifs, maxDist = 10^6)

# add correaltion of ChIP-signal
gi <- addCovCor(gi)
# check if OS is windows
if (.Platform$OS.type == 'windows') {
  motifs <- motif.hg19.CTCF.chr22.cov
} else {
  # load provided CTCF motifs
  motifs <- motif.hg19.CTCF.chr22

  # use example ChIP-seq coverage file
  bigWigFile <- system.file("extdata", "GM12878_Stat1.chr22_1-30000000.bigWig", 
    package = "sevenC")

  # add ChIP-seq coverage
  motifs <- addCovToGR(motifs, bigWigFile)
}

gi <- prepareCisPairs(motifs, maxDist = 10^6)

# add correaltion of ChIP-signal
gi <- addCovCor(gi)

Train predictor with known loops

We need to label true looping interactions by using experimental data of chromatin interactions. Here, we use loops from high-resolution Hi-C experiments in human GM12878 cells [@Rao2014]. An example file with loops on chromosome 22 is provided with the r BiocStyle::Biocpkg("sevenC") package and the function parseLoopsRao() reads loops in the format provided by Rao et al. and returns a GInteraction object.

# parse known loops
knownLoopFile <- system.file("extdata", 
  "GM12878_HiCCUPS.chr22_1-30000000.loop.txt", package = "sevenC")

knownLoops <- parseLoopsRao(knownLoopFile)

We can add a new metadata column to the motif pairs gi, indicating whether the pair is interacting in the experimental data using the function addInteractionSupport().

# add known loops
gi <- addInteractionSupport(gi, knownLoops)

The experimental support is added as factor with levels "Loop" and "No loop" as metadata column named loop. The column name can be modified using the colname argument.

Train logistic regression model

We can use the R function glm() to fit a logistic regression model in which the loop column is the dependent variable and the ChIP-seq correlation, distance, and strand orientation are the predictors.

fit <- glm(
  formula = loop ~ cor_chip + dist + strandOrientation, 
  data = mcols(gi), 
  family = binomial()
  )

Predict loops with a custom model

Now, we can use this model to add predicted looping probabilities.

# add predict loops
gi <- predLoops(
  gi,
  formula = loop ~ cor_chip + dist + strandOrientation,
  betas = coef(fit),
  cutoff = NULL
)

Here, we have to use the same formula as argument as in the model fitting step above. The betas argument takes the coefficients of the logistic regression model. Finally, the argument cutoff = NULL ensures that no filtering is done and all input candidates are reported. The prediction score is added as a new metadata column to gi.

gi 

As a very simple validation, we can now compare the prediction score for looping and non-looping motif pairs using a boxplot.

boxplot(gi$pred ~ gi$loop, 
        ylab = "Predicted interaction probability")

The plot shows higher prediction scores for truly looping motif pairs. However, this is an insufficient evaluation of prediction performance, since the prediction score is evaluated on the same data as it was trained. A more detailed evaluation of prediction performance using cross-validation and different cell types is described in the 7C paper [@Ibn-Salem2018].

Session info

sessionInfo()

References



ibn-salem/chromloop documentation built on May 18, 2019, 1:29 a.m.