readNarrowPeak {chromswitch} | R Documentation

## readNarrowPeak

### 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

    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

    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)

[Package chromswitch version 1.8.0 Index]