% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/scoreMotif.R
\name{calculatePvalue}
\alias{calculatePvalue}
\title{Calculate the significance of the matches for the reference and alternate alleles for the for their PWM}
\source{
H{\'e}l{\`e}ne Touzet and Jean-St{\'e}phane Varr{\'e} (2007) Efficient and accurate P-value computation for Position Weight Matrices.
 Algorithms for Molecular Biology, \bold{2: 15}.
}
\usage{
calculatePvalue(results, background = c(A = 0.25, C = 0.25, G = 0.25, T =
  0.25))
}
\arguments{
\item{results}{The output of \code{motifbreakR} that was run with \code{filterp=TRUE}}

\item{background}{Numeric Vector; the background probabilites of the nucleotides}
}
\value{
a GRanges object. The same Granges object that was input as \code{results}, but with
 \code{Refpvalue} and \code{Altpvalue} columns in the output modified from \code{NA} to the p-value
 calculated by \code{\link{TFMsc2pv}}.
}
\description{
Calculate the significance of the matches for the reference and alternate alleles for the for their PWM
}
\details{
This function is intended to be used on a selection of results produced by \code{\link{motifbreakR}}, and
this can be (although not always) a very memory and time intensive process if the algorithm doesn't converge rapidly.
}
\examples{
data(example.results)
rs2661839 <- example.results[names(example.results) \%in\% "rs2661839"]
rs2661839 <- calculatePvalue(rs2661839)
}
\seealso{
See \code{\link{TFMsc2pv}} from the \pkg{TFMPvalue} package for
  information about how the p-values are calculated.
}

