src/hg/inc/bamFile.h 1.1

1.1 2009/07/27 21:52:08 angie
Libified the code that interfaces directly with libbam to open, fetch, close.
Index: src/hg/inc/bamFile.h
===================================================================
RCS file: src/hg/inc/bamFile.h
diff -N src/hg/inc/bamFile.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/hg/inc/bamFile.h	27 Jul 2009 21:52:08 -0000	1.1
@@ -0,0 +1,17 @@
+/* bamFILE -- interface to binary alignment format files using Heng Li's samtools lib. */
+
+#ifndef BAMFILE_H
+#define BAMFILE_H
+
+// bam.h is incomplete without _IOLIB set to 1, 2 or 3.  2 is used by Makefile.generic:
+#define _IOLIB 2
+#include "bam.h"
+#include "sam.h"
+
+void bamFetch(char *db, char *table, char *position, bam_fetch_f callbackFunc, void *callbackData);
+/* Open the .bam file given in db.table, fetch items in the seq:start-end position range,
+ * and call callbackFunc on each bam item retrieved from the file plus callbackData. 
+ * Note: if sequences in .bam file don't begin with "chr" but db's do, skip the "chr"
+ * at the beginning of the position. */
+
+#endif//ndef BAMFILE_H