BiobaseTypes-0.1.2.1: Collection of types for bioinformatics

Safe HaskellNone
LanguageHaskell2010

Biobase.Types.Bitscore

Description

Bit scores as used by different algorithms in bioinformatics, linguistics, and probably elsewhere.

Basically, the base-2 logarithm of the probability of the input given the model vs the probability of the input given the null model.

S = log_2 (P(seq|model) / P(seq|null))

Synopsis

Documentation

newtype Bitscore Source #

Bit score; behaves like a double (deriving Num). In particular, the algebraic operations behave as expected Bitscore a + Bitscore b == Bitscore (a+b).

Currently geared towards use as in Infernal and HMMER.

Infernal users guide, p.42: log-odds score in log_2 (aka bits).

Constructors

Bitscore 

Fields

Instances

Eq Bitscore Source # 
Fractional Bitscore Source # 
Num Bitscore Source # 
Ord Bitscore Source # 
Read Bitscore Source # 
Show Bitscore Source # 
Generic Bitscore Source # 

Associated Types

type Rep Bitscore :: * -> * #

Methods

from :: Bitscore -> Rep Bitscore x #

to :: Rep Bitscore x -> Bitscore #

Hashable Bitscore Source # 

Methods

hashWithSalt :: Int -> Bitscore -> Int #

hash :: Bitscore -> Int #

ToJSON Bitscore Source # 
FromJSON Bitscore Source # 
Binary Bitscore Source # 

Methods

put :: Bitscore -> Put #

get :: Get Bitscore #

putList :: [Bitscore] -> Put #

Serialize Bitscore Source # 
Default Bitscore Source #

A default bitscore of "-infinity", but with 10-1 wiggle room.

TODO Check out the different "defaults" Infernal uses

Methods

def :: Bitscore #

NFData Bitscore Source # 

Methods

rnf :: Bitscore -> () #

Unbox Bitscore Source # 
NumericalExtremes Bitscore Source # 
Vector Vector Bitscore Source # 
MVector MVector Bitscore Source # 
type Rep Bitscore Source # 
type Rep Bitscore = D1 (MetaData "Bitscore" "Biobase.Types.Bitscore" "BiobaseTypes-0.1.2.1-1LTYzU1e5OWItpBBqXiV1g" True) (C1 (MetaCons "Bitscore" PrefixI True) (S1 (MetaSel (Just Symbol "getBitscore") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Double)))
data Vector Bitscore Source # 
data MVector s Bitscore Source # 

prob2Score :: Double -> Double -> Bitscore Source #

Given a null model and a probability, calculate the corresponding BitScore.

TODO x<=epsilon ?

score2Prob :: Double -> Bitscore -> Double Source #

Given a null model and a BitScore return the corresponding probability.