ChIP-seq s Bioconductor v R
Peter Humburg
Statistician, Macquarie University


Načtení dat:
reads <- readGAlignments(bam)
reads_gr <- granges(reads[[1]])
Získání průměrné délky fragmentu:
frag_length <- fragmentlength(qc_report)["GSM1598218"]
Rozšíření čtení a výpočet pokrytí:
reads_ext <- resize(reads_gr, width=frag_length)
cover_ext <- coverage(reads_ext)

Vytvoření 200 bp binů podél genomu.
bins <- tileGenome(seqinfo(reads), tilewidth=200,
cut.last.tile.in.chrom=TRUE)
Nalezení všech binů překrývajících se s peaky.
peak_bins_overlap <- findOverlaps(bins, peaks)
peak_bins <- bins[from(peak_bins_overlap), ]
Spočítání počtu čtení překrývajících se s každým peakovým binem.
peak_bins$score <- countOverlaps(peak_bins, reads)
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
}
peak_bins <- count_bins(reads_ext, peaks, bins)
bl_bins <- count_bins(reads_ext, blacklist.hg19, bins)
Odstraňte všechny již zahrnuté biny.
bkg_bins <- subset(bins, !bins %in% peak_bins & !bins %in% bl_bins)
Spočítejte počet čtení překrývajících se s každým zbývajícím binem.
bkg_bins$score <- countOverlaps(bkg_bins, reads_ext)



ChIP-seq s Bioconductor v R