modified: makefile
[GalaxyCodeBases.git] / BGI / SOAPdenovo2 / standardPregraph / inc / glf.h
bloba6d23376d2b5174847d6ac2da57d5cb9942e45a3
2 #ifndef GLF_H_
3 #define GLF_H_
5 typedef struct
7 unsigned char ref_base: 4, dummy: 4; /** "XACMGRSVTWYHKDBN"[ref_base] gives the reference base */
8 unsigned char max_mapQ; /** maximum mapping quality */
9 unsigned char lk[10]; /** log likelihood ratio, capped at 255 */
10 unsigned min_lk: 8, depth: 24; /** minimum lk capped at 255, and the number of mapped reads */
11 } glf1_t;
13 #include <stdint.h>
14 #include "bgzf.h"
15 typedef BGZF * glfFile;
17 #define GLF3_RTYPE_END 0
18 #define GLF3_RTYPE_SUB 1
19 #define GLF3_RTYPE_INDEL 2
21 typedef struct
23 uint8_t ref_base: 4, rtype: 4; /** "XACMGRSVTWYHKDBN"[ref_base] gives the reference base */
24 uint8_t rms_mapQ; /** RMS mapping quality */
25 uint8_t lk[10]; /** log likelihood ratio, capped at 255 */
26 uint32_t min_lk: 8, depth: 24; /** minimum lk capped at 255, and the number of mapped reads */
27 int32_t offset; /** the first base in a chromosome has offset zero. */
28 // for indel (lkHom1, lkHom2 and lkHet are the first three elements in lk[10])
29 int16_t indel_len[2];
30 int32_t max_len; // maximum indel len; will be modified by glf3_read1()
31 char * indel_seq[2];
32 } glf3_t;
34 typedef struct
36 int32_t l_text;
37 uint8_t * text;
38 } glf3_header_t;
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 #define glf3_init1() ((glf3_t*)calloc(1, sizeof(glf3_t)))
45 #define glf3_destroy1(g3) do { free((g3)->indel_seq[0]); free((g3)->indel_seq[1]); free(g3); } while (0)
47 glf3_header_t * glf3_header_init();
48 glf3_header_t * glf3_header_read ( glfFile fp );
49 void glf3_header_write ( glfFile fp, const glf3_header_t * h );
50 void glf3_header_destroy ( glf3_header_t * h );
51 char * glf3_ref_read ( glfFile fp, int * len );
52 void glf3_ref_write ( glfFile fp, const char * name, int len );
53 int glf3_write1 ( glfFile fp, const glf3_t * g3 );
54 int glf3_read1 ( glfFile fp, glf3_t * g3 );
56 #ifdef __cplusplus
58 #endif
60 #endif