Learn R Programming

DNAcopy (version 1.46.0)

exon.segment: Binary segmentation of exon data.

Description

Compute the binary segmentation statistic, location and approximate p-value.

Usage

exon.segment(gene, eloc, edat, ngrid=100, tol=1e-6)

Arguments

gene
gene names in the exon data
eloc
exon locations within gene
edat
exon expressions within gene
ngrid
number grid points for the integral
tol
tolerance level for calculating nu

Value

a matrix with three columns. The maximal statistic from binary segmentation, its location and the p-values for each gene.

Details

The p-values are obtained by applying Siegmund's approximation for the maximal statistic from binary segmenting consecutive segments within a chromosome. These are one-sided test for an increase in expression.

Examples

Run this code

# test code on an easy data set
set.seed(25)
gene <- rep(c("A", "B"), c(30,20))
eloc <- c(1:30, 1:20)
edat <- matrix(rnorm(500), 50, 10)
# changes for gene1 in samples 3 & 7
edat[1:30, 3] <- edat[1:30, 3] + rep(0.9*0:1, c(17, 13))
edat[1:30, 7] <- edat[1:30, 7] + rep(1.1*0:1, c(21, 9))
# changes for gene2 in samples 4 & 7
edat[31:50, 4] <- edat[31:50, 4] + rep(1.1*0:1, c(8, 12))
edat[31:50, 7] <- edat[31:50, 7] + rep(1.2*0:1, c(13, 7))
exon.segment(gene, eloc, edat)

Run the code above in your browser using DataLab