BiocStyle::markdown()
knitr::opts_chunk$set(dev="png",fig.show="hold",
               fig.width=8,fig.height=4.5,fig.align="center",
               message=FALSE,collapse=TRUE)
set.seed(1)

Author: Jia Meng, PhD, r Sys.Date()

Installation

To install exomePeak from Github, use the following code:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install(c("Rsamtools","GenomicFeatures","rtracklayer","GenomicAlignments"))

if (!requireNamespace("devtools", quietly = TRUE))
    install.packages("devtools")
devtools::install_github("ZW-xjtlu/exomePeak")
library(exomePeak)

Introduction

The exomePeak R-package has been developed based on the MATLAB exomePeak package, for the analysis of RNA epitranscriptome sequencing data with affinity-based shotgun sequencing approach, such as MeRIP-Seq or m6A-Seq. The inputs of the main function exomePeak are the IP BAM files and input control BAM files with optional gene annotation file. The exomePeak package fullfills the following two key functions:

Gene annotation can be provided as a GTF file, a TxDb object, or automatically downloaded from UCSC through the internet.

We will in the next see how the two main functions can be accomplished in a single command.

Peak Calling

Let us firstly load the package and get the toy data (came with the package) ready.

library("exomePeak")
gtf <- system.file("extdata", "example.gtf", package="exomePeak")
f1 <- system.file("extdata", "IP1.bam", package="exomePeak")
f2 <- system.file("extdata", "IP2.bam", package="exomePeak")
f3 <- system.file("extdata", "IP3.bam", package="exomePeak")
f4 <- system.file("extdata", "IP4.bam", package="exomePeak")
f5 <- system.file("extdata", "Input1.bam", package="exomePeak")
f6 <- system.file("extdata", "Input2.bam", package="exomePeak")
f7 <- system.file("extdata", "Input3.bam", package="exomePeak")

The first main function of exomePeak R-package is to call peaks (enriched binding sites) to detect RNA methylation sites on the exome. Inputs are the gene annotation GTF file, IP and Input control samples in BAM format. This function is used when data from only one condition is available.

result <- exomepeak(GENE_ANNO_GTF=gtf,
                   IP_BAM=c(f1,f2,f3,f4),
                   INPUT_BAM=c(f5,f6,f7))
names(result)

The results will be saved in the specified output directory, including the identified peaks and consistent peaks in BED or XLS (tab-delimited) format. The BED format can be visualized in genome browser directly and the peaks may span one or multiple introns. The difference between peak and consistent peak is that, the peaks in the con_peak file are consitently enriched in all the IP replicates, so indicates higher re-producability.

The first 12 columns in both the BED and the XLS are the same as a standard BED12 format: http://genome.ucsc.edu/FAQ/FAQformat.html_format1


The meaning of the last 3 columns of the xls file is:


recommended_peaks <- result$con_peaks # consistent peaks (Recommended!)
peaks_info <- mcols(recommended_peaks) # information of the consistent peaks
head(peaks_info)

or to get all the peak detected (some of them do not consistently appear on all replicates):

all_peaks <- result$all_peaks # get all peaks
peaks_info <- mcols(all_peaks) # information of all peaks
head(peaks_info)

Peak Calling and Differential Methylation Analysis

When there are MeRIP-Seq data available from two experimental conditions, the exomePeak function may can unveil the dynamics in post-transcriptional regulation of the RNA methylome. In the following example, the function will report the sites that are post-transcriptional differentially methylated between the two tested conditions (TREATED vs. UNTREATED).

Again, let us firstly load the package and get the toy data (came with the package) ready.

library("exomePeak")
gtf <- system.file("extdata", "example.gtf", package="exomePeak")
f1 <- system.file("extdata", "IP1.bam", package="exomePeak")
f2 <- system.file("extdata", "IP2.bam", package="exomePeak")
f3 <- system.file("extdata", "IP3.bam", package="exomePeak")
f4 <- system.file("extdata", "IP4.bam", package="exomePeak")
f5 <- system.file("extdata", "Input1.bam", package="exomePeak")
f6 <- system.file("extdata", "Input2.bam", package="exomePeak")
f7 <- system.file("extdata", "Input3.bam", package="exomePeak")
f8 <- system.file("extdata", "treated_IP1.bam", package="exomePeak")
f9 <- system.file("extdata", "treated_Input1.bam", package="exomePeak")

Please note that, this time we have two additional bam files obtained under a different "Treated" condition, i.e., f8 and f9.

result <- exomepeak(GENE_ANNO_GTF=gtf,
                   IP_BAM=c(f1,f2,f3,f4),
                   INPUT_BAM=c(f5,f6,f7),
                   TREATED_IP_BAM=c(f8),
                   TREATED_INPUT_BAM=c(f9))

The algorithm will firstly identify reads enriched binding sites or peaks, and then check whether the sites are differentially methylated between the two experimental conditions. The results will be saved in the specified output directory, including the identified (consistent) peaks in BED and tab-delimited formats, along with the differential information indicating whether the site is hyper- or hypo-methylated under the treated condition. Similar to the peak calling case, the BED format can be visualized in genome browser directly and the peaks may span one or multiple introns.

Similar to the peak calling case, the function will report a set of consistent differentially methylated peaks (con_sig_diff_peak.xls) saved in the specified folder, which is the recommended set.


Along with the XLS files, the matched BED files are also generated for visualization purpose.

Similar to before,


The function also returns 3 GRangesList object, containing all the peaks, the differentially methylated peaks with the given threshold on the merged data, consistently differentially methylated peaks. The consistent differentially methylated peaks in the last appear to be differential for all the replicates and is thus recommended. The information of the identified peaks and the differential analysis are stored as metadata, which can be extracted.

names(result)
is.na(result$con_sig_diff_peaks) # no reported consistent differnetial peaks

Unfortunately, there is no reported consistent differnetial peaks on the toy data, to get the information of all the peaks and the differential analysis information:

diff_peaks <- result$diff_peaks # consistent differential peaks (Recommended!)
peaks_info <- mcols(diff_peaks) # information of the consistent peaks
head(peaks_info[,1:3]) # peak calling information
head(peaks_info[,4:6]) # differential analysis information

Download Gene Annotation Directly from Internet

Gene annotation may be alternatively downloaded directly from internet, but will take a really long time due to the downloading time and huge transcriptome needed to be scanned.

result <- exomepeak(GENOME="hg19",
                   IP_BAM=c(f1,f2,f3,f4),
                   INPUT_BAM=c(f5,f6,f7),
                   TREATED_IP_BAM=c(f8),
                   TREATED_INPUT_BAM=c(f9))

Please make sure to use the right genome assembly.

Handling Paired-end Reads

Unfortunately, exomePeak currently supports pair-end data in a naive mode, i.e., treat pair of reads as two independent reads rather than a single fragment. "treat pair of reads as two independent reads rather than a single fragment" refers to the internal process of exomePeak package, not how you align the reads. Even if the paired end data is aligned as paired end data, the pairing information will still be ignored when analyzed by exomePeak.

sessionInfo()


ZhenWei10/exomePeak documentation built on April 8, 2020, 1:21 a.m.