Line | |
---|
1 | #include "muscle.h" |
---|
2 | #include "msa.h" |
---|
3 | #include "textfile.h" |
---|
4 | #include "tree.h" |
---|
5 | |
---|
6 | void DoMakeTree() |
---|
7 | { |
---|
8 | if (g_pstrInFileName == 0 || g_pstrOutFileName == 0) |
---|
9 | Quit("-maketree requires -in <msa> and -out <treefile>"); |
---|
10 | |
---|
11 | SetStartTime(); |
---|
12 | |
---|
13 | SetSeqWeightMethod(g_SeqWeight1); |
---|
14 | |
---|
15 | TextFile MSAFile(g_pstrInFileName); |
---|
16 | |
---|
17 | MSA msa; |
---|
18 | msa.FromFile(MSAFile); |
---|
19 | |
---|
20 | unsigned uSeqCount = msa.GetSeqCount(); |
---|
21 | MSA::SetIdCount(uSeqCount); |
---|
22 | |
---|
23 | // Initialize sequence ids. |
---|
24 | // From this point on, ids must somehow propogate from here. |
---|
25 | for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex) |
---|
26 | msa.SetSeqId(uSeqIndex, uSeqIndex); |
---|
27 | SetMuscleInputMSA(msa); |
---|
28 | |
---|
29 | Progress("%u sequences", uSeqCount); |
---|
30 | |
---|
31 | Tree tree; |
---|
32 | TreeFromMSA(msa, tree, g_Cluster2, g_Distance2, g_Root2); |
---|
33 | |
---|
34 | TextFile TreeFile(g_pstrOutFileName, true); |
---|
35 | tree.ToFile(TreeFile); |
---|
36 | |
---|
37 | Progress("Tree created"); |
---|
38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.