Safe Haskell | None |
---|
Infernal Stockholm files and covariance models, and other related files use a bunch of different identifiers. We provide newtypes for more type safety.
TODO Use (Bio.Core.Sequence.Offset) instead of Int for sequence info
TODO move BitScore
s, null models, probabilities into its own library.
- newtype Accession t = ACC {}
- newtype Identification t = IDD {
- unIDD :: ByteString
- data Clan
- data Pfam
- data Rfam
- data Species
- newtype BitScore = BitScore {
- unBitScore :: Double
- prob2Score :: Double -> Double -> BitScore
- score2Prob :: Double -> BitScore -> Double
- newtype Classification = Classification {}
Accession
and string Identifier
with phantom types.
Accession number, in the format of RFxxxxx, PFxxxxx, or CLxxxxx. We keep only the Int-part. A phantom type specifies which kind of accession number this is. For Species, we just have an index, it seems.
newtype Identification t Source
One word name for the family or clan. Phantom-typed with the correct type of model. Can be a longer name for species.
IDD | |
|
Eq (Identification t) | |
Ord (Identification t) | |
Read (Identification t) | |
Show (Identification t) |
Infernal bit score. Behaves like a double (deriving Num).
Infernal users guide, p.42: log-odds score in log_2 (aka bits).
S = log_2 (P(seq|CM) / P(seq|null))
prob2Score :: Double -> Double -> BitScoreSource
Given a null model and a probability, calculate the corresponding
BitScore
.
score2Prob :: Double -> BitScore -> DoubleSource
Given a null model and a BitScore
return the corresponding probability.
newtype Classification Source
Classification names (taxonomic classification)