{-# LANGUAGE TypeSynonymInstances #-}

-- | Mathews / Turner nearest neighbor energy tables for interactions between
-- RNA-RNA and DNA-DNA. Using lazy tables for easy filling of missing data.
-- Transform tables into uvectors for efficient access.

module Biobase.Turner where

import Biobase.RNA (Nucleotide)
import qualified Biobase.Turner.Tables as T

-- | Data structure containing all necessary tables for the Turner 2004 model.
-- Note the temperature, using an additional function, rescaling becomes
-- possible. A Show and a Read instance are automatically derived but one
-- should use the Turner and/or Vienna import/export facilities. All data uses
-- complete tables, where any base can pair with any other. Missing data ('.'
-- in tables) is given by 'Nothing', otherwise we have 'Just Int'.
-- In general, have a look here:
-- \url{http://rna.urmc.rochester.edu/NNDB/turner04/index.html} where
-- parameters are explained.
-- Conversion from Turner to Vienna is only possible in one direction as a
-- number of parameters are not used in Vienna RNA Folding.

-- We are missing tables for DNA-RNA data: helixdr.dat, stackdr.dat,
-- stackdr.dh.  Several other files have unknown data, too. These are:
-- dnadynalign*, fam\_hmm\_pars.dat, helix.dat, int22-exp.dh

type TurnerTables = T.Turner2004 Basepair Nucleotide Double

type TurnerEntropy  = TurnerTables
type TurnerEnthalpy = TurnerTables
type Temperature    = Double
type TurnerSet      = (Temperature,TurnerEntropy,TurnerEnthalpy)

type Basepair = (Nucleotide,Nucleotide)