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