bio-0.5.2: A bioinformatics library

Safe Haskell | Safe-Inferred

Bio.Sequence.HashWord

Synopsis

- data HashF k = HF {
  - hash :: SeqData -> Offset -> Maybe k
  - hashes :: SeqData -> [(k, Offset)]
  - ksort :: [k] -> [k]
  }
- genkeys :: HashF k -> HashF k
- contigous :: (Integral k, Show k, Eq k) => Int -> HashF k
- rcontig :: (Integral k, Show k, Eq k) => Int -> HashF k
- compact :: SeqData -> [SeqData]
- rcpacked :: (Integral k, Show k, Eq k) => Int -> HashF k
- type Shape = String
- gapped :: Integral k => Shape -> HashF k
- isN :: Char -> Bool
- n2k :: (Integral k, Show k, Eq k) => Int -> SeqData -> k
- n2i' :: (Num a, Show a, Eq a) => a -> SeqData -> a
- k2n :: (Integral k, Show k, Eq k) => Int -> k -> SeqData
- k2n' :: (Integral a, Integral a1, Show a, Show a1) => a -> a1 -> [Char]
- val :: (Num t, Show t, Eq t) => Char -> t
- unval :: (Num a, Show a, Eq a) => a -> Char
- complement :: Char -> Char

# Documentation

data HashF k

This is a struct for containing a set of hashing functions

Constructors

HF |

Fields

hash :: SeqData -> Offset -> Maybe k

  calculates the hash at a given offset in the sequence

hashes :: SeqData -> [(k, Offset)]

  calculate all hashes from a sequence, and their indices

ksort :: [k] -> [k]

  for sorting hashes

genkeys :: HashF k -> HashF k

Adds a default hashes function to a `HashF`, when hash is defined.

contigous :: (Integral k, Show k, Eq k) => Int -> HashF k

Contigous constructs an int/eger from a contigous k-word.

rcontig :: (Integral k, Show k, Eq k) => Int -> HashF k

Like `contigous`, but returns the same hash for a word and its reverse complement.

compact :: SeqData -> [SeqData]

rcpacked :: (Integral k, Show k, Eq k) => Int -> HashF k

Like `rcontig`, but ignoring monomers (i.e. arbitrarily long runs of a single nucelotide are treated the same a single nucleotide.

type Shape = String

gapped :: Integral k => Shape -> HashF k

isN :: Char -> Bool

n2k :: (Integral k, Show k, Eq k) => Int -> SeqData -> k

n2i' :: (Num a, Show a, Eq a) => a -> SeqData -> a

k2n :: (Integral k, Show k, Eq k) => Int -> k -> SeqData

k2n' :: (Integral a, Integral a1, Show a, Show a1) => a -> a1 -> [Char]

val :: (Num t, Show t, Eq t) => Char -> t

unval :: (Num a, Show a, Eq a) => a -> Char

complement :: Char -> Char