calculatePvalue: p-value that two PWM-positions are from the same distribution

Description Usage Arguments Value Author(s) Examples

View source: R/diffSeqLogoSupport.R

Description

Calculates the p-value for the null-hypothesis that two given probability vectors p1, p2 calculated from n1/n2 observations arise from the same distribution

Usage

1
2
calculatePvalue(p1, p2, n1, n2, stackHeight = shannonDivergence,
  numberOfPermutations = 100, plotGammaDistributionFit = FALSE)

Arguments

p1

first probability vector with one probability for each symbol of the alphabet

p2

second probability vector with one probability for each symbol of the alphabet

n1

number of observations for the calculation of p1

n2

number of observations for the calculation of p2

stackHeight

function for the calculation of a divergence measure for two probability vectors

numberOfPermutations

the number of permutations to perform for the calculation of stackHeights

plotGammaDistributionFit

if TRUE the fit of a gamma distribution to the sampled stackHeights is plotted

Value

a numeric p-value

Author(s)

Hendrik Treutler

Examples

1
2
3
4
5
6
7
8
p1 <- c(0.2, 0.3, 0.1, 0.4)
p2 <- c(0.2, 0.1, 0.3, 0.4)
n1 <- 100
n2 <- 200
numberOfPermutations = 100
plotGammaDistributionFit = TRUE

pValue <- calculatePvalue(p1 = p1, p2 = p2, n1 = n1, n2 = n2, stackHeight = shannonDivergence, numberOfPermutations = numberOfPermutations, plotGammaDistributionFit = plotGammaDistributionFit)

Example output

Loading required package: cba
Loading required package: grid
Loading required package: proxy

Attaching package:proxyThe following objects are masked frompackage:stats:

    as.dist, dist

The following object is masked frompackage:base:

    as.matrix

DiffLogo documentation built on Nov. 8, 2020, 6:09 p.m.