NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Enumerations
cram_structs.h File Reference
#include <stdint.h>
#include "cram/thread_pool.h"
#include "cram/bam.h"

Go to the source code of this file.

Classes

struct  cram_stats
 
struct  cram_file_def
 
struct  cram_metrics
 
struct  cram_block
 
struct  cram_block_compression_hdr
 
struct  cram_map
 
struct  cram_block_slice_hdr
 
struct  cram_container
 
struct  cram_record
 
struct  cram_feature
 
struct  cram_slice
 
struct  ref_entry
 
struct  refs_t
 
struct  cram_index
 
struct  cram_range
 
struct  spare_bams
 
struct  cram_fd
 

Macros

#define SEQS_PER_SLICE   10000
 
#define SLICE_PER_CNT   1
 
#define CRAM_SUBST_MATRIX   "CGTNAGTNACTNACGNACGT"
 
#define TN_external
 
#define TS_external
 
#define MAX_STAT_VAL   1024
 
#define CRAM_1_VERS   100
 
#define CRAM_2_VERS   200
 
#define CRAM_MAP_HASH   32
 
#define CRAM_MAP(a, b)   (((a)*3+(b))&(CRAM_MAP_HASH-1))
 
#define cram_qname(c)   (&(c)->s->name_blk->data[(c)->name])
 
#define cram_seq(c)   (&(c)->s->seqs_blk->data[(c)->seq])
 
#define cram_qual(c)   (&(c)->s->qual_blk->data[(c)->qual])
 
#define cram_aux(c)   (&(c)->s->aux_blk->data[(c)->aux])
 
#define cram_seqi(c, i)   (cram_seq((c))[(i)])
 
#define cram_name_len(c)   ((c)->name_len)
 
#define cram_strand(c)   (((c)->flags & BAM_FREVERSE) != 0)
 
#define cram_mstrand(c)   (((c)->flags & BAM_FMREVERSE) != 0)
 
#define cram_cigar(c)   (&((cr)->s->cigar)[(c)->cigar])
 
#define CRAM_FPAIRED   256
 
#define CRAM_FPROPER_PAIR   128
 
#define CRAM_FUNMAP   64
 
#define CRAM_FREVERSE   32
 
#define CRAM_FREAD1   16
 
#define CRAM_FREAD2   8
 
#define CRAM_FSECONDARY   4
 
#define CRAM_FQCFAIL   2
 
#define CRAM_FDUP   1
 
#define CRAM_M_REVERSE   1
 
#define CRAM_M_UNMAP   2
 
#define CRAM_FLAG_PRESERVE_QUAL_SCORES   (1<<0)
 
#define CRAM_FLAG_DETACHED   (1<<1)
 
#define CRAM_FLAG_MATE_DOWNSTREAM   (1<<2)
 
#define CRAM_EXT_IN   0
 
#define CRAM_EXT_QUAL   1
 
#define CRAM_EXT_NAME   2
 
#define CRAM_EXT_TS_NP   3
 
#define CRAM_EXT_TAG   4
 
#define CRAM_EXT_TAG_S   "\004"
 
#define CRAM_EXT_BA   5
 
#define CRAM_EXT_TN   6
 
#define CRAM_EXT_SC   7
 
#define CRAM_EXT_REF   8
 

Typedefs

typedef FILE cram_FILE
 
typedef struct cram_map cram_map
 
typedef struct cram_slice cram_slice
 
typedef struct ref_entry ref_entry
 
typedef struct cram_index cram_index
 
typedef struct spare_bams spare_bams
 
typedef struct cram_fd cram_fd
 

Enumerations

enum  cram_encoding {
  E_NULL = 0, E_EXTERNAL = 1, E_GOLOMB = 2, E_HUFFMAN = 3,
  E_BYTE_ARRAY_LEN = 4, E_BYTE_ARRAY_STOP = 5, E_BETA = 6, E_SUBEXP = 7,
  E_GOLOMB_RICE = 8, E_GAMMA = 9
}
 
enum  cram_external_type {
  E_INT = 1, E_LONG = 2, E_BYTE = 3, E_BYTE_ARRAY = 4,
  E_BYTE_ARRAY_BLOCK = 5
}
 
enum  cram_block_method { BM_ERROR = -1, RAW = 0, GZIP = 1, BZIP2 = 2 }
 
enum  cram_content_type {
  CT_ERROR = -1, FILE_HEADER = 0, COMPRESSION_HEADER = 1, MAPPED_SLICE = 2,
  UNMAPPED_SLICE = 3, EXTERNAL = 4, CORE = 5
}
 
enum  cram_option {
  CRAM_OPT_DECODE_MD, CRAM_OPT_PREFIX, CRAM_OPT_VERBOSITY, CRAM_OPT_SEQS_PER_SLICE,
  CRAM_OPT_SLICES_PER_CONTAINER, CRAM_OPT_RANGE, CRAM_OPT_VERSION, CRAM_OPT_EMBED_REF,
  CRAM_OPT_IGNORE_MD5, CRAM_OPT_REFERENCE, CRAM_OPT_MULTI_SEQ_PER_SLICE, CRAM_OPT_NO_REF,
  CRAM_OPT_USE_BZIP2, CRAM_OPT_SHARED_REF, CRAM_OPT_NTHREADS, CRAM_OPT_THREAD_POOL
}
 

Macro Definition Documentation

#define CRAM_1_VERS   100

Definition at line 142 of file cram_structs.h.

#define CRAM_2_VERS   200

Definition at line 143 of file cram_structs.h.

#define cram_aux (   c)    (&(c)->s->aux_blk->data[(c)->aux])

Definition at line 416 of file cram_structs.h.

#define cram_cigar (   c)    (&((cr)->s->cigar)[(c)->cigar])

Definition at line 421 of file cram_structs.h.

#define CRAM_EXT_BA   5

Definition at line 743 of file cram_structs.h.

#define CRAM_EXT_IN   0

Definition at line 737 of file cram_structs.h.

#define CRAM_EXT_NAME   2

Definition at line 739 of file cram_structs.h.

#define CRAM_EXT_QUAL   1

Definition at line 738 of file cram_structs.h.

#define CRAM_EXT_REF   8

Definition at line 746 of file cram_structs.h.

#define CRAM_EXT_SC   7

Definition at line 745 of file cram_structs.h.

#define CRAM_EXT_TAG   4

Definition at line 741 of file cram_structs.h.

#define CRAM_EXT_TAG_S   "\004"

Definition at line 742 of file cram_structs.h.

#define CRAM_EXT_TN   6

Definition at line 744 of file cram_structs.h.

#define CRAM_EXT_TS_NP   3

Definition at line 740 of file cram_structs.h.

#define CRAM_FDUP   1

Definition at line 725 of file cram_structs.h.

#define CRAM_FLAG_DETACHED   (1<<1)

Definition at line 733 of file cram_structs.h.

#define CRAM_FLAG_MATE_DOWNSTREAM   (1<<2)

Definition at line 734 of file cram_structs.h.

#define CRAM_FLAG_PRESERVE_QUAL_SCORES   (1<<0)

Definition at line 732 of file cram_structs.h.

#define CRAM_FPAIRED   256

Definition at line 717 of file cram_structs.h.

#define CRAM_FPROPER_PAIR   128

Definition at line 718 of file cram_structs.h.

#define CRAM_FQCFAIL   2

Definition at line 724 of file cram_structs.h.

#define CRAM_FREAD1   16

Definition at line 721 of file cram_structs.h.

#define CRAM_FREAD2   8

Definition at line 722 of file cram_structs.h.

#define CRAM_FREVERSE   32

Definition at line 720 of file cram_structs.h.

#define CRAM_FSECONDARY   4

Definition at line 723 of file cram_structs.h.

#define CRAM_FUNMAP   64

Definition at line 719 of file cram_structs.h.

#define CRAM_M_REVERSE   1

Definition at line 727 of file cram_structs.h.

#define CRAM_M_UNMAP   2

Definition at line 728 of file cram_structs.h.

#define CRAM_MAP (   a,
 
)    (((a)*3+(b))&(CRAM_MAP_HASH-1))

Definition at line 192 of file cram_structs.h.

#define CRAM_MAP_HASH   32

Definition at line 191 of file cram_structs.h.

#define cram_mstrand (   c)    (((c)->flags & BAM_FMREVERSE) != 0)

Definition at line 420 of file cram_structs.h.

#define cram_name_len (   c)    ((c)->name_len)

Definition at line 418 of file cram_structs.h.

#define cram_qname (   c)    (&(c)->s->name_blk->data[(c)->name])

Definition at line 413 of file cram_structs.h.

#define cram_qual (   c)    (&(c)->s->qual_blk->data[(c)->qual])

Definition at line 415 of file cram_structs.h.

#define cram_seq (   c)    (&(c)->s->seqs_blk->data[(c)->seq])

Definition at line 414 of file cram_structs.h.

#define cram_seqi (   c,
 
)    (cram_seq((c))[(i)])

Definition at line 417 of file cram_structs.h.

#define cram_strand (   c)    (((c)->flags & BAM_FREVERSE) != 0)

Definition at line 419 of file cram_structs.h.

#define CRAM_SUBST_MATRIX   "CGTNAGTNACTNACGNACGT"

Definition at line 96 of file cram_structs.h.

#define MAX_STAT_VAL   1024

Definition at line 103 of file cram_structs.h.

#define SEQS_PER_SLICE   10000

Definition at line 93 of file cram_structs.h.

#define SLICE_PER_CNT   1

Definition at line 94 of file cram_structs.h.

#define TN_external

Definition at line 98 of file cram_structs.h.

#define TS_external

Definition at line 100 of file cram_structs.h.

Typedef Documentation

typedef struct cram_fd cram_fd
typedef FILE cram_FILE

Definition at line 90 of file cram_structs.h.

typedef struct cram_index cram_index
typedef struct cram_map cram_map
typedef struct cram_slice cram_slice
typedef struct ref_entry ref_entry
typedef struct spare_bams spare_bams

Enumeration Type Documentation

Enumerator
BM_ERROR 
RAW 
GZIP 
BZIP2 

Definition at line 147 of file cram_structs.h.

Enumerator
CT_ERROR 
FILE_HEADER 
COMPRESSION_HEADER 
MAPPED_SLICE 
UNMAPPED_SLICE 
EXTERNAL 
CORE 

Definition at line 154 of file cram_structs.h.

Enumerator
E_NULL 
E_EXTERNAL 
E_GOLOMB 
E_HUFFMAN 
E_BYTE_ARRAY_LEN 
E_BYTE_ARRAY_STOP 
E_BETA 
E_SUBEXP 
E_GOLOMB_RICE 
E_GAMMA 

Definition at line 113 of file cram_structs.h.

Enumerator
E_INT 
E_LONG 
E_BYTE 
E_BYTE_ARRAY 
E_BYTE_ARRAY_BLOCK 

Definition at line 126 of file cram_structs.h.

Enumerator
CRAM_OPT_DECODE_MD 
CRAM_OPT_PREFIX 
CRAM_OPT_VERBOSITY 
CRAM_OPT_SEQS_PER_SLICE 
CRAM_OPT_SLICES_PER_CONTAINER 
CRAM_OPT_RANGE 
CRAM_OPT_VERSION 
CRAM_OPT_EMBED_REF 
CRAM_OPT_IGNORE_MD5 
CRAM_OPT_REFERENCE 
CRAM_OPT_MULTI_SEQ_PER_SLICE 
CRAM_OPT_NO_REF 
CRAM_OPT_USE_BZIP2 
CRAM_OPT_SHARED_REF 
CRAM_OPT_NTHREADS 
CRAM_OPT_THREAD_POOL 

Definition at line 696 of file cram_structs.h.