retrievePeaks: retrievePeaks

View source: R/local_processing.R

retrievePeaksR Documentation

retrievePeaks

Description

Given a peak calls for a set of samples, for each sample, get the peaks which overlap a specified genomic region of interest. Typically, this corresponds to the region for which we will construct a feature matrix representing peaks in the region in order to call a chromatin state switch.

Usage

retrievePeaks(peaks, metadata, region)

Arguments

peaks

List of GRanges objects storing peak calls for each sample

metadata

Dataframe with a column "Sample" which stores the sample identifiers, and at least one column, titled by the histone mark or ChIP-seq target, storing paths to the BED files containing peak calls

region

GRanges object specifying one genomic region, the query region

Value

LocalPeaks object as described in LocalPeaks

Examples


samples <- c("E068", "E071", "E074", "E101", "E102", "E110")
bedfiles <- system.file("extdata", paste0(samples, ".H3K4me3.bed"),
package = "chromswitch")

metadata <- data.frame(Sample = samples,
    H3K4me3 = bedfiles,
    stringsAsFactors = FALSE)

retrievePeaks(H3K4me3,
    metadata = metadata,
    region = GRanges(seqnames = "chr19",
    ranges = IRanges(start = 54924104, end = 54929104)))


sjessa/chromswitch documentation built on Feb. 4, 2024, 2:04 a.m.