complementFile.h 1.17 KB
Newer Older
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
/*
 * complementFile.h
 *
 *  Created on: Jun 16, 2015
 *      Author: nek3d
 */

#ifndef COMPLEMENTFILE_H_
#define COMPLEMENTFILE_H_

#include "ToolBase.h"
#include "ContextComplement.h"


class BlockMgr;
class BinTree;
class NewGenomeFile;
class RecordOutputMgr;

class ComplementFile : public ToolBase {

public:
    ComplementFile(ContextComplement *context);
    virtual ~ComplementFile();
	virtual bool init();
	virtual bool findNext(RecordKeyVector &hits);
	virtual void processHits(RecordOutputMgr *outputMgr, RecordKeyVector &hits);
	virtual void cleanupHits(RecordKeyVector &hits);
	virtual bool finalizeCalculations();
	virtual void  giveFinalReport(RecordOutputMgr *outputMgr) {}


protected:
	FileRecordMergeMgr *_frm;
	Bed3Interval _outRecord;
	QuickString _currChrom;
	const NewGenomeFile *_genomeFile;
	int _currStartPos;
	RecordOutputMgr *_outputMgr;
	const vector<QuickString> &_chromList;
	int _currPosInGenomeList;

	virtual ContextComplement *upCast(ContextBase *context) { return static_cast<ContextComplement *>(context); }

	void outPutLastRecordInPrevChrom();
	bool fastForward(const QuickString &newChrom);
	void printRecord(int endPos);

};




#endif /* COMPLEMENTFILE_H_ */