NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions
cram_encode.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"

Go to the source code of this file.

Macros

#define Z_CRAM_STRAT   Z_FILTERED
 
#define USE_METRICS
 
#define LEVEL2   1
 
#define STRAT2   Z_RLE
 

Functions

void bam_copy (bam_seq_t **bt, bam_seq_t *bf)
 
cram_blockcram_encode_compression_header (cram_fd *fd, cram_container *c, cram_block_compression_hdr *h)
 
cram_blockcram_encode_slice_header (cram_fd *fd, cram_slice *s)
 
int cram_encode_container (cram_fd *fd, cram_container *c)
 
int cram_put_bam_seq (cram_fd *fd, bam_seq_t *b)
 

Macro Definition Documentation

#define LEVEL2   1
#define STRAT2   Z_RLE
#define USE_METRICS
#define Z_CRAM_STRAT   Z_FILTERED

Definition at line 69 of file cram_encode.c.

Function Documentation

void bam_copy ( bam_seq_t **  bt,
bam_seq_t bf 
)

Definition at line 53 of file cram_encode.c.

cram_block* cram_encode_compression_header ( cram_fd fd,
cram_container c,
cram_block_compression_hdr h 
)

INTERNAL: Encodes a compression header block into a generic cram_block structure.

Returns
Returns cram_block ptr on success; NULL on failure

Definition at line 95 of file cram_encode.c.

int cram_encode_container ( cram_fd fd,
cram_container c 
)

INTERNAL: Encodes all slices in a container into blocks.

Returns
Returns 0 on success; -1 on failure

FIXME: separate into encode_container and write_container. Ideally we should be able to do read_container / write_container or decode_container / encode_container.

Definition at line 1086 of file cram_encode.c.

cram_block* cram_encode_slice_header ( cram_fd fd,
cram_slice s 
)

INTERNAL: Encodes a slice compression header.

Returns
Returns cram_block on success; NULL on failure

Definition at line 588 of file cram_encode.c.

int cram_put_bam_seq ( cram_fd fd,
bam_seq_t b 
)

Write iterator: put BAM format sequences into a CRAM file.

We buffer up a containers worth of data at a time.

FIXME: break this into smaller pieces.

Returns
Returns 0 on success; -1 on failure

Definition at line 2517 of file cram_encode.c.