富集評估

在 R 中使用 Bioconductor 進行 ChIP-seq

Peter Humburg

Statistician, Macquarie University

在 R 中使用 Bioconductor 進行 ChIP-seq

在 R 中使用 Bioconductor 進行 ChIP-seq

延伸 reads

載入資料:

reads <- readGAlignments(bam)
reads_gr <- granges(reads[[1]])

取得平均片段長度:

frag_length <- fragmentlength(qc_report)["GSM1598218"]

延伸 reads 並計算覆蓋度:

reads_ext <- resize(reads_gr, width=frag_length)
cover_ext <- coverage(reads_ext)
在 R 中使用 Bioconductor 進行 ChIP-seq

在 R 中使用 Bioconductor 進行 ChIP-seq

峰值覆蓋度

在全基因組建立 200 bp 區塊。

bins <- tileGenome(seqinfo(reads), tilewidth=200, 
                   cut.last.tile.in.chrom=TRUE)

找出與峰值重疊的所有區塊。

peak_bins_overlap <- findOverlaps(bins, peaks)
peak_bins <- bins[from(peak_bins_overlap), ]

計算每個峰值區塊重疊的 read 數量。

peak_bins$score <- countOverlaps(peak_bins, reads)
在 R 中使用 Bioconductor 進行 ChIP-seq

分箱覆蓋度函式

count_bins <- function(reads, target, bins){
  # Find all bins overlapping peaks
  overlap <- from(findOverlaps(bins, target))
  target_bins <- bins[overlap, ]

  # Count the number of reads overlapping each peak bin
  target_bins$score <- countOverlaps(target_bins, reads)
  target_bins
}
在 R 中使用 Bioconductor 進行 ChIP-seq

黑名單區域的覆蓋度

peak_bins <- count_bins(reads_ext, peaks, bins)
bl_bins <- count_bins(reads_ext, blacklist.hg19, bins)
在 R 中使用 Bioconductor 進行 ChIP-seq

背景覆蓋度

移除已納入計算的所有區塊。

bkg_bins <- subset(bins, !bins %in% peak_bins & !bins %in% bl_bins)

計算每個剩餘區塊重疊的 read 數量。

bkg_bins$score <- countOverlaps(bkg_bins, reads_ext)
在 R 中使用 Bioconductor 進行 ChIP-seq

在 R 中使用 Bioconductor 進行 ChIP-seq

在 R 中使用 Bioconductor 進行 ChIP-seq

在 R 中使用 Bioconductor 進行 ChIP-seq

一起來練習吧!

在 R 中使用 Bioconductor 進行 ChIP-seq

Preparing Video For Download...