Compute p-values for each peak based on distances between histograms

Share:

Description

Compute p-values for each peak based on distances between histograms, contrasting group1 (e.g. control samples) with group2 (e.g. treatment samples). To estimate within group distances and between group distances peaks are pooled according to their mean (normalized) total counts. p-values are adjusted for multiple testing using the method by Benjamini & Hochberg (1995).

Usage

1
2
3
4
5
6
detPeakPvals(DBA, method = "MMD", group1, group2,
             name1 = "g1", name2 = "g2", Usefiltered = TRUE,
             PeakIDs = NULL,
             quantprobs = seq(0, 1,0.05),
             fieldName = "NormTotalCounts",bNormWidth=FALSE,
             bSampleMean = FALSE, overWrite =  FALSE)

Arguments

DBA

DBA object, after running getPeakProfiles and compHistDists.

method

which distance method should be used. (can be 'MMD','GMD' or 'Pearson')

group1

sample ids of control group

group2

sample ids of treatment group

name1

name of control group

name2

name of treatment group

Usefiltered

If TRUE, only peaks that have passed the filter to detect Outliers are used. findOutlier must be run first, otherwise all peaks are used

PeakIDs

specify a subset of peaks which should be used for pooling (for example if outliers with extreme counts should be excluded)

quantprobs

numeric vector of probabilities with values in [0,1], used to specify which peaks are pooled together to estimate variances.

fieldName

name of list element in DBA$MD that is used for pooling of peaks. (e.g. NormTotalCounts or RawTotalCounts)

bNormWidth

logical indicating if counts should be normalized by peak width

bSampleMean

If true counts are averaged across all samples. Otherwise means are computed for each group separately.

overWrite

if TRUE, previous computed p-values are overwritten

Value

DBA object, with additional element Pvals added to MD. Pvals again contains a list element named according to method applied (MMD). e.g. DBA$MD$Pvals$MMD This element is a matrix (nPeaks x ncomps) containing p-values for each peak and given comparison (group1 vs. group2). New comparisons (i.e. re-running detPeakPvals with different groups) are appended to the matrix.

Author(s)

Gabriele Schweikert

See Also

getPeakProfiles, getNormFactors, compHistDists, plotHistDists, plotPeak

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# load DBA objects with peak profiles and pairwise distances
data(Cfp1Dists)

# specify controll and treatment groups:
group1 <- c("WT.AB2", "Resc.AB2")
group2 <- c("Null.AB2")

# determine empirical p-values:
Cfp1Pvals <- detPeakPvals(Cfp1Dists, group1=group1, group2=group2,
                          name1='Wt/Resc', name2='Null')

# to plot distances and peaks which are significantly different use the
# plotHistDists function:

plotHistDists(Cfp1Pvals, group1=group1, group2=group2) 
## End(Not run)