-
Notifications
You must be signed in to change notification settings - Fork 3
/
testRecons.cpp
49 lines (36 loc) · 995 Bytes
/
testRecons.cpp
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
/*
* testUtils
* Date: Aug-20-2012
* Author : Gabriel Renaud gabriel.reno [at sign here ] gmail.com
*
*/
#include <iostream>
#include <fstream>
#include <memory>
#include "api/BamMultiReader.h"
#include "api/BamReader.h"
#include "api/BamWriter.h"
#include "api/BamAux.h"
#include "ReconsReferenceBAM.h"
#include "libgab.h"
using namespace std;
int main (int argc, char *argv[]) {
string bamfiletopen = string(argv[1]);
BamReader reader;
if ( !reader.Open(bamfiletopen) ) {
cerr << "Could not open input BAM files." << endl;
return 1;
}
BamAlignment al;
while ( reader.GetNextAlignment(al) ) {
string reconstructedReference = reconstructRef(&al);
cout<<al.QueryBases<<endl;
cout<<reconstructedReference<<endl;
pair< string, vector<int> > reconP = reconstructRefWithPos(&al);
for(unsigned int i=0;i<reconP.first.size();i++){
cout<<reconP.first[i]<<"\t"<<reconP.second[i]<<endl;
}
}
reader.Close();
return 0;
}