pileup_peak-method: Computing read counts on a GRanges object.

Description Usage Arguments Value Author(s) Examples

Description

Given a GRanges object and the path of a .bam file, it creates the corresponding pileup, containing the read counts on each nucleotide of the peaks of the GRanges object. Reads can be extended to a length d, which is an estimate of the length of the sequencing fragment. See the function compute_fragments_length for details. For each peak this method creates a vector containing these counts, i.e. the coverage function for the extended reads along the whole peak.

Usage

1
2
## S4 method for signature 'GRanges'
pileup_peak(object, bamf = NULL, d = NULL)

Arguments

object

GRanges object containing the genomic coordinates of the peaks.

bamf

Path to the .bam file used to compute the coverage function. The associated .bam.bai index file must also be present.

d

integer. Total length of the fragments. Positive and negative reads are extended in their 3' direction. Default is NULL; this value can be estimated by compute_fragments_length.

Value

the GRanges object with the new metadata column counts containing the coverage functions of the peaks.

Author(s)

Alice Parodi, Marco J. Morelli, Laura M. Sangalli, Piercesare Secchi, Simone Vantini

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load the data
# GRanges object

data(GR)

# import the .bam file

bamf <- system.file("extdata", "test.bam", package="FunChIP",
                      mustWork=TRUE)

# extract the first 10 peaks of the GRange
# and compute the corresponding read counts
# with fragment length 160.

peaks <- pileup_peak(GR[1:10], bamf, d = 160)

FunChIP documentation built on Nov. 8, 2020, 4:50 p.m.