-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBAM2ACF.h
90 lines (72 loc) · 2.27 KB
/
BAM2ACF.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
87
88
89
90
/*
* BAM2ACF
* Date: Jul-30-2017
* Author : Gabriel Renaud gabriel.reno [at sign here] gmail.com
*
*/
#ifndef BAM2ACF_h
#define BAM2ACF_h
#include <string>
extern "C" {
//#include "tabix.h"
//#include "bam.h"
#include "htslib/sam.h"
#include "htslib/faidx.h"
#include "htslib/tbx.h"
#include "htslib/bgzf.h"
#include "bam.h"
#include "samtools.h"
#include "sam_opts.h"
#include "bedidx.h"
}
#define bam_is_properpair(b) (((b)->core.flag&BAM_FPROPER_PAIR) != 0)
#define bam_is_paired(b) (((b)->core.flag&BAM_FPAIRED) != 0)
#define bam_is_pair1(b) (((b)->core.flag&BAM_FREAD1) != 0)
#define bam_is_pair2(b) (((b)->core.flag&BAM_FREAD2) != 0)
#define bam_is_qcfailed(b) (((b)->core.flag&BAM_FQCFAIL) != 0)
#define bam_is_rmdup(b) (((b)->core.flag&BAM_FDUP) != 0)
#define bam_is_failed(b) ( bam_is_qcfailed(b) || bam_is_rmdup(b) )
#define bam_mqual(b) ((b)->core.qual)
#define bam1_qname(b) (bam_get_qname((b)))
typedef struct { // auxiliary data structure
samFile *fp; // the file handle
bam_hdr_t *hdr; // the file header
hts_itr_t *iter; // NULL if a region not specified
int min_mapQ, min_len; // mapQ filter; length filter
} aux_t;
/* #include <api/BamConstants.h> */
/* #include <api/BamMultiReader.h> */
#include <utils/bamtools_fasta.h>
/* #include <utils/bamtools_options.h> */
/* #include <utils/bamtools_pileup_engine.h> */
/* #include <utils/bamtools_utilities.h> */
#include <climits>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include "libgab.h"
#include "ReadTabix.h"
#include "GlacWriter.h"
#include "GlacParser.h"
#include "AlleleRecords.h"
#include "GlactoolsOperations.h"
using namespace std;
class BAM2ACF{
private:
bool uncompressed = 0;
string epoFile = "none";
bool epoFileB = false;
bool useQCFail = false;
int minBaseQual = 0;
public:
BAM2ACF();
BAM2ACF(const BAM2ACF & other);
~BAM2ACF();
BAM2ACF & operator= (const BAM2ACF & other);
string usage() const;
int run(int argc, char *argv[]);
static void setVarsEPO(ReadTabix * rtEPO,string & epoChr,unsigned int & epoCoord,bool & cpgEPO,char & allel_chimp,char & allel_anc,bool & lineLeftEPO,string & lineFromEPO);
};
#endif