forked from statgen/popscle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dropseq.h
58 lines (45 loc) · 1.46 KB
/
dropseq.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
#ifndef __DROPSEQ_H
#define __DROPSEQ_H
#include <map>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdlib>
#include "Error.h"
extern "C" {
#include "htslib/sam.h"
}
class DropCell;
class DropTranscript;
typedef std::map< int32_t, int32_t > ii_map_t;
typedef std::map< int32_t, int32_t >::iterator ii_map_it_t;
typedef std::pair< int32_t, int32_t > ii_pair_t;
typedef std::map< std::string, DropCell* > sc_map_t;
typedef std::map< std::string, DropCell* >::iterator sc_map_it_t;
typedef std::map< int32_t, DropTranscript* > it_map_t;
typedef std::map< int32_t, DropTranscript* >::iterator it_map_it_t;
typedef std::map< std::string, ii_pair_t > sr_map_t;
typedef std::map< std::string, ii_pair_t >::iterator sr_map_it_t;
// represent a dropseq library
class DropLibrary {
public:
sc_map_t mapCell; // <string, DropCell*>
~DropLibrary();
DropCell* getCell(std::string& barcode);
ii_pair_t& addRead(std::string& barcode, int32_t tid, std::string& umi, int32_t nh);
//ii_pair_t& addRead(bam_hdr_t* h, bam1_t* b, const char* NH, const char* NM);
};
// represent a dropseq cell
class DropCell {
public:
it_map_t mapTranscript; // <int, DropTranscript*>
~DropCell();
DropTranscript* getTranscript(int32_t tid);
ii_pair_t& addRead(int32_t tid, std::string& umi, int32_t nh);
};
class DropTranscript {
public:
sr_map_t mapRead; // <string, <int,int> > : UMI, <numDups, minNH>
ii_pair_t& addRead( std::string& umi, int32_t nh);
};
#endif