calc_asm: Calculate ASM Score

View source: R/calc_asm.R

calc_asmR Documentation

Calculate ASM Score

Description

This function takes in a list of samples resulting from the read_tuples function and returns a SummarizedExperiment of Allele-Specific Methylation (ASM) scores, where each row is a tuple and each column is a sample.

Usage

calc_asm(
  sampleList,
  beta = 0.5,
  a = 0.2,
  transform = modulus_sqrt,
  coverage = 5,
  verbose = TRUE
)

Arguments

sampleList

List of samples returned from read_tuples

beta

The beta parameter used to calculate the weight in the ASM score. link{calc_weight} uses this parameter to penalize fully methylated or unmethylated tuples. Default = 0.5.

a

The distance from 0.5 allowed, where 0.5 is a perfect MM:UU balance for a tuple. In the default mode this value is set to 0.2, and we account for the instances where the balance is between 0.3 and 0.7.

transform

Transform the calculated tuple ASM scores. We use the modulus square root function which outputs the square root, while preserving the original sign.

coverage

Remove tuples with total reads below coverage. Default = 5.

verbose

If the function should be verbose. Default = TRUE.

Details

Calculates ASM score for a list of samples in the output format of the result of read_tuples This functions uses the following other functions: process, calcScore, calcWeight.

Value

A SummarizedExperiment of ASM scores where the rows are all the tuples and the columns the sample names.

Examples

DATA_PATH_DIR <- system.file('extdata', '.', package = 'DAMEfinder')
get_data_path <- function(file_name) file.path(DATA_PATH_DIR, file_name)

tuple_files <- list.files(DATA_PATH_DIR, '.tsv.gz')
tuple_files <- get_data_path(tuple_files)
ASM <- read_tuples(tuple_files, c('CRC1', 'NORM1'))
ASMscore <- calc_asm(ASM)


markrobinsonuzh/DAMEfinder documentation built on April 7, 2023, 6:37 a.m.