comparison PsiCLASS-1.0.2/samtools-0.1.19/bam_tview.h @ 0:903fc43d6227 draft default tip

Uploaded
author lsong10
date Fri, 26 Mar 2021 16:52:45 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:903fc43d6227
1 #ifndef BAM_TVIEW_H
2 #define BAM_TVIEW_H
3
4 #include <ctype.h>
5 #include <assert.h>
6 #include <string.h>
7 #include <math.h>
8 #include <unistd.h>
9 #include <stdarg.h>
10 #include "bam.h"
11 #include "faidx.h"
12 #include "bam2bcf.h"
13 #include "sam_header.h"
14 #include "khash.h"
15
16 KHASH_MAP_INIT_STR(kh_rg, const char *)
17
18 typedef struct AbstractTview {
19 int mrow, mcol;
20
21 bam_index_t *idx;
22 bam_lplbuf_t *lplbuf;
23 bam_header_t *header;
24 bamFile fp;
25 int curr_tid, left_pos;
26 faidx_t *fai;
27 bcf_callaux_t *bca;
28
29 int ccol, last_pos, row_shift, base_for, color_for, is_dot, l_ref, ins, no_skip, show_name;
30 char *ref;
31 khash_t(kh_rg) *rg_hash;
32 /* callbacks */
33 void (*my_destroy)(struct AbstractTview* );
34 void (*my_mvprintw)(struct AbstractTview* ,int,int,const char*,...);
35 void (*my_mvaddch)(struct AbstractTview*,int,int,int);
36 void (*my_attron)(struct AbstractTview*,int);
37 void (*my_attroff)(struct AbstractTview*,int);
38 void (*my_clear)(struct AbstractTview*);
39 int (*my_colorpair)(struct AbstractTview*,int);
40 int (*my_drawaln)(struct AbstractTview*,int,int);
41 int (*my_loop)(struct AbstractTview*);
42 int (*my_underline)(struct AbstractTview*);
43 } tview_t;
44
45
46 char bam_aux_getCEi(bam1_t *b, int i);
47 char bam_aux_getCSi(bam1_t *b, int i);
48 char bam_aux_getCQi(bam1_t *b, int i);
49
50 #define TV_MIN_ALNROW 2
51 #define TV_MAX_GOTO 40
52 #define TV_LOW_MAPQ 10
53
54 #define TV_COLOR_MAPQ 0
55 #define TV_COLOR_BASEQ 1
56 #define TV_COLOR_NUCL 2
57 #define TV_COLOR_COL 3
58 #define TV_COLOR_COLQ 4
59
60 #define TV_BASE_NUCL 0
61 #define TV_BASE_COLOR_SPACE 1
62
63 int tv_pl_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void *data);
64 int base_tv_init(tview_t*,const char *fn, const char *fn_fa, const char *samples);
65 void base_tv_destroy(tview_t*);
66 int base_draw_aln(tview_t *tv, int tid, int pos);
67
68 typedef struct Tixel
69 {
70 int ch;
71 int attributes;
72 }tixel_t;
73
74 #endif
75