readNarrowPeak: readNarrowPeak

Description Usage Arguments Value Examples

View source: R/read.R

Description

A helper function for reading in narrow peak calls for a set of samples. Peak calls are assumed to be in ENCODE narrowPeak format (https://genome.ucsc.edu/FAQ/FAQformat.html#format12) as returned by MACS2 (http://liulab.dfci.harvard.edu/MACS/). This is BED6+4 format.

Usage

1
readNarrowPeak(paths, metadata)

Arguments

paths

Character vector storing paths for BED files containing peak calls for each sample, in the same order as in the Sample column of metadata.

metadata

A dataframe with at least two columns: "Sample" which stores the sample identifiers, and "Condition" which stores the biological condition labels of the samples.

Value

Named list of GRanges objects containing peak calls for each sample.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
samples <- c("E068", "E071", "E074", "E101", "E102", "E110")
bedfiles <- system.file("extdata", paste0(samples, ".H3K4me3.bed"),
package = "chromswitch")
Conditions <- c(rep("Brain", 3), rep("Other", 3))

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

readNarrowPeak(bedfiles, metadata)

chromswitch documentation built on Nov. 8, 2020, 5:24 p.m.