dbb7cbfd254794919a8e491cc3d3eb7c6009ba15
angie
Tue Jan 25 14:58:05 2011 -0800
Track #1684 (SNPs 132 (dbSNP)): Added new coloring and filtering optionsfor new columns exceptions and bitfields. Fixed remaining hardcoded cart
var names to use track name, keeping backwards compat with old sessions.
Lots of refactoring -- got rid of snp125Extended business (mostly so I
wouldn't have to make a snp132Extended); color is stored in snp->weight
now, and extraName stuff overwrites name. Added new color-sorting in
squish mode so the most interesting SNPs appear at the top. Also added
new trackDb var defaultMaxWeight for the NonUnique subset (so its items
aren't invisible by default).
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 7ab75ea..2fa465f 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -15458,31 +15458,31 @@
query[0] = '\0';
if (sameString(geneTable, "knownGene"))
safef(query, sizeof(query), "select geneSymbol from kgXref where kgID = '%s'", geneId);
else if (sameString(geneTable, "refGene"))
safef(query, sizeof(query), "select name from refLink where mrnaAcc = '%s'", geneId);
sym = sqlQuickQuery(conn, query, buf, sizeof(buf)-1);
hFreeConn(&conn);
}
if (sym != NULL)
dyStringPrintf(dy, "%s (%s)", sym, geneId);
else
dyStringAppend(dy, geneId);
return dyStringCannibalize(&dy);
}
-#define firstTwoColumnsPctS "
%s | %s | "
+#define firstTwoColumnsPctS " |
%s | %s | "
void getSnp125RefCodonAndSnpPos(struct snp125 *snp, struct genePred *gene, int exonIx,
int *pSnpCodonPos, char refCodon[4], char *pRefAA)
/* Given a single-base snp and a coding gene/exon containing it, determine the snp's position
* in the codon and the reference codon & amino acid. */
{
boolean geneIsRc = sameString(gene->strand, "-");
int snpStart = snp->chromStart, snpEnd = snp->chromEnd;
int exonStart = gene->exonStarts[exonIx], exonEnd = gene->exonEnds[exonIx];
int cdsStart = gene->cdsStart, cdsEnd = gene->cdsEnd;
int exonFrame = gene->exonFrames[exonIx];
if (exonFrame == -1)
exonFrame = 0;
if (cdsEnd < exonEnd) exonEnd = cdsEnd;
if (cdsStart > exonStart) exonStart = cdsStart;
@@ -15673,31 +15673,31 @@
"where chrom = '%s' and txStart < %d and txEnd > %d",
geneTable, snp->chrom, snpEnd + maxDistance, snpEnd);
sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
char *gene = row[0];
int start = sqlUnsigned(row[1]);
char *strand = row[2];
printf(firstTwoColumnsPctS "%d bases %sstream |
\n",
geneTable, gene, (start - snpEnd + 1),
(strand[0] == '-' ? "down" : "up"));
nearCount++;
}
sqlFreeResult(&sr);
if (nearCount == 0)
- printf("%s | | intergenic |
", geneTrack);
+ printf("%s | | intergenic |
", geneTrack);
}
static struct genePred *getGPsWithFrames(struct sqlConnection *conn, char *geneTable,
char *chrom, int start, int end)
/* Given a known-to-exist genePred table name and a range, return
* genePreds in range with exonFrames populated. */
{
struct genePred *gpList = NULL;
boolean hasBin;
struct sqlResult *sr = hRangeQuery(conn, geneTable, chrom, start, end, NULL, &hasBin);
struct sqlConnection *conn2 = hAllocConn(database);
boolean hasFrames = (sqlFieldIndex(conn2, geneTable, "exonFrames") == hasBin + 14);
char **row;
while ((row = sqlNextRow(sr)) != NULL)
{