src/hg/inc/bamFile.h 1.8

1.8 2009/09/14 23:44:25 angie
Added bamFileNameFromTable to bamFile.h and changed bamFetch to take a filename, not db+table, so it can be used for CT files someday. bamFileNameFromTable supports an optional seqName column in the db table, for per-chrom BAM files (as we get from 1000Genomes).
Index: src/hg/inc/bamFile.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/inc/bamFile.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -b -B -U 4 -r1.7 -r1.8
--- src/hg/inc/bamFile.h	24 Aug 2009 23:47:56 -0000	1.7
+++ src/hg/inc/bamFile.h	14 Sep 2009 23:44:25 -0000	1.8
@@ -11,13 +11,18 @@
 void bamIgnoreStrand();
 /* Change the behavior of this lib to disregard item strand. 
  * If called, this should be called before any other bam functions. */
 
-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,
+char *bamFileNameFromTable(char *db, char *table, char *bamSeqName);
+/* Return file name from table.  If table has a seqName column, then grab the 
+ * row associated with bamSeqName (which is not nec. in chromInfo, e.g. 
+ * bam file might have '1' not 'chr1'). */
+
+void bamFetch(char *bamFileName, char *position, bam_fetch_f callbackFunc, void *callbackData);
+/* Open the .bam file, 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. */
+ * Note: if sequences in .bam file don't begin with "chr" but cart position does, pass in 
+ * cart position + strlen("chr") to match the .bam file sequence names. */
 
 boolean bamIsRc(const bam1_t *bam);
 /* Return TRUE if alignment is on - strand.  If bamIgnoreStrand has been called,
  * then this always returns FALSE. */