modified: SpatialOmicsCoord.py
[GalaxyCodeBases.git] / BGI / SOAPsnp / SamCtrl.h
blob0b868194e8916f15c17dba21a61b63313c599144
1 /*
2 ******************************************************************************
3 *Copyright 2010
4 * BGI-SHENZHEN
5 *All Rights Reserved
6 *ATHUOR : Bill Tang
7 *CREATE DATE : 2010-7-29
8 *CLASS NAME: SamCtrl
9 *FUNCTION : a class that can control sam/bam format file. It is convenient to control sam/bam
10 * format file like open, read, write, close and so on.
11 *FILE NAME : SamCtrl.h
12 *UPDATE DATE : 2010-7-30
13 *UPDATE BY : Bill Tang
14 *******************************************************************************
17 #pragma once
19 #include <cmath>
20 #include <string>
21 #include "sam/bam.h"
22 #include "sam/faidx.h"
23 #include "sam/knetfile.h"
24 #include "sam/sam.h"
25 #include "sam/sam_view.h"
26 #include "sam/xcurses.h"
27 #include "sam/zlib.h"
28 #include "sam/bgzf.h"
29 #include "sam/glf.h"
30 #include "sam/kstring.h"
31 #include "sam/razf.h"
32 #include "sam/sam_header.h"
33 #include "sam/zconf.h"
35 class SamCtrl
37 private:
38 std::string m_in_path; // the sam/bam in file's path.
39 std::string m_out_path; // the sam/bam out file's path.
40 samfile_t *m_in; // sam/bam file handler, use as reading.
41 samfile_t *m_out; // sam/bam file handler, use as writing.
42 std::string m_in_mode; // reading mode
43 std::string m_out_mode; // wrinting mode
44 char *m_fn_list; // sam/bam file list.
45 char *m_s; // an tmp varible
46 bam1_t *m_b; // a bam constructor.
47 public:
48 SamCtrl();
49 ~SamCtrl(void);
51 bool open(const char *path, const char *mode);
52 void close();
53 int readline(std::string &line);
54 bool isOpened();