LocalPeaks-class: LocalPeaks

LocalPeaks-classR Documentation

LocalPeaks

Description

The LocalPeaks class is a container for the peaks for one or more marks for a set of samples in a specific genomic region of interest, as well as the genomic region itself, and the sample IDs. These components are needed to convert sets of peaks into rectangular feature-by-sample matrices which we can then use for downstream analysis - and in particular, as input to a clustering algorithm in order to call a chromatin state switch.

Usage

## S4 method for signature 'LocalPeaks'
region(x)
## S4 method for signature 'LocalPeaks'
samples(object)
## S4 method for signature 'LocalPeaks'
peaks(x)

Arguments

x

LocalPeaks object, as returned by retrievePeaks

object

LocalPeaks object, as returned by retrievePeaks

Value

LocalPeaks object

Slots

region

A GRanges object specifying one genomic region, the query region

peaks

List of lists of GRanges objects. Each outer list stores peaks for each sample for one mark in region.

samples

Character vector with sample identifiers.

Methods

region:

Access region slot of LocalPeaks object.

samples:

Access samples slot of LocalPeaks object.

peaks:

Access peaks slot of LocalPeaks object.

Examples


# Assemble dataset
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)

# Obtain a LocalPeaks object by retrieving the peaks in the query region
lpk <- retrievePeaks(H3K4me3,
    metadata = metadata,
    region = GRanges(seqnames = "chr19",
    ranges = IRanges(start = 54924104, end = 54929104)))

# lpk now stores the query region, samples, and associated peaks overlapping
# the query region

# Get the samples from the object
samples(lpk)

# Get the query region associated with the object
region(lpk)

# Get the set of peaks in each sample which overlap with the query region
peaks(lpk)



selinj/chromswitch documentation built on Jan. 27, 2024, 12:36 p.m.