b29f1fbf93c9df5aa65fed050d9f8132dc6a2c73 braney Tue Nov 24 14:20:10 2015 -0800 support htslib for sam/bam/cram/tabix support #14717 diff --git src/hg/hgc/bamClick.c src/hg/hgc/bamClick.c index 0da7544..4469692 100644 --- src/hg/hgc/bamClick.c +++ src/hg/hgc/bamClick.c @@ -121,31 +121,35 @@ int start = min(leftCore->pos, rightCore->pos); int end = max(leftCore->pos+leftLength, rightCore->pos+rightLength); char *itemName = bam1_qname(leftBam); printf("Paired read name: %s
\n", itemName); printPosOnChrom(seqName, start, end, NULL, FALSE, itemName); puts("

"); } showOverlap(leftBam, rightBam); printf("

Left end read

\n"); singleBamDetails(leftBam); printf("

Right end read

\n"); singleBamDetails(rightBam); printf("
\n"); } +#ifdef USE_HTS +static int oneBam(const bam1_t *bam, void *data, bam_hdr_t *header) +#else static int oneBam(const bam1_t *bam, void *data) +#endif /* This is called on each record retrieved from a .bam file. */ { const bam1_core_t *core = &bam->core; if (core->flag & BAM_FUNMAP) return 0; struct bamTrackData *btd = (struct bamTrackData *)data; if (sameString(bam1_qname(bam), btd->itemName)) { if (btd->pairHash == NULL || (core->flag & BAM_FPAIRED) == 0) { if (core->pos == btd->itemStart) { printf("Read name: %s
\n", btd->itemName); singleBamDetails(bam); }