Last data update: 2014.03.03

R: p-values for the change-points
segments.pR Documentation

p-values for the change-points

Description

This program computes pseudo p-values and confidence intervals for the change-points found by the circular binary segmentation (CBS) algorithm.

Usage

  segments.p(x, ngrid=100, tol=1e-6, alpha=0.05, search.range=100, nperm=1000)

Arguments

x

an object of class DNAcopy

ngrid

number grid points for the integral

tol

tolerance level for calculating nu

alpha

Confidence level is 1-alpha

search.range

statistic is maximized over nu +/- search.range

nperm

number of permutations for confidence interval

Details

The p-values are obtained by applying Siegmund's approximation for the maximal statistic from binary segmenting consecutive segments within a chromosome. This p-value is only to give the relative importance of the change-points as the CBS is different from the algorithm used here.

The confidence intervals are obtained by a permutation algorithm. The data are permuted to the left and right of the identified change-point and the location of the maximal binary segmentation statistic computed. The confidence interval is given by the quantiles of the permutation distribution of the locations.

The statistical properties of this confidence interval is unknown. It is used to give an idea of the uncertainity on the location of the change-points as the CBS is different from the algorithm used here.

Value

a data frame with ten columns. The maximal statistic from binary segmentation, the p-values and lower and upper alpha/2 confidence limits (as genomic positions) are added to the six columns from the segment command.

NOTE: THE p VALUES ARE APPROXIMATE TAIL PROBABILITIES. ANY VALUE GREATER THAN 0.1 CAN HAVE LARGE ERROR. p > 1 ARE REPLACED WITH 1.

Author(s)

Venkatraman E. Seshan

Examples


# test code on an easy data set
set.seed(25)
genomdat <- rnorm(500, sd=0.1) +
rep(c(-0.2,0.1,1,-0.5,0.2,-0.5,0.1,-0.2),c(137,87,17,49,29,52,87,42))
plot(genomdat)
chrom <- rep(1:2,c(290,210))
maploc <- c(1:290,1:210)
test1 <- segment(CNA(genomdat, chrom, maploc))
segments.p(test1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DNAcopy)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/DNAcopy/segments.p.Rd_%03d_medium.png", width=480, height=480)
> ### Name: segments.p
> ### Title: p-values for the change-points
> ### Aliases: segments.p
> ### Keywords: nonparametric
> 
> ### ** Examples
> 
> 
> # test code on an easy data set
> set.seed(25)
> genomdat <- rnorm(500, sd=0.1) +
+ rep(c(-0.2,0.1,1,-0.5,0.2,-0.5,0.1,-0.2),c(137,87,17,49,29,52,87,42))
> plot(genomdat)
> chrom <- rep(1:2,c(290,210))
> maploc <- c(1:290,1:210)
> test1 <- segment(CNA(genomdat, chrom, maploc))
Analyzing: Sample.1 
> segments.p(test1)
        ID chrom loc.start loc.end num.mark seg.mean    bstat          pval lcl
1 Sample.1     1         1     137      137  -0.2152 24.03078 2.737630e-125 136
2 Sample.1     1       138     224       87   0.1067 34.60293 2.281951e-260 224
3 Sample.1     1       225     241       17   1.0117 49.97221  0.000000e+00 241
4 Sample.1     1       242     290       49  -0.5047       NA            NA  NA
5 Sample.1     2         1      29       29   0.1917 36.92493 1.416848e-296  29
6 Sample.1     2        30      81       52  -0.4892 36.80884 1.797902e-294  81
7 Sample.1     2        82     168       87   0.0992 15.44993  8.418394e-52 167
8 Sample.1     2       169     210       42  -0.1931       NA            NA  NA
  ucl
1 138
2 224
3 241
4  NA
5  29
6  81
7 169
8  NA
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>