fcda64e213150b3bd0ade930139e2893e1da42a4 braney Tue Aug 4 12:09:19 2015 -0700 first cut at bigPsl support in the browser. #14241 diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c index 9f280a3..80f10f1 100644 --- src/hg/hgTracks/bigBedTrack.c +++ src/hg/hgTracks/bigBedTrack.c @@ -11,30 +11,31 @@ #include "jksql.h" #include "hdb.h" #include "bedCart.h" #include "hgTracks.h" #include "hmmstats.h" #include "localmem.h" #include "wigCommon.h" #include "bbiFile.h" #include "obscure.h" #include "bigWig.h" #include "bigBed.h" #include "bigWarn.h" #include "errCatch.h" #include "trackHub.h" #include "net.h" +#include "bigPsl.h" struct bbiFile *fetchBbiForTrack(struct track *track) /* Fetch bbiFile from track, opening it if it is not already open. */ { struct bbiFile *bbi = track->bbiFile; if (bbi == NULL) { char *fileName = NULL; if (track->parallelLoading) // do not use mysql during parallel fetch { fileName = cloneString(trackDbSetting(track->tdb, "bigDataUrl")); } else { struct sqlConnection *conn = NULL; @@ -164,30 +165,37 @@ int mouseOverIdx = bbExtraFieldIndex(tdb, mouseOverField); for (bb = bbList; bb != NULL; bb = bb->next) { char* mouseOver = restField(bb, mouseOverIdx); bigBedIntervalToRow(bb, chromName, startBuf, endBuf, bedRow, ArraySize(bedRow)); struct bed *bed = bedLoadN(bedRow, fieldCount); struct linkedFeatures *lf = bedMungToLinkedFeatures(&bed, tdb, fieldCount, scoreMin, scoreMax, useItemRgb); if (scoreFilter == NULL || lf->score >= minScore) slAddHead(pLfList, lf); lf->mouseOver = mouseOver; // leaks some memory, cloneString handles NULL ifself if (sameString(track->tdb->type, "bigGenePred")) lf->original = genePredFromBigGenePred(chromName, bb); + else if (sameString(track->tdb->type, "bigPsl")) + { + char *seq, *cds; + lf->original = pslFromBigPsl(chromName, bb, seqBaseCount, &seq, &cds); + lf->extra = seq; + lf->cds = cds; + } } lmCleanup(&lm); } boolean canDrawBigBedDense(struct track *tg) /* Return TRUE if conditions are such that can do the fast bigBed dense data fetch and * draw. */ { return tg->isBigBed; } void bigBedDrawDense(struct track *tg, int seqStart, int seqEnd, struct hvGfx *hvg, int xOff, int yOff, int width,