module Biobase.SubstMatrix.Types where

import Control.Lens
import GHC.Generics (Generic)

import Algebra.Structure.Semiring
import Biobase.Types.BioSequence (AA,DNA)
import Biobase.Primary.AA (aaRange)
import Biobase.Primary.Letter
import Biobase.Primary.Nuc.DNA ()
import Data.PrimitiveArray
import Statistics.Odds
import Numeric.Discretized



-- | Denotes that we are dealing with a similarity score. Higher is more
-- similar.

data Similarity

-- | Denotes that we are dealing with a distance score. Lower is more
-- similar.

data Distance

-- An amino-acid substitution matrix. Tagged with the type of scoring used.

data AASubstMat t s a b = AASubstMat
  { AASubstMat t s a b -> Unboxed ((Z :. Letter AA a) :. Letter AA b) s
_aaSubstMat     :: !(Unboxed (Z:.Letter AA a:.Letter AA b) s)
  , AASubstMat t s a b -> Double
_aaSubstLambda  :: Double
  }
  deriving ((forall x. AASubstMat t s a b -> Rep (AASubstMat t s a b) x)
-> (forall x. Rep (AASubstMat t s a b) x -> AASubstMat t s a b)
-> Generic (AASubstMat t s a b)
forall x. Rep (AASubstMat t s a b) x -> AASubstMat t s a b
forall x. AASubstMat t s a b -> Rep (AASubstMat t s a b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (t :: k) s k (a :: k) k (b :: k) x.
Rep (AASubstMat t s a b) x -> AASubstMat t s a b
forall k (t :: k) s k (a :: k) k (b :: k) x.
AASubstMat t s a b -> Rep (AASubstMat t s a b) x
$cto :: forall k (t :: k) s k (a :: k) k (b :: k) x.
Rep (AASubstMat t s a b) x -> AASubstMat t s a b
$cfrom :: forall k (t :: k) s k (a :: k) k (b :: k) x.
AASubstMat t s a b -> Rep (AASubstMat t s a b) x
Generic,AASubstMat t s a b -> AASubstMat t s a b -> Bool
(AASubstMat t s a b -> AASubstMat t s a b -> Bool)
-> (AASubstMat t s a b -> AASubstMat t s a b -> Bool)
-> Eq (AASubstMat t s a b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (t :: k) s k (a :: k) k (b :: k).
(Unbox s, Eq s) =>
AASubstMat t s a b -> AASubstMat t s a b -> Bool
/= :: AASubstMat t s a b -> AASubstMat t s a b -> Bool
$c/= :: forall k (t :: k) s k (a :: k) k (b :: k).
(Unbox s, Eq s) =>
AASubstMat t s a b -> AASubstMat t s a b -> Bool
== :: AASubstMat t s a b -> AASubstMat t s a b -> Bool
$c== :: forall k (t :: k) s k (a :: k) k (b :: k).
(Unbox s, Eq s) =>
AASubstMat t s a b -> AASubstMat t s a b -> Bool
Eq,ReadPrec [AASubstMat t s a b]
ReadPrec (AASubstMat t s a b)
Int -> ReadS (AASubstMat t s a b)
ReadS [AASubstMat t s a b]
(Int -> ReadS (AASubstMat t s a b))
-> ReadS [AASubstMat t s a b]
-> ReadPrec (AASubstMat t s a b)
-> ReadPrec [AASubstMat t s a b]
-> Read (AASubstMat t s a b)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
ReadPrec [AASubstMat t s a b]
forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
ReadPrec (AASubstMat t s a b)
forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
Int -> ReadS (AASubstMat t s a b)
forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
ReadS [AASubstMat t s a b]
readListPrec :: ReadPrec [AASubstMat t s a b]
$creadListPrec :: forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
ReadPrec [AASubstMat t s a b]
readPrec :: ReadPrec (AASubstMat t s a b)
$creadPrec :: forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
ReadPrec (AASubstMat t s a b)
readList :: ReadS [AASubstMat t s a b]
$creadList :: forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
ReadS [AASubstMat t s a b]
readsPrec :: Int -> ReadS (AASubstMat t s a b)
$creadsPrec :: forall k (t :: k) s k (a :: k) k (b :: k).
(Read s, Unbox s) =>
Int -> ReadS (AASubstMat t s a b)
Read,Int -> AASubstMat t s a b -> ShowS
[AASubstMat t s a b] -> ShowS
AASubstMat t s a b -> String
(Int -> AASubstMat t s a b -> ShowS)
-> (AASubstMat t s a b -> String)
-> ([AASubstMat t s a b] -> ShowS)
-> Show (AASubstMat t s a b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (t :: k) s k (a :: k) k (b :: k).
(Show s, Unbox s) =>
Int -> AASubstMat t s a b -> ShowS
forall k (t :: k) s k (a :: k) k (b :: k).
(Show s, Unbox s) =>
[AASubstMat t s a b] -> ShowS
forall k (t :: k) s k (a :: k) k (b :: k).
(Show s, Unbox s) =>
AASubstMat t s a b -> String
showList :: [AASubstMat t s a b] -> ShowS
$cshowList :: forall k (t :: k) s k (a :: k) k (b :: k).
(Show s, Unbox s) =>
[AASubstMat t s a b] -> ShowS
show :: AASubstMat t s a b -> String
$cshow :: forall k (t :: k) s k (a :: k) k (b :: k).
(Show s, Unbox s) =>
AASubstMat t s a b -> String
showsPrec :: Int -> AASubstMat t s a b -> ShowS
$cshowsPrec :: forall k (t :: k) s k (a :: k) k (b :: k).
(Show s, Unbox s) =>
Int -> AASubstMat t s a b -> ShowS
Show)
makeLenses ''AASubstMat

--instance Binary    (AASubstMat t)
--instance Serialize (AASubstMat t)
--instance FromJSON  (AASubstMat t)
--instance (ToJSON s, VU.Unbox s, Generic s) ⇒ ToJSON    (AASubstMat t s)

--instance NFData (AASubstMat t s)

-- | @PAM@ matrices are similarity matrices.

type SubstPAM = AASubstMat Similarity (DiscLogOdds (RTyId 1))

-- | @BLOSUM@ matrices are distance matrices.

type SubstBLOSUM = AASubstMat Distance (DiscLogOdds (RTyId 1))

-- | Substitution matrix from amino acids to nucleotide triplets.

newtype ANuc3SubstMat t s a n = ANuc3SubstMat { ANuc3SubstMat t s a n
-> Unboxed
     ((((Z :. Letter AA a) :. Letter DNA n) :. Letter DNA n)
      :. Letter DNA n)
     s
_anuc3SubstMat :: Unboxed (Z:.Letter AA a:.Letter DNA n:.Letter DNA n:.Letter DNA n) s }
  deriving ((forall x. ANuc3SubstMat t s a n -> Rep (ANuc3SubstMat t s a n) x)
-> (forall x.
    Rep (ANuc3SubstMat t s a n) x -> ANuc3SubstMat t s a n)
-> Generic (ANuc3SubstMat t s a n)
forall x. Rep (ANuc3SubstMat t s a n) x -> ANuc3SubstMat t s a n
forall x. ANuc3SubstMat t s a n -> Rep (ANuc3SubstMat t s a n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (t :: k) s k (a :: k) k (n :: k) x.
Rep (ANuc3SubstMat t s a n) x -> ANuc3SubstMat t s a n
forall k (t :: k) s k (a :: k) k (n :: k) x.
ANuc3SubstMat t s a n -> Rep (ANuc3SubstMat t s a n) x
$cto :: forall k (t :: k) s k (a :: k) k (n :: k) x.
Rep (ANuc3SubstMat t s a n) x -> ANuc3SubstMat t s a n
$cfrom :: forall k (t :: k) s k (a :: k) k (n :: k) x.
ANuc3SubstMat t s a n -> Rep (ANuc3SubstMat t s a n) x
Generic,ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool
(ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool)
-> (ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool)
-> Eq (ANuc3SubstMat t s a n)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool
/= :: ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool
$c/= :: forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool
== :: ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool
$c== :: forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc3SubstMat t s a n -> ANuc3SubstMat t s a n -> Bool
Eq,ReadPrec [ANuc3SubstMat t s a n]
ReadPrec (ANuc3SubstMat t s a n)
Int -> ReadS (ANuc3SubstMat t s a n)
ReadS [ANuc3SubstMat t s a n]
(Int -> ReadS (ANuc3SubstMat t s a n))
-> ReadS [ANuc3SubstMat t s a n]
-> ReadPrec (ANuc3SubstMat t s a n)
-> ReadPrec [ANuc3SubstMat t s a n]
-> Read (ANuc3SubstMat t s a n)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec [ANuc3SubstMat t s a n]
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec (ANuc3SubstMat t s a n)
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
Int -> ReadS (ANuc3SubstMat t s a n)
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadS [ANuc3SubstMat t s a n]
readListPrec :: ReadPrec [ANuc3SubstMat t s a n]
$creadListPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec [ANuc3SubstMat t s a n]
readPrec :: ReadPrec (ANuc3SubstMat t s a n)
$creadPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec (ANuc3SubstMat t s a n)
readList :: ReadS [ANuc3SubstMat t s a n]
$creadList :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadS [ANuc3SubstMat t s a n]
readsPrec :: Int -> ReadS (ANuc3SubstMat t s a n)
$creadsPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
Int -> ReadS (ANuc3SubstMat t s a n)
Read,Int -> ANuc3SubstMat t s a n -> ShowS
[ANuc3SubstMat t s a n] -> ShowS
ANuc3SubstMat t s a n -> String
(Int -> ANuc3SubstMat t s a n -> ShowS)
-> (ANuc3SubstMat t s a n -> String)
-> ([ANuc3SubstMat t s a n] -> ShowS)
-> Show (ANuc3SubstMat t s a n)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
Int -> ANuc3SubstMat t s a n -> ShowS
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
[ANuc3SubstMat t s a n] -> ShowS
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
ANuc3SubstMat t s a n -> String
showList :: [ANuc3SubstMat t s a n] -> ShowS
$cshowList :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
[ANuc3SubstMat t s a n] -> ShowS
show :: ANuc3SubstMat t s a n -> String
$cshow :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
ANuc3SubstMat t s a n -> String
showsPrec :: Int -> ANuc3SubstMat t s a n -> ShowS
$cshowsPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
Int -> ANuc3SubstMat t s a n -> ShowS
Show)
makeLenses ''ANuc3SubstMat

--instance Binary    (ANuc3SubstMat t)
--instance Serialize (ANuc3SubstMat t)
--instance FromJSON  (ANuc3SubstMat t)
--instance ToJSON    (ANuc3SubstMat t)

--instance NFData (ANuc3SubstMat t)

-- | Substitution matrix from amino acids to degenerate nucleotide
-- 2-tuples. The third nucleotide letter is missing.

newtype ANuc2SubstMat t s a n = ANuc2SubstMat { ANuc2SubstMat t s a n
-> Unboxed (((Z :. Letter AA a) :. Letter DNA n) :. Letter DNA n) s
_anuc2SubstMat :: Unboxed (Z:.Letter AA a:.Letter DNA n:.Letter DNA n) s }
  deriving ((forall x. ANuc2SubstMat t s a n -> Rep (ANuc2SubstMat t s a n) x)
-> (forall x.
    Rep (ANuc2SubstMat t s a n) x -> ANuc2SubstMat t s a n)
-> Generic (ANuc2SubstMat t s a n)
forall x. Rep (ANuc2SubstMat t s a n) x -> ANuc2SubstMat t s a n
forall x. ANuc2SubstMat t s a n -> Rep (ANuc2SubstMat t s a n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (t :: k) s k (a :: k) k (n :: k) x.
Rep (ANuc2SubstMat t s a n) x -> ANuc2SubstMat t s a n
forall k (t :: k) s k (a :: k) k (n :: k) x.
ANuc2SubstMat t s a n -> Rep (ANuc2SubstMat t s a n) x
$cto :: forall k (t :: k) s k (a :: k) k (n :: k) x.
Rep (ANuc2SubstMat t s a n) x -> ANuc2SubstMat t s a n
$cfrom :: forall k (t :: k) s k (a :: k) k (n :: k) x.
ANuc2SubstMat t s a n -> Rep (ANuc2SubstMat t s a n) x
Generic,ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool
(ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool)
-> (ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool)
-> Eq (ANuc2SubstMat t s a n)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool
/= :: ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool
$c/= :: forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool
== :: ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool
$c== :: forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc2SubstMat t s a n -> ANuc2SubstMat t s a n -> Bool
Eq,ReadPrec [ANuc2SubstMat t s a n]
ReadPrec (ANuc2SubstMat t s a n)
Int -> ReadS (ANuc2SubstMat t s a n)
ReadS [ANuc2SubstMat t s a n]
(Int -> ReadS (ANuc2SubstMat t s a n))
-> ReadS [ANuc2SubstMat t s a n]
-> ReadPrec (ANuc2SubstMat t s a n)
-> ReadPrec [ANuc2SubstMat t s a n]
-> Read (ANuc2SubstMat t s a n)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec [ANuc2SubstMat t s a n]
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec (ANuc2SubstMat t s a n)
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
Int -> ReadS (ANuc2SubstMat t s a n)
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadS [ANuc2SubstMat t s a n]
readListPrec :: ReadPrec [ANuc2SubstMat t s a n]
$creadListPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec [ANuc2SubstMat t s a n]
readPrec :: ReadPrec (ANuc2SubstMat t s a n)
$creadPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec (ANuc2SubstMat t s a n)
readList :: ReadS [ANuc2SubstMat t s a n]
$creadList :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadS [ANuc2SubstMat t s a n]
readsPrec :: Int -> ReadS (ANuc2SubstMat t s a n)
$creadsPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
Int -> ReadS (ANuc2SubstMat t s a n)
Read,Int -> ANuc2SubstMat t s a n -> ShowS
[ANuc2SubstMat t s a n] -> ShowS
ANuc2SubstMat t s a n -> String
(Int -> ANuc2SubstMat t s a n -> ShowS)
-> (ANuc2SubstMat t s a n -> String)
-> ([ANuc2SubstMat t s a n] -> ShowS)
-> Show (ANuc2SubstMat t s a n)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
Int -> ANuc2SubstMat t s a n -> ShowS
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
[ANuc2SubstMat t s a n] -> ShowS
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
ANuc2SubstMat t s a n -> String
showList :: [ANuc2SubstMat t s a n] -> ShowS
$cshowList :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
[ANuc2SubstMat t s a n] -> ShowS
show :: ANuc2SubstMat t s a n -> String
$cshow :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
ANuc2SubstMat t s a n -> String
showsPrec :: Int -> ANuc2SubstMat t s a n -> ShowS
$cshowsPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
Int -> ANuc2SubstMat t s a n -> ShowS
Show)
makeLenses ''ANuc2SubstMat

--instance Binary    (ANuc2SubstMat t)
--instance Serialize (ANuc2SubstMat t)
--instance FromJSON  (ANuc2SubstMat t)
--instance ToJSON    (ANuc2SubstMat t)

--instance NFData (ANuc2SubstMat t)

-- | Substitution matrix from amino acids to degenerate nucleotide
-- 1-tuples. Two out of three nucleotides in a triplet are missing.

newtype ANuc1SubstMat t s a n = ANuc1SubstMat { ANuc1SubstMat t s a n
-> Unboxed ((Z :. Letter AA a) :. Letter DNA n) s
_anuc1SubstMat :: Unboxed (Z:.Letter AA a:.Letter DNA n) s }
  deriving ((forall x. ANuc1SubstMat t s a n -> Rep (ANuc1SubstMat t s a n) x)
-> (forall x.
    Rep (ANuc1SubstMat t s a n) x -> ANuc1SubstMat t s a n)
-> Generic (ANuc1SubstMat t s a n)
forall x. Rep (ANuc1SubstMat t s a n) x -> ANuc1SubstMat t s a n
forall x. ANuc1SubstMat t s a n -> Rep (ANuc1SubstMat t s a n) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall k (t :: k) s k (a :: k) k (n :: k) x.
Rep (ANuc1SubstMat t s a n) x -> ANuc1SubstMat t s a n
forall k (t :: k) s k (a :: k) k (n :: k) x.
ANuc1SubstMat t s a n -> Rep (ANuc1SubstMat t s a n) x
$cto :: forall k (t :: k) s k (a :: k) k (n :: k) x.
Rep (ANuc1SubstMat t s a n) x -> ANuc1SubstMat t s a n
$cfrom :: forall k (t :: k) s k (a :: k) k (n :: k) x.
ANuc1SubstMat t s a n -> Rep (ANuc1SubstMat t s a n) x
Generic,ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool
(ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool)
-> (ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool)
-> Eq (ANuc1SubstMat t s a n)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool
/= :: ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool
$c/= :: forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool
== :: ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool
$c== :: forall k (t :: k) s k (a :: k) k (n :: k).
(Unbox s, Eq s) =>
ANuc1SubstMat t s a n -> ANuc1SubstMat t s a n -> Bool
Eq,ReadPrec [ANuc1SubstMat t s a n]
ReadPrec (ANuc1SubstMat t s a n)
Int -> ReadS (ANuc1SubstMat t s a n)
ReadS [ANuc1SubstMat t s a n]
(Int -> ReadS (ANuc1SubstMat t s a n))
-> ReadS [ANuc1SubstMat t s a n]
-> ReadPrec (ANuc1SubstMat t s a n)
-> ReadPrec [ANuc1SubstMat t s a n]
-> Read (ANuc1SubstMat t s a n)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec [ANuc1SubstMat t s a n]
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec (ANuc1SubstMat t s a n)
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
Int -> ReadS (ANuc1SubstMat t s a n)
forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadS [ANuc1SubstMat t s a n]
readListPrec :: ReadPrec [ANuc1SubstMat t s a n]
$creadListPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec [ANuc1SubstMat t s a n]
readPrec :: ReadPrec (ANuc1SubstMat t s a n)
$creadPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadPrec (ANuc1SubstMat t s a n)
readList :: ReadS [ANuc1SubstMat t s a n]
$creadList :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
ReadS [ANuc1SubstMat t s a n]
readsPrec :: Int -> ReadS (ANuc1SubstMat t s a n)
$creadsPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Read s, Unbox s) =>
Int -> ReadS (ANuc1SubstMat t s a n)
Read,Int -> ANuc1SubstMat t s a n -> ShowS
[ANuc1SubstMat t s a n] -> ShowS
ANuc1SubstMat t s a n -> String
(Int -> ANuc1SubstMat t s a n -> ShowS)
-> (ANuc1SubstMat t s a n -> String)
-> ([ANuc1SubstMat t s a n] -> ShowS)
-> Show (ANuc1SubstMat t s a n)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
Int -> ANuc1SubstMat t s a n -> ShowS
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
[ANuc1SubstMat t s a n] -> ShowS
forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
ANuc1SubstMat t s a n -> String
showList :: [ANuc1SubstMat t s a n] -> ShowS
$cshowList :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
[ANuc1SubstMat t s a n] -> ShowS
show :: ANuc1SubstMat t s a n -> String
$cshow :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
ANuc1SubstMat t s a n -> String
showsPrec :: Int -> ANuc1SubstMat t s a n -> ShowS
$cshowsPrec :: forall k (t :: k) s k (a :: k) k (n :: k).
(Show s, Unbox s) =>
Int -> ANuc1SubstMat t s a n -> ShowS
Show)
makeLenses ''ANuc1SubstMat

--instance Binary    (ANuc1SubstMat t)
--instance Serialize (ANuc1SubstMat t)
--instance FromJSON  (ANuc1SubstMat t)
--instance ToJSON    (ANuc1SubstMat t)

--instance NFData (ANuc1SubstMat t)



data GapCost t = GapCost
  { GapCost t -> t
gcInit  !t
  , GapCost t -> t
gcCont  !t
  }