Filter matrices by coverage

coverage_filter(
  m,
  cov_thr = 1,
  min_samples = 1,
  prop_samples = 0,
  group = NULL,
  n_chunks = 1,
  n_cores = 1
)

Arguments

m

methrix object

cov_thr

minimum coverage required to call a loci covered

min_samples

Minimum number of samples that should have a loci with coverage >= cov_thr. If group is given, then this applies per group. Only need one of prop_samples or min_samples.

prop_samples

Minimum proportion of samples that should have a loci with coverage >= cov_thr. If group is given, then this applies per group. Only need one of prop_samples or min_samples.

group

a column name from sample annotation that defines groups. In this case, the number of min_samples will be tested group-wise.

n_chunks

Number of chunks to split the methrix object in case it is very large. Default = 1.

n_cores

Number of parallel instances. n_cores should be less than or equal to n_chunks. If n_chunks is not specified, then n_chunks is initialized to be equal to n_cores. Default = 1.

Value

An object of class methrix

Details

Takes methrix object and filters CpGs based on coverage statistics

Examples

data('methrix_data') #keep only CpGs which are covered by at-least 1 read across 3 samples coverage_filter(m = methrix_data, cov_thr = 1, min_samples = 3)
#> -Retained 693 of 743 sites
#> -Finished in: 0.456s elapsed (0.456s cpu)
#> An object of class methrix #> n_CpGs: 693 #> n_samples: 4 #> is_h5: FALSE #> Reference: hg19