sw.perm.test(cgh)R Documentation

Permutation Test for Smith-Waterman Algorithm

Description

Perform a permutation test of island scores from the Smith-Waterman algorithm.

Usage

  sw.perm.test(x, max.nIslands = 1, nIter = 1000, seed = NULL, trace = FALSE)
  

Arguments

x a vector of real values
max.nIslands number of iterations of the algorithm, each iteration finding the next highest-scoring 'island' of positive values, or NULL to find all islands
nIter number of permutations of the input data used in the test
seed seed for the random number generator, or NULL to use a faster random number generator that cannot be seeded
trace print verbose output if TRUE

Details

Value

A vector of probability values, calculated as the proportion of instances for which performing the Smith-Waterman algorithm on random permutations of the data identifies a higher-scoring island than the islands identified when the algorithm is performed on the original data

Author(s)

T.S.Price

See Also

sw

Examples

## simluate vector of logratios
set.seed(3)
logratio <- c(rnorm(20) - 1, rnorm(20))

## invert sign of values and subtract threshold to ensure negative mean
x <- sw.threshold(logratio, function(x) median(x) + .2 * mad(x), -1)

## perform Smith-Waterman
sw(x)

## perform permutation test on the islands identified
sw.perm.test(x, max.nIslands = NULL, nIter= 1e4)
  

[Package Contents]