bioinformatics-toolkit-0.5.0: A collection of bioinformatics tools

Bio.Utils.Functions

Synopsis

# Documentation

Arguments

 :: Double θ, determine the shape of the function -> Double input -> Double

inverse hyperbolic sine transformation

inverse hyperbolic sine transformation with θ = 1

scale :: Vector v Double => v Double -> v Double Source #

scale data to zero mean and 1 variance

Arguments

 :: Vector v (a, Double) => Double desired FDR value -> v (a, Double) input data and pvalues -> v (a, Double)

given the p-values, filter data by controling FDR

Arguments

 :: (Fractional a, Vector v a) => Int size of HALF sliding window, 2 means a total window size is 5 -> v a -> v a

Compute the sliding average for each entry in a vector

kld :: (Vector v Double, Vector v (Double, Double)) => v Double -> v Double -> Double Source #

compute the Kullback-Leibler divergence between two valid (not check) probability distributions. kl(X,Y) = sum_i P(x_i) log_2(P(x_i)/P(y_i)).

jsd :: (Vector v Double, Vector v (Double, Double)) => v Double -> v Double -> Double Source #

Jensen-Shannon divergence: JS(X,Y) = 1/2 KL(X,(X+Y)/2) + 1/2 KL(Y,(X+Y)/2).

binarySearch :: (Vector v e, Ord e) => v e -> e -> Int Source #

O(log n). return the position of the first element that is >= query

binarySearchBy :: Vector v e => (e -> a -> Ordering) -> v e -> a -> Int Source #

binarySearchByBounds :: Vector v e => (e -> a -> Ordering) -> v e -> a -> Int -> Int -> Int Source #

Columns are samples, rows are features / genes. TODO: handle ties.