src/hg/hgc/bigBedClick.c 1.5
1.5 2009/05/28 16:49:28 mikep
show seq1,seq2 columns (non-standard bed cols 7+8) for pairedTagAlign. This is not very nice way to deal with it, asking Jim for other suggestion.
Index: src/hg/hgc/bigBedClick.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgc/bigBedClick.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -B -U 4 -r1.4 -r1.5
--- src/hg/hgc/bigBedClick.c 28 May 2009 15:30:40 -0000 1.4
+++ src/hg/hgc/bigBedClick.c 28 May 2009 16:49:28 -0000 1.5
@@ -6,8 +6,9 @@
#include "hgc.h"
#include "hCommon.h"
#include "hgColors.h"
#include "bigBed.h"
+#include "hui.h"
static char const rcsid[] = "$Id$";
@@ -52,20 +53,28 @@
}
if (bbMatch != NULL)
{
- char *fields[bedSize];
+ int extraFields = 0;
+ // check for seq1 and seq2 in columns 7+8 (eg, pairedTagAlign)
+ char *setting = trackDbSetting(tdb, BASE_COLOR_USE_SEQUENCE);
+ if (bedSize == 6 && setting && sameString(setting, "seq1Seq2"))
+ extraFields = 2;
+ char *fields[bedSize+extraFields];
char startBuf[16], endBuf[16];
char *rest = cloneString(bbMatch->rest);
- int bbFieldCount = bigBedIntervalToRow(bbMatch, chrom, startBuf, endBuf, fields, bedSize);
- if (bbFieldCount != bedSize)
+ int bbFieldCount = bigBedIntervalToRow(bbMatch, chrom, startBuf, endBuf, fields, bedSize+extraFields);
+ if (bbFieldCount != bedSize+extraFields)
{
errAbort("Disagreement between trackDb field count (%d) and %s fieldCount (%d)",
bedSize, fileName, bbFieldCount);
}
struct bed *bed = bedLoadN(fields, bedSize);
bedPrintPos(bed, bedSize, tdb);
- if (bedSize > 6) // we have more fields to print
+ // display seq1 and seq2
+ if (bedSize+extraFields == 8 && setting && sameString(setting, "seq1Seq2"))
+ printf("<table><tr><th>Sequence 1</th><th>Sequence 2</th></tr><tr><td> %s </td><td> %s </td></tr></table>", fields[6], fields[7]);
+ else if (bedSize+extraFields > 6) // we have more fields to print
printf("Full bed record:<BR><PRE><TT>%s\t%u\t%u\t%s\n</TT></PRE>\n",
chrom, bb->start, bb->end, rest);
}
else