4 //////////////////////////////////////////////////////////////////
5 /*! set pysam standard error to point to file descriptor
7 Setting the stderr will close the previous stderr.
9 FILE * pysam_set_stderr( int fd );
11 //////////////////////////////////////////////////////////////////
12 /*! set pysam standard error to /dev/null.
14 Unsetting the stderr will close the previous stderr.
16 void pysam_unset_stderr();
18 //////////////////////////////////////////////////////////////////
19 //////////////////////////////////////////////////////////////////
20 //////////////////////////////////////////////////////////////////
21 // various helper functions
23 // fill pileup buffer for next position.
25 int pysam_pileup_next(const bam1_t *b,
32 int pysam_dispatch(int argc, char *argv[] );
35 @abstract Update the variable length data within a bam1_t entry
37 Old data is deleted and the data within b are re-arranged to
38 make place for new data.
43 @param nbytes_old size of old data
44 @param nbytes_new size of new data
45 @param pos position of data
47 bam1_t * pysam_bam_update( bam1_t * b,
48 const size_t nbytes_old,
49 const size_t nbytes_new,
52 // translate a nucleotide character to binary code
53 unsigned char pysam_translate_sequence( const unsigned char s );
55 // defined in bam_import.c
56 extern unsigned char bam_nt16_table[256];
58 // translate a reference string *s* to a tid
59 int pysam_reference2tid( bam_header_t *header, const char * s );
61 // return number of mapped reads for tid
62 uint32_t pysam_get_mapped( const bam_index_t *idx, const int tid );
64 // return number of unmapped reads for tid
65 uint32_t pysam_get_unmapped( const bam_index_t *idx, const int tid );
67 // debugging functions
68 /* #include "glf.h" */
69 /* uint32_t pysam_glf_depth( glf1_t * g); */
71 /* #include "bam_maqcns.h" */
72 /* void pysam_dump_glf( glf1_t * g, bam_maqcns_t * c ); */
75 // return size of auxilliary type
76 // int bam_aux_type2size(int x);