Gamgee
You miserable little maggot. I'll stove your head in!
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
cram_encode.h File Reference

Go to the source code of this file.

Functions

int cram_put_bam_seq (cram_fd *fd, bam_seq_t *b)
 
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)
 

Detailed Description

Include cram.h instead.

This is an internal part of the CRAM system and is automatically included when you #include cram.h.

Implements the encoding portion of CRAM I/O. Also see cram_codecs.[ch] for the actual encoding functions themselves.

Function Documentation

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
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.

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
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