filter_loci_by_group_coverage: Filter loci based on coverage threshold per sample per group

Description Usage Arguments Details Value Examples

View source: R/filter_loci_by_group_coverage.R

Description

An optional function to remove loci not satisfying coverage thresholds from filter_loci_by_coverage in a minimum number of samples per group.

Usage

1
filter_loci_by_group_coverage(bs, group_column, min_samples_per_group)

Arguments

bs

a BSseq object.

group_column

a character string indicating the column of pData(bs) to use for determining group membership.

min_samples_per_group

a named integer vector indicating the minimum number of samples with non-zero coverage required for maintaining a locus.

Details

The filter_loci_by_coverage function marked locus/sample pairs in the coverage matrix as 0 if said pair had coverage less than minCount or more than maxCount. This function enforces a threshold on the minimum number of samples per group required for a locus to be tested in downstream testing functions.

Value

A BSseq object with only those loci having min_samples_per_group.

Examples

1
2
3
4
5
6
7
data(BS.cancer.ex, package = 'bsseqData')

filter_loci_by_group_coverage(
    bs = BS.cancer.ex,
    group_column = 'Type',
    min_samples_per_group = c('cancer' = 3, 'normal' = 3)
)

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