module Biobase.SubstMatrix.Hints where

import Statistics.Odds
import Numeric.Discretized

import Biobase.SubstMatrix.Types



-- | Provide recommendations for both, substitution matrix to use, and gap
-- cost.

recommendByQueryLength  Int  (String, GapCost (DiscLogOdds Unknown))
recommendByQueryLength :: Int -> (String, GapCost (DiscLogOdds 'Unknown))
recommendByQueryLength Int
k
  | Int
k Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<  Int
35 = (String
"PAM30"   , Int -> Int -> GapCost (DiscLogOdds 'Unknown)
forall k (t :: k). Int -> Int -> GapCost (DiscLogOdds t)
gc ( -Int
9) (-Int
1))
  | Int
k Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
50 = (String
"PAM70"   , Int -> Int -> GapCost (DiscLogOdds 'Unknown)
forall k (t :: k). Int -> Int -> GapCost (DiscLogOdds t)
gc (-Int
10) (-Int
1))
  | Int
k Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
85 = (String
"BLOSUM80", Int -> Int -> GapCost (DiscLogOdds 'Unknown)
forall k (t :: k). Int -> Int -> GapCost (DiscLogOdds t)
gc (-Int
10) (-Int
1))
  | Int
k Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>  Int
85 = (String
"BLOSUM62", Int -> Int -> GapCost (DiscLogOdds 'Unknown)
forall k (t :: k). Int -> Int -> GapCost (DiscLogOdds t)
gc (-Int
10) (-Int
1))
  where gc :: Int -> Int -> GapCost (DiscLogOdds t)
gc Int
init Int
cont = GapCost :: forall t. t -> t -> GapCost t
GapCost { gcInit :: DiscLogOdds t
gcInit = Discretized t -> DiscLogOdds t
forall k (t :: k). Discretized t -> DiscLogOdds t
DiscLogOdds (Discretized t -> DiscLogOdds t) -> Discretized t -> DiscLogOdds t
forall a b. (a -> b) -> a -> b
$ Int -> Discretized t
forall k (b :: k). Int -> Discretized b
Discretized Int
init, gcCont :: DiscLogOdds t
gcCont = Discretized t -> DiscLogOdds t
forall k (t :: k). Discretized t -> DiscLogOdds t
DiscLogOdds (Discretized t -> DiscLogOdds t) -> Discretized t -> DiscLogOdds t
forall a b. (a -> b) -> a -> b
$ Int -> Discretized t
forall k (b :: k). Int -> Discretized b
Discretized Int
cont }