-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWriteResults.h
86 lines (70 loc) · 3.31 KB
/
WriteResults.h
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
77
78
79
80
81
82
83
84
85
86
/**
* @file WriteResults.h
* @author Amirhosein Afshinfard <afshinfard(at)ce(.)sharif(.)edu>
* <afshinfard(at)gmail(.)com>
* Bioinformatics Research Lab - Sharif Uiversity of Technology
*
* @cite
*
* @copyright (c) 2017
*
* Amirhosein Afshinfard <afshinfard(at)ce (.)sharif(.)edu>
* <afshinfard(at)gmail(.)com>
* Damoon Nashta-ali <damoun_dna(at)yahoo(.)com>
* Seyed Abolfazl Motahari <motahari(at)sharif(.)edu>
*
**/
#ifndef WRITERESULTS_H
#define WRITERESULTS_H
#include <unistd.h>
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
#include <fstream>
#include "DataStructures.h"
void write2Informatives( vector<informativeReadsData> *informativeReads/*, ofstream *ofstr1*/ ){
// [Complete]
//cerr<<"\n\n 2inf++ "<<informativeReads->size()<<endl;
cnt_2informatives += informativeReads->size();
for ( vector<informativeReadsData>::iterator it = informativeReads->begin() ; it < informativeReads->end(); it++){
for ( vector<solvedFragInfo>::iterator it2 = it->clusters.begin() ; it2 < it->clusters.end(); it2++){
(ofstr_2Informatives)<< (it->readName) <<"\t|\t"
<< (it2->startChunk) << "\t" << (it2->endChunk) << "\t"
<< (it2->isReverse ? "-1":"+1") << "\t" << (it2->shift) << "\t"
<< (it2->startPos) << "\t" << (it2->endPos) << endl;
}
}
}
void writeInformatives( vector<informativeReadsData> *informativeReads/*, ofstream *ofstr1*/ ){
// [Complete]
//cerr<<"\n\n inf++ "<<informativeReads->size()<<endl;
cnt_informatives += informativeReads->size();
for ( vector<informativeReadsData>::iterator it = informativeReads->begin() ; it < informativeReads->end(); it++){
//ofstr1<< (it->readName) << endl;
//ofstr1<< (it->readSeq) << endl;
//style 1:
// ofstr1<< (it->index) <<"\t|\t";
// for ( vector<solvedFragInfo>::iterator it2 = it->clusters.begin() ; it2 != it->clusters.end(); ++it2)
// ofstr1<< (it2->startChunk) << "\t" << (it2->endChunk) << "\t"
// << (it2->isReverse ? "-1","+1") << "\t" << (it2->shift) << "\t"
// << (it2->startPos) << "\t" << (it2->endPos) << "\t|\t";
// ofstr1<<endl;
//style 2:
for ( vector<solvedFragInfo>::iterator it2 = it->clusters.begin() ; it2 < it->clusters.end(); it2++){
(ofstr_Informatives)<< (it->readName) <<"\t|\t"
<< (it2->startChunk) << "\t" << (it2->endChunk) << "\t"
<< (it2->isReverse ? "-1":"+1") << "\t" << (it2->shift) << "\t"
<< (it2->startPos) << "\t" << (it2->endPos) << endl;
}
}
}
void writeUnMapped( vector<unMappedReads>* unMappeds/*, ofstream *ofstr1*/ ){
// [Complete]
writeUnMappedMutex.lock();
cnt_unmapped += unMappeds->size();
for ( vector<unMappedReads>::iterator it = unMappeds->begin() ; it != unMappeds->end(); ++it)
(ofstr_unMapped)<< (it->name) <<"\n"<< (it->read) <<"\n"<< (it->quality) <<endl;
writeUnMappedMutex.unlock();
}
#endif // WRITERESULTS_H