calc_weight: Calculate Weight for ASM Score

Description Usage Arguments Details Value

View source: R/calc_asm.R

Description

This function calculates a weight which reflects MM to UU balance, where M stands for methylated and U for unmethylated. Given the MM and UU counts for a particular tuple, the weight is obtained using the link{pbeta} function.

Usage

1
calc_weight(MM, UU, beta = 0.5, a = 0.2)

Arguments

MM

The read counts for where pos1 and pos2 of the tuple were both methylated.

UU

The read counts for where pos1 and pos2 of the tuple were both unmethylated.

beta

parameter for the beta distribution. In B(alpha,beta), we set alpha=beta=0.5 by default.

a

parameter for how far from 0.5 we go as a measure of allele-specific methylation. The weight is the probability that the MM:(MM+UU) ratio is between 0.5-a and 0.5+a. The default is set to 0.2.

Details

For a given tuple with MM and UU counts, the weight that reflects allele-scpecificity is calculated as follows:

Value

A number that reflects allele-specificity given MM and UU counts for a CpG pair. This is used as a weight that is multiplied by the log odds ratio to give the final ASM score of that tuple.

#calc_weight(MM=50, UU=50) #0.9999716

#calc_weight(MM=20, UU=60) #0.1646916


DAMEfinder documentation built on Nov. 8, 2020, 11:10 p.m.