File: AlignedFragment.h

package info (click to toggle)
proda 1.0-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 584 kB
  • sloc: cpp: 8,549; xml: 163; makefile: 109; sh: 12
file content (76 lines) | stat: -rw-r--r-- 1,889 bytes parent folder | download | duplicates (3)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//////////////////////////////////////////////////////////////////////
// AlignedFragment.h 
//
// Class for a pairwise local alignment
//////////////////////////////////////////////////////////////////////

#ifndef ALIGNFRAGMENT_H
#define ALIGNFRAGMENT_H

#include <cstdio>
#include <vector>
#include <fstream>

class Fragment;
class AlignedFragment;

typedef std::vector<AlignedFragment> AVECT;

class AlignedFragment  
{

public:
	void Print(FILE *file);
	int ProcessRepeat(AVECT &fragments, int minlength);
	
	//Getters
	int GetEnd(int i);
	int GetBegin(int i);
	int GetID(int i);
	std::pair<int, int> *GetAlignPos(int seq, int  pos, int &second);
	int GetLength();
	Fragment * GetFragment(int i);
	Fragment * GetAlignFragment(Fragment &fr);
	
	//
	void Adjust(Fragment& fr1, Fragment& fr2, AlignedFragment &rfr1, AlignedFragment &rfr2);
	void Prune();
	AlignedFragment * SubFragment(int begin0,int end0, int begin1, int end1);
	void ShiftRight(int offset1, int offset2);

	
	//Constructors
	AlignedFragment(int d1, int d2, int beg1, int beg2, int e1, int e2, int *s1, int *s2);
	AlignedFragment& operator =(const AlignedFragment af);
	AlignedFragment(const AlignedFragment& af);
	AlignedFragment();
	virtual ~AlignedFragment();

	int id[2];
	int begin[2];
	int end[2]; 
	float similarity;
	int *seq[2];

};

class Fragment{
public:
	Fragment();
	Fragment(int start, int e, int mul, int sid) 
		{ begin = start; end = e; multiply = mul; id = sid; length = end - begin + 1;}
	Fragment (const Fragment& fr)
		{ begin = fr.begin; end = fr.end; length = fr.length; multiply = fr.multiply; id = fr.id;}

	Fragment& operator =(const Fragment f)
		{begin = f.begin; length = f.length; multiply = f.multiply;end = f.end;id = f.id;return *this;}
	int Overlap(Fragment& fr);
	
	int begin;
	int length;
	int multiply; // number of sequences aligned to the fragment
	int id;
	int end;
};

#endif