File: alignclust.cpp

package info (click to toggle)
pilercr 1.06%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 844 kB
  • sloc: cpp: 14,339; makefile: 67; sh: 36
file content (46 lines) | stat: -rwxr-xr-x 937 bytes parent folder | download | duplicates (2)
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
39
40
41
42
43
44
45
46
#include "pilercr.h"

#define TRACE	0

void AlignCluster(std::vector<ArrayAln *> &AAVec, const IntVec &Cluster,
  Seq &ConsSymbols)
	{
#if	TRACE
	Log("AlignCluster:\n");
#endif

	SeqVect Seqs;
	const size_t ClusterSize  = Cluster.size();
	for (size_t i = 0; i < ClusterSize ; ++i)
		{
		size_t ArrayIndex = Cluster[i];
		Seq *s = new Seq;
#if	TRACE
		ADVec[ArrayIndex]->ConsSeq.LogMe();
		Log("\n");
#endif
		const ArrayAln &AA = *(AAVec[ArrayIndex]); 
		s->Copy(AA.ConsSeq);
		if (AA.ClusterRevComp && ClusterSize > 1)
			s->RevComp();
		Seqs.push_back(s);
		}

	MSA Aln;
	MultipleAlign(Seqs, Aln);
#if	TRACE
	Aln.LogMe();
#endif

	GetConsSymbols(Aln, ConsSymbols);

	for (size_t i = 0; i < ClusterSize ; ++i)
		{
		size_t ArrayIndex = Cluster[i];
		Aln.GetSeq((unsigned) i, AAVec[ArrayIndex]->AlignedConsSeq);
#if	TRACE
		Log("Aligned=");
		AAVec[i]->AlignedConsSeq.LogMe();
#endif
		}
	}