R/TFMPvalue-sc2pv.R

Defines functions TFMsc2pv

Documented in TFMsc2pv

TFMsc2pv <- function(mat, score, bg=c(A=0.25, C=0.25, G=0.25, T=0.25),
                    type=c("PFM", "PWM")){
  ## TODD: valiate these mat, bg
  type <- match.arg(type)
  if(length(score) != 1L){
    stop("score must be length of 1")
  }
  bg <- normargPriorParams(bg)
  if(type == "PFM"){
    mat <- normargMat(mat)
  }
  pvalue <- .Call("sc2pv", mat, score, bg, type, PACKAGE="TFMPvalue")
  return(pvalue)
}
ge11232002/TFMPvalue documentation built on Oct. 26, 2022, 7:09 p.m.