calculatePvalue: Calculate the significance of the matches for the reference...

View source: R/scoreMotif.R

calculatePvalueR Documentation

Calculate the significance of the matches for the reference and alternate alleles for the for their PWM

Description

Calculate the significance of the matches for the reference and alternate alleles for the for their PWM

Usage

calculatePvalue(
  results,
  background = c(A = 0.25, C = 0.25, G = 0.25, T = 0.25),
  granularity = NULL,
  BPPARAM = BiocParallel::SerialParam()
)

Arguments

results

The output of motifbreakR that was run with filterp=TRUE

background

Numeric Vector; the background probabilities of the nucleotides

granularity

Numeric Vector; the granularity to which to round the PWM, larger values compromise full accuracy for speed of calculation. A value of NULL does no rounding.

BPPARAM

a BiocParallel object see register and see getClass("BiocParallelParam") for additional parameter classes. Try BiocParallel::registered() to see what's available and for example BiocParallel::bpparam("SerialParam") would allow serial evaluation.

Details

This function is intended to be used on a selection of results produced by motifbreakR, and this can be (although not always) a very memory and time intensive process if the algorithm doesn't converge rapidly.

Value

a GRanges object. The same Granges object that was input as results, but with Refpvalue and Altpvalue columns in the output modified from NA to the p-value calculated by TFMsc2pv. Additionally a pvalueEffect column that indicates "strong" when the lower p-value (between ref and alt) is an order of magnitude or more different from the higher p-value, otherwise weak.

Source

H\'el\'ene Touzet and Jean-St\'ephane Varr\'e (2007) Efficient and accurate P-value computation for Position Weight Matrices. Algorithms for Molecular Biology, 2: 15.

See Also

See TFMsc2pv from the TFMPvalue package for information about how the p-values are calculated.

Examples

data(example.results)
rs1006140 <- example.results[example.results$SNP_id %in% "rs1006140"]
# low granularity for speed; 1e-6 or 1e-7 recommended for accuracy
rs1006140 <- calculatePvalue(rs1006140, BPPARAM=BiocParallel::SerialParam(), granularity = 1e-4)



Simon-Coetzee/motifBreakR documentation built on Aug. 6, 2024, 5:17 a.m.