File: maqmap.h

package info (click to toggle)
maqview 0.2.5-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,404 kB
  • sloc: ansic: 13,310; cpp: 1,295; java: 178; perl: 116; sh: 101; makefile: 23
file content (70 lines) | stat: -rw-r--r-- 1,677 bytes parent folder | download | duplicates (6)
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
#ifndef MAQMAP_H_
#define MAQMAP_H_

#ifdef MAQ_LONGREADS
#define MAX_READLEN 128
#else
#define MAX_READLEN 64
#endif
#ifndef MAX_NAMELEN
#define MAX_NAMELEN 36
#endif

#define MAQMAP_FORMAT_OLD 0
#define MAQMAP_FORMAT_NEW -1

#define PAIRFLAG_FF      0x01
#define PAIRFLAG_FR      0x02
#define PAIRFLAG_RF      0x04
#define PAIRFLAG_RR      0x08
#define PAIRFLAG_PAIRED  0x10
#define PAIRFLAG_DIFFCHR 0x20
#define PAIRFLAG_NOMATCH 0x40
#define PAIRFLAG_SW      0x80

#include <string.h>
#include "zrio.h"
#include "const.h"

/*
  name: read name
  size: the length of the read
  seq: read sequence (see also below)
  seq[MAX_READLEN-1]: single end mapping quality (equals to map_qual if not paired)
  map_qual: the final mapping quality
  alt_qual: the lower quality of the two ends (equals to map_qual if not paired)
  flag: status of the pair
  dist: offset of the mate (zero if not paired)
  info1: mismatch and rough sum of errors of the best hit
  info2: mismatch and rough sum of errors of the second best hit
  c[2]: count of all 0- and 1-mismatch hits on the reference
 */
typedef struct
{
	bit8_t seq[MAX_READLEN]; /* the last base is the single-end mapping quality. */
	bit8_t size, map_qual, info1, info2, c[2], flag, alt_qual;
	bit32_t seqid, pos;
	int dist;
	char name[MAX_NAMELEN];
} maqmap1_t;

typedef struct
{
	int format, n_ref;
	char **ref_name;
	bit64_t n_mapped_reads;
	maqmap1_t *mapped_reads;
} maqmap_t;

#define maqmap_read1(fp, m1) gzread((fp), (m1), sizeof(maqmap1_t))

#ifdef __cplusplus
extern "C" {
#endif
	maqmap_t *maqmap_read_header(zr_stream *fp);
	void maqmap_write_header(gzFile fp, const maqmap_t *mm);
#ifdef __cplusplus
}
#endif

#endif