Imported Upstream version 0.3
[pysam.git] / pysam / pysam_util.h
1 #ifndef PYSAM_UTIL_H
2 #define PYSAM_UTIL_H
3
4 //////////////////////////////////////////////////////////////////
5 //////////////////////////////////////////////////////////////////
6 //////////////////////////////////////////////////////////////////
7 // various helper functions
8 //
9 // fill pileup buffer for next position.
10
11 int pysam_pileup_next(const bam1_t *b,
12                       bam_plbuf_t *buf,
13                       bam_pileup1_t ** plp,
14                       int * tid,
15                       int * pos,
16                       int * n_plp);
17
18 int pysam_dispatch(int argc, char *argv[] );
19
20 /*!
21   @abstract Update the variable length data within a bam1_t entry
22
23   Old data is deleted and the data within b are re-arranged to 
24   make place for new data.
25   
26   @discussion Returns b
27
28   @param  b           bam1_t data
29   @param  nbytes_old  size of old data
30   @param  nbytes_new  size of new data
31   @param  pos         position of data
32 */
33 bam1_t * pysam_bam_update( bam1_t * b,
34                            const size_t nbytes_old,
35                            const size_t nbytes_new,
36                            uint8_t * pos );
37
38 // translate a nucleotide character to binary code
39 unsigned char pysam_translate_sequence( const unsigned char s );
40
41
42 #endif