calcThreshold-methods: Calculate Read Count Threshold

Description Usage Arguments Details Value Author(s) References Examples

Description

Based on the counts from countReads, sample counts from the set several times, estimate the parameters of the negative binomial distribution for each sample, then calculate the mean of the parameters (size and mu). Use these values to calculate the read count threshold, given the specified p-value threshold.

Usage

1
calcThreshold(obj, reps=100, sampleSize=30000, p=0.99,cores=1)

Arguments

obj

A GreyList object for which to calculate the threshold.

reps

The number of times to sample bins and estimate the parameters of the negative binomial distribution.

sampleSize

The number of bins to sample on each repetition.

p

The p-value threshold for marking bins as “grey”.

cores

The number of CPU cores (parallel threads) to use when sampling repeatedly from the set of counts

Details

This method samples from the set of counts generated during the countReads step. Each sample is fitted to the negative binomial distribution, and the parameters estimated. The means of the mu and size parameters is calculated, then used to choose a read count threshold, given the p-value cutoff provided. If cores is given, the process will use that many cores to parallelize the parameter estimation.

Value

The modified GreyList object, with the threshold added.

Author(s)

Gord Brown

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

Examples

1
2
3
4
5
# Load a pre-built R object with counts.
data(greyList)

# Calculate the threshold:
gl <- calcThreshold(greyList,reps=10,sampleSize=1000,p=0.99,cores=1)

GreyListChIP documentation built on Nov. 8, 2020, 5:22 p.m.