Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions
cram_decode.c File Reference
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <math.h>
#include <ctype.h>
#include "cram/cram.h"
#include "cram/os.h"
#include "cram/md5.h"

Classes

struct  cram_decode_job
 

Functions

int cram_decode_TD (char *cp, cram_block_compression_hdr *h)
 
cram_block_compression_hdrcram_decode_compression_header (cram_fd *fd, cram_block *b)
 
int cram_dependent_data_series (cram_fd *fd, cram_block_compression_hdr *hdr, cram_slice *s)
 
cram_block_slice_hdrcram_decode_slice_header (cram_fd *fd, cram_block *b)
 
int cram_decode_slice (cram_fd *fd, cram_container *c, cram_slice *s, SAM_hdr *bfd)
 
void * cram_decode_slice_thread (void *arg)
 
int cram_decode_slice_mt (cram_fd *fd, cram_container *c, cram_slice *s, SAM_hdr *bfd)
 
cram_recordcram_get_seq (cram_fd *fd)
 
int cram_get_bam_seq (cram_fd *fd, bam_seq_t **bam)
 

Function Documentation

cram_block_compression_hdr* cram_decode_compression_header ( cram_fd fd,
cram_block b 
)

INTERNAL: Decodes a CRAM block compression header.

Returns
Returns header ptr on success; NULL on failure
int cram_decode_slice ( cram_fd fd,
cram_container c,
cram_slice s,
SAM_hdr hdr 
)

INTERNAL: Decode an entire slice from container blocks. Fills out s->crecs[] array.

Returns
Returns 0 on success; -1 on failure
cram_block_slice_hdr* cram_decode_slice_header ( cram_fd fd,
cram_block b 
)

INTERNAL: Decodes a CRAM (un)mapped slice header block.

Returns
Returns slice header ptr on success; NULL on failure
int cram_decode_slice_mt ( cram_fd fd,
cram_container c,
cram_slice s,
SAM_hdr bfd 
)
void* cram_decode_slice_thread ( void *  arg)
int cram_decode_TD ( char *  cp,
cram_block_compression_hdr h 
)
int cram_dependent_data_series ( cram_fd fd,
cram_block_compression_hdr hdr,
cram_slice s 
)
int cram_get_bam_seq ( cram_fd fd,
bam_seq_t **  bam 
)

Read the next cram record and convert it to a bam_seq_t struct.

Returns
Returns 0 on success; -1 on EOF or failure (check fd->err)
cram_record* cram_get_seq ( cram_fd fd)

Read the next cram record and return it as a cram_record.

Note that to decode cram_record the caller will need to look up some data in the current slice, pointed to by fd->ctr->slice. This is valid until the next call to cram_get_seq (which may invalidate it).

Returns
Returns record pointer on success (do not free); NULL on failure