-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.hs
28 lines (21 loc) · 827 Bytes
/
main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module Main where
import Needleman
import ProgressiveAlignment
import Distances
import UPGMA
import qualified Data.Map as Map
{- treeBuilder sequences
Create phylogenetic tree in Newick format.
PRE: sequences contains at least one sequence longer than 3 symbols.
RETURN: Newick format of phylogenetic tree from sequences.
-}
treeBuilder :: [String] -> String
treeBuilder seqs = newickFormat phylo_tree where
-- Create guide tree by clustering sequences based on k-mer distance matrix.
guide_tree = upgmaClustering seqs False
-- Traverse guide tree and apply NWA to generate MSA.
msa = treeTraversal guide_tree
-- Create phylogenetic tree by clustering sequences in MSA with Jukes-Cantor distance measure.
phylo_tree = upgmaClustering msa True
main = do
print (treeBuilder sequences)