downsample: Downsample analysis

Description Usage Arguments Value Examples

View source: R/downsample.R

Description

Downsample the CpG coverage matrix for saturation analysis

Usage

1
2
downsample(bs, dsRates = c(0.01, 0.02, 0.05, seq(0.1, 0.9, 0.1)),
  subSample = 1e+06, offset = 50000)

Arguments

bs

bsseq object

dsRates

downsampling rate. i.e. the probabaility of sampling a single CpG default is list of probabilities ranging from 0.01 to 1 0.01 0.02 0.05 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 For more continuous saturation curve dsRates can be changed to add more sampling rates

subSample

number of CpGs to subsample Default value is 1000000.

offset

how many CpGs to offset when subsampling Default value is set to be 50000, i.e. first 50000 CpGs will be ignored in subsampling.

Value

Data frame with the CpG coverage for each sample at each sampling rate

Examples

1
2
3
directory <- system.file("extdata/bismark_data", package='scmeth')
bs <- HDF5Array::loadHDF5SummarizedExperiment(directory)
scmeth::downsample(bs)

scmeth documentation built on Nov. 8, 2020, 6:21 p.m.