module Data.Align.Demo where
import Data.Align
import qualified Data.Vector as V
sampleGlobalConfig :: (Eq a) => AlignConfig a Double
sampleGlobalConfig = alignConfig
(\a b -> if a == b then 1 else 0.25)
(0.5)
(1)
testIn1 = "dopple"
testIn2 = "applied"
alignedGlobal =
align sampleGlobalConfig (V.fromList testIn1) (V.fromList testIn2)
debug = putStrLn . debugAlign . trace
printAlignedGlobal = debug alignedGlobal
nucs =
[ "ATTGCCATT"
, "ATGGCCATT"
, "ATCCAATTTT"
, "ATCTTCTT"
, "ATTGCCGATT"
]
alignNuc a b = align sampleGlobalConfig (V.fromList a) (V.fromList b)
alignedNucPairs = do
n <- tail nucs
return $ alignNuc (head nucs) n
printAlignedNucPairs = mapM_ (\x -> debug x >> putStrLn "") alignedNucPairs
alignedNucStar =
centerStar sampleGlobalConfig $ zip [1..] (map V.fromList nucs)
printAlignedNucStar = putStrLn . debugMultiAlign . multiTrace $ alignedNucStar