Safe Haskell | None |
---|
Fast hash functions for Primary
sequences. A hash is just an Int
, so
use these only for short sequences.
- newtype HashedPrimary = HashedPrimary Int
- mkHashedPrimary :: (Nuc, Nuc) -> Primary -> HashedPrimary
Documentation
newtype HashedPrimary Source
HashedPrimary Int |
Bounded HashedPrimary | |
Enum HashedPrimary | |
Eq HashedPrimary | |
Ord HashedPrimary | |
Read HashedPrimary | |
Show HashedPrimary | |
Ix HashedPrimary | |
Prim HashedPrimary | |
Unbox HashedPrimary | |
Vector Vector HashedPrimary | |
MVector MVector HashedPrimary |
mkHashedPrimary :: (Nuc, Nuc) -> Primary -> HashedPrimarySource
Given a piece of primary sequence information, reduce it to an index.
Will throw an assertion in debug code if ps
are not within bounds. Note
that mkPrimary [minBound] and mkPrimary [minBound,minBound] map to the
same index. Meaning that indices are only unique within the same length
group. Furthermore, indices with different (l,u)-bounds are not compatible
with each other. All indices start at 0.
The empty input produces an index of 0.
TODO currently goes the very inefficient way of creating a temporary vector
for ps
. We could in O(1) create a vector from a Primary ...