File: maketree.cpp

package info (click to toggle)
muscle 3.70%2Bfix1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 1,424 kB
  • ctags: 2,116
  • sloc: cpp: 26,897; xml: 230; makefile: 25
file content (38 lines) | stat: -rw-r--r-- 880 bytes parent folder | download | duplicates (12)
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
29
30
31
32
33
34
35
36
37
38
#include "muscle.h"
#include "msa.h"
#include "textfile.h"
#include "tree.h"

void DoMakeTree()
	{
	if (g_pstrInFileName == 0 || g_pstrOutFileName == 0)
		Quit("-maketree requires -in <msa> and -out <treefile>");

	SetStartTime();

	SetSeqWeightMethod(g_SeqWeight1);

	TextFile MSAFile(g_pstrInFileName);

	MSA msa;
	msa.FromFile(MSAFile);

	unsigned uSeqCount = msa.GetSeqCount();
	MSA::SetIdCount(uSeqCount);

// Initialize sequence ids.
// From this point on, ids must somehow propogate from here.
	for (unsigned uSeqIndex = 0; uSeqIndex < uSeqCount; ++uSeqIndex)
		msa.SetSeqId(uSeqIndex, uSeqIndex);
	SetMuscleInputMSA(msa);

	Progress("%u sequences", uSeqCount);

	Tree tree;
	TreeFromMSA(msa, tree, g_Cluster2, g_Distance2, g_Root2);

	TextFile TreeFile(g_pstrOutFileName, true);
	tree.ToFile(TreeFile);

	Progress("Tree created");
	}