Imported Upstream version 0.7
[pysam.git] / pysam / pysam_util.h
index 89e381bbd8fee3762d56a1d7dad14b9c44f6b8a2..90a9378c89b9b75b2b21fe9b4ad722588fb89828 100644 (file)
@@ -2,8 +2,18 @@
 #define PYSAM_UTIL_H
 
 //////////////////////////////////////////////////////////////////
-// set pysam standard error to point to stream
-FILE * pysam_set_stderr( FILE * f );
+/*! set pysam standard error to point to file descriptor
+
+  Setting the stderr will close the previous stderr.
+ */
+FILE * pysam_set_stderr( int fd );
+
+//////////////////////////////////////////////////////////////////
+/*! set pysam standard error to /dev/null.
+  
+  Unsetting the stderr will close the previous stderr.
+ */
+void pysam_unset_stderr();
 
 //////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////
@@ -48,12 +58,21 @@ extern unsigned char bam_nt16_table[256];
 // translate a reference string *s* to a tid
 int pysam_reference2tid( bam_header_t *header, const char * s );
 
+// return number of mapped reads for tid
+uint32_t pysam_get_mapped( const bam_index_t *idx, const int tid );
+
+// return number of unmapped reads for tid
+uint32_t pysam_get_unmapped( const bam_index_t *idx, const int tid );
+
 // debugging functions
-#include "glf.h"
-uint32_t pysam_glf_depth( glf1_t * g);
+/* #include "glf.h" */
+/* uint32_t pysam_glf_depth( glf1_t * g); */
+
+/* #include "bam_maqcns.h" */
+/* void pysam_dump_glf( glf1_t * g, bam_maqcns_t * c ); */
 
-#include "bam_maqcns.h"
-void pysam_dump_glf( glf1_t * g, bam_maqcns_t * c );
 
+// return size of auxilliary type
+// int bam_aux_type2size(int x);
 
 #endif