sam.h |
This file provides higher level of I/O routines and unifies the APIs
for SAM and BAM formats. These APIs are more convenient and
recommended.
samopen |
Open a SAM/BAM file
samfile_t *samopen( const char *fn, const char *mode, const void *aux);
fn
mode
aux
SAM/BAM file handler
samclose |
Close a SAM/BAM handler
void samclose( samfile_t *fp);
fp
samread |
Read one alignment
int samread( samfile_t *fp, bam1_t *b);
fp
b
bytes read
samwrite |
Write one alignment
int samwrite( samfile_t *fp, const bam1_t *b);
fp
b
bytes written
sampileup |
Get the pileup for a whole alignment file
int sampileup( samfile_t *fp, int mask, bam_pileup_f func, void *data);
fp
mask
func
samfile_t |
SAM/BAM file handler
typedef struct { int type; union { tamFile tamr; bamFile bam; FILE *tamw; } x; bam_header_t *header; } samfile_t;
type
- type of the handler; bit 1 for BAM and bit 2 for reading
bam
- BAM file handler; valid if (type&1) == 1
tamr
- SAM file handler for reading; valid if type == 2
tamw
- SAM file handler for writing; valid if type == 0
header
- header struct
© Genome Research Ltd. Last Updated: Saturday, June 13, 2009