filter_loci_by_coverage: Filter BSseq object by coverage

Description Usage Arguments Value Examples

View source: R/filter_loci_by_coverage.R

Description

Used after bsseq::read.bismark to mark loci in samples below min_count or above max_count to 0. These loci will then be removed prior to differential analysis by filter_loci_by_group_coverage() if there are not a sufficient number of samples with appropriate coverage.

Usage

1
filter_loci_by_coverage(bs, min_count = 5, max_count = 500)

Arguments

bs

a BSseq object resulting from bsseq::read.bismark or constructed manually by the user.

min_count

an integer giving the minimum coverage required at a locus.

max_count

an integer giving the maximum coverage allowed at a locus.

Value

A BSseq object with samples/loci in the coverage and methylation matrix set to 0 where the coverage was less than min_count or greater than max_count. The number of samples and loci are conserved.

Examples

1
2
3
4
5
6
7
8
9
bis_cov_file1 = system.file('extdata', 'bis_cov1.cov', package = 'methylSig')
bis_cov_file2 = system.file('extdata', 'bis_cov2.cov', package = 'methylSig')
test = bsseq::read.bismark(
    files = c(bis_cov_file1, bis_cov_file2),
    colData = data.frame(row.names = c('test1','test2')),
    rmZeroCov = FALSE,
    strandCollapse = FALSE
)
test = filter_loci_by_coverage(bs = test, min_count = 10, max_count = 500)

methylSig documentation built on Nov. 8, 2020, 8:25 p.m.