Learn R Programming

consensusSeekeR (version 1.0.2)

readNarrowPeakFile: Extract narrow regions and peaks from a narrrowPeak file

Description

Read a narrowPeak file and extract the narrow regions and/or the peaks, as specified by used. The narrowPeak file must fit the UCSC specifications. See https://genome.ucsc.edu/FAQ/FAQformat.html#format12 for more details. The file can have one or many header lines. However, the total number of header lines must be inferior to 250 lines.

Usage

readNarrowPeakFile(file_path, extractRegions = TRUE, extractPeaks = TRUE)

Arguments

file_path
the name of the file.
extractRegions
a logical indicating if the narrow regions must be extracted. If TRUE, a GRanges containing the narrow regions will be returned. Otherwise, NULL is returned. Default = TRUE.
extractPeaks
a logical indicating if the peaks must be extracted. If TRUE, a GRanges containing the peaks will be returned. Otherwise, NULL is returned. Default = TRUE.

Value

a list containing 2 entries:
  • narrowPeak a GRanges containing the narrow regions extracted from the file. NULL when not needed by user.
  • peak a GRanges containing the peaks extracted from the file. NULL when not

Examples

Run this code

## Set file information
test_narrowPeak <- system.file("extdata",
            "A549_FOSL2_ENCSR000BQO_MZW_part_chr_1_and_12.narrowPeak",
            package = "consensusSeekeR")

## Read file to extract peaks and regions
data <- readNarrowPeakFile(test_narrowPeak, extractRegions = TRUE,
            extractPeaks = TRUE)

## To access peak data (GRanges format)
head(data$peak)

## To access region data (GRanges format)
head(data$narrowPeak)

Run the code above in your browser using DataLab