ConsensusPeaks: ConsensusPeaks: A wrapper for peak merging functions

Description Usage Arguments Value Examples

View source: R/ConsensusPeaks.R

Description

ConsensusPeaks: A wrapper for peak merging functions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
ConsensusPeaks(
  GENES = "all",
  PEAKS,
  RNA.OR.DNA = c("rna", "dna"),
  METHOD = c("dpc", "hmm"),
  GTF = NULL,
  DP.RESOLUTION = 50,
  DP.ITERATIONS = 1000,
  DP.WEIGHT.THRESHOLD = 0.2,
  DP.N.SD = 1,
  DP.ALPHA.PRIORS = c(1, 2),
  DP.SEED = 123,
  PLOT.MERGED.PEAKS = F,
  OUTPUT.TAG = "",
  OUTPUTDIR = ".",
  WRITE.OUTPUT = T,
  DIAGNOSTIC = F,
  FIT.MIXTURE = T,
  ANNOTATION = NULL
)

Arguments

GENES

A character vector of genes to be tested

PEAKS

A data frame containing the following columns, and potentially extras, usually found in a BED12 file, base 0 system

chr

chromosomes, character, same format as those identified in GTF file

start

starting position of the peak, integer. base 0

end

end position of the peak, integer, base 0

name

gene id, character

score

p-value associated with the peak

strand

strand of the gene, only +, -, * are accepted

blockCount

number of segments in the peak, integer

blockSizes

size of segments in the peak, BED12 notation, comma-separated

blockStarts

starting positions of segments, BED12 notation, comma-separated

sample

sample_id of samples, character

RNA.OR.DNA

One of 'rna' or 'dna' indicating whether peaks are identified on the transcriptome or genome

METHOD

One 'dpc', 'union', 'corces'

dpc

A GMM is fitted on the peaks using a Dirichlet process prior

union

The union of overlapping peaks is reported

coerces

A 'daisy chain' model described in Coerces et al., 2012, Science, where the most statistically significant peak is chosen

GTF

The path to a GTF file, character string.

DP.RESOLUTION

If the METHOD is 'dpc', specify the resolution of the provided PEAKS data.frame. This usually corresponds to the bin width chosen when the peaks are called, a positive integer.

DP.ITERATIONS

If the METHOD is 'dpc', specify the number of iterations used to fit the GMM, a positive integer.

DP.WEIGHT.THRESHOLD

If the METHOD is 'dpc', specify the minimum weight used to threshold the Gaussians. This value is required to be numeric and between 0 and 1.

DP.N.SD

If the METHOD is 'dpc', specify the standard deviation of the Gaussians required to identify peak boundaries, numeric value, above 0.

DP.ALPHA.PRIORS

If the METHOD is 'dpc', specify the priors (alpha, beta) for the Gamma distribution from which the weight concentration prior is drawn, numeric vector of length 2

DP.SEED

A seed for reproducibility, integer above 0.

PLOT.MERGED.PEAKS

Either a logical value (TRUE or FALSE) indicating all or none of the merged peaks should be plotted. Otherwise, a character vector of genes whose merged peaks should be plotted.

OUTPUT.TAG

A character string added to the names of any output files.

OUTPUTDIR

Output directory. If the directory does not exist, ConsensusPeaks will attempt to create the directory.

WRITE.OUTPUT

A logical value indicating whether the output table should be written.

ANNOTATION

Value

A data frame with the same columns as 'PEAKS' indicating the coordinates of the merged peaks in genomic coordinates. If the method is 'dpc', additional columns with the sample names of the samples will indicate the merged p-value using Fisher's Method.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data.path = system.file("extdata", package = "ConsensusPeaks")
gtf = paste0(data.path, "/test.gtf")
peaks.file = paste0(data.path, "/peaks.bed")
peaks = read.table(peaks.file, header = F, sep = '\t', stringsAsFactors = F)
colnames(peaks) = c("chr", "start", "end", "name", "score", "strand", "thickStart", "thickEnd", "itemRGB", "blockCount", "blockSizes", "blockStarts", "sample")

results = ConsensusPeaks(
GENES = c("ENSGXX", "ENSGYY"),
PEAKS = peaks,
RNA.OR.DNA = "rna",
METHOD = "dpc",
GTF = gtf,
DP.RESOLUTION = 10,
DP.ITERATIONS = 1000,
DP.WEIGHT.THRESHOLD = 0.1,
DP.N.SD = 1.5,
DP.ALPHA.PRIORS = c(0.5,5),
DP.SEED = 123,
PLOT.MERGED.PEAKS = F,
OUTPUT.TAG = "TEST",
OUTPUTDIR = ".",
WRITE.OUTPUT = F)

helen-zhu/ConsensusPeaks documentation built on Dec. 25, 2021, 9:39 a.m.