| calculatePvalue | R Documentation | 
Calculate the significance of the matches for the reference and alternate alleles for the for their PWM
calculatePvalue(
  results,
  background = c(A = 0.25, C = 0.25, G = 0.25, T = 0.25),
  granularity = NULL,
  BPPARAM = BiocParallel::SerialParam()
)
| results | The output of  | 
| 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
 | 
| BPPARAM | a BiocParallel object see  | 
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.
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.
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 TFMsc2pv from the TFMPvalue package for
information about how the p-values are calculated.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.