94c543bda6d443f13e30332161a0e4081afcb52e max Thu Dec 8 11:44:58 2011 -0800 added target=blank to outlinks in t2g diff --git src/hg/hgc/t2g.c src/hg/hgc/t2g.c index 8c7a0c5..aca4595 100644 --- src/hg/hgc/t2g.c +++ src/hg/hgc/t2g.c @@ -1,294 +1,294 @@ /* t2g.c - display details of text2genome literature track (t2gxxx tables) */ #include "common.h" #include "jksql.h" #include "hdb.h" #include "hgc.h" #include "hgColors.h" #include "trackDb.h" #include "web.h" #include "hash.h" #include "obscure.h" //include "hgTrackUi.h" // cgi var to activate debug output int t2gDebug = 0; char* sequenceTable; char* articleTable; char* printArticleInfo(struct sqlConnection *conn, char* item) /* Header with information about paper, return documentId */ { char query[512]; safef(query, sizeof(query), "SELECT articleId, url, title, authors, citation, abstract FROM %s WHERE displayId='%s'", articleTable, item); struct sqlResult *sr = sqlGetResult(conn, query); char **row; char *docId=0; if ((row = sqlNextRow(sr)) != NULL) { char* abstract = row[5]; if (strlen(abstract)==0) { abstract = "(No abstract found for this article. Please use the link to the fulltext above.)"; } docId = cloneString(row[0]); printf("
%s
\n", row[3]); - printf("%s\n", row[1], row[2]); + printf("%s\n", row[1], row[2]); printf("%s
\n", row[4]); printf("%s
\n", abstract); } sqlFreeResult(&sr); return docId; } struct hash* getSeqIdHash(struct sqlConnection* conn, char* trackTable, char* docId, char *item, char* seqName, int start) { char query[512]; /* check first if the column exists (some debugging tables on hgwdev don't have seqIds) */ safef(query, sizeof(query), "SHOW COLUMNS FROM %s LIKE 'seqIds';", trackTable); char* seqIdPresent = sqlQuickString(conn, query); if (!seqIdPresent) { return NULL; } /* get sequence-Ids for feature that was clicked (item&startPos are unique) and return as hash */ safef(query, sizeof(query), "SELECT seqIds,'' FROM %s WHERE name='%s' " "and chrom='%s' and chromStart=%d", trackTable, item, seqName, start); if (t2gDebug) puts(query); char* seqIdCoordString = sqlQuickString(conn, query); char* seqIdCoords[1024]; int partCount = chopString(seqIdCoordString, ",", seqIdCoords, ArraySize(seqIdCoords)); int i; struct hash *seqIdHash = NULL; seqIdHash = newHash(0); for (i=0; iArticle file | \n"); puts("Sequence (in bold) with flanking text | \n"); if (t2gDebug) puts("Identifiers | \n"); if (!isClickedSection && !t2gDebug) puts("Matches | \n"); puts("|
---|---|---|---|---|
%s\n", fileDesc); //printf(" | %s | \n", snippet); printf("%s | \n", snippet); if (t2gDebug) { printf("article %s, file %s, seq %s, annotId %s", artId, fileId, seqId, annotId); } // print links to locations if (!isClickedSection && !t2gDebug) { struct slName *locs; // format: hg19/chr1:300-400,mm9/chr1:60006-23234 // split on "," then split on "/" locs = charSepToSlNames(locList, ','); printf(" | ");
if (locs==NULL)
printf("No matches");
for ( ; locs!=NULL; locs = locs->next)
{
char* locString = locs->name;
char* parts[2];
int partCount;
partCount = chopString(locString, "/", parts, ArraySize(parts));
assert(partCount==2);
char* db = parts[0];
char* pos = parts[1];
printf("%s (%s)", cartSidUrlString(cart), db, pos, pos, db);
printf(" "); } printf(" | \n");
}
printf("