getLogitFracMeth: Helper function for compartment inference

Description Usage Arguments Value Functions Examples

View source: R/getLogitFracMeth.R

Description

Want an object with nominally Gaussian error for compartment inference, so this function uses 'suitable' (defaults to to 3 or more reads in 2 or more samples) measurements. Using Dirichlet smoothing (adding 'k' reads to M and U), these measurements are then turned into lightly moderated, logit-transformed methylated-fraction estimates for compartment calling.

Usage

1
2
3
getLogitFracMeth(x, minCov = 3, minSamp = 2, k = 0.1, r = NULL)

getMvals(x, minCov = 3, minSamp = 2, k = 0.1, r = NULL)

Arguments

x

A bsseq object with methylated and total reads

minCov

Minimum read coverage for landmarking samples (DEFAULT: 3)

minSamp

Minimum landmark samples with at least minCov (DEFAULT: 2)

k

Pseudoreads for smoothing (DEFAULT: 0.1)

r

Regions to collapse over - if NULL, do it by CpG (DEFAULT: NULL)

Value

1
    Smoothed logit(M / Cov) GRanges with coordinates as row names

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  orig_bed <- system.file("extdata", "MCF7_Cunha_chr11p15.bed.gz",
                          package="biscuiteer")
  orig_vcf <- system.file("extdata", "MCF7_Cunha_header_only.vcf.gz",
                          package="biscuiteer")
  bisc <- readBiscuit(BEDfile = orig_bed, VCFfile = orig_vcf,
                      merged = FALSE)

  reg <- GRanges(seqnames = rep("chr11",5),
                 strand = rep("*",5),
                 ranges = IRanges(start = c(0,2.8e6,1.17e7,1.38e7,1.69e7),
                                  end= c(2.8e6,1.17e7,1.38e7,1.69e7,2.2e7))
                 )

  frac <- getLogitFracMeth(bisc, minSamp = 1, r = reg)

biscuiteer documentation built on Nov. 8, 2020, 8:28 p.m.