5ca365292fb3146d6589273132b0c94674c51dc8
max
Tue Mar 27 12:05:37 2012 -0700
handling case of transmapped protein alignments
diff --git src/hg/hgc/pubs.c src/hg/hgc/pubs.c
index 5dca585..c7cca09 100644
--- src/hg/hgc/pubs.c
+++ src/hg/hgc/pubs.c
@@ -324,60 +324,60 @@
c++;
i++;
}
}
}
void printHgTracksLink(char* db, char* chrom, int start, int end, char* linkText, char* optUrlStr)
/* print link to hgTracks for db at pos */
{
char buf[1024];
if (linkText==NULL)
{
char startBuf[64], endBuf[64];
sprintLongWithCommas(startBuf, start + 1);
sprintLongWithCommas(endBuf, end);
- safef(buf, sizeof(buf), "%s:%s-%s (%s)", seqName, startBuf, endBuf, db);
+ safef(buf, sizeof(buf), "%s:%s-%s (%s)", chrom, startBuf, endBuf, db);
linkText = buf;
}
if (optUrlStr==NULL)
optUrlStr = "";
-printf("%s\n", hgTracksPathAndSettings(), db, start, end, optUrlStr, linkText);
+printf("%s\n", hgTracksPathAndSettings(), db, chrom, start, end, optUrlStr, linkText);
}
void printGbLinks(struct slName* locs)
/* print hash keys in format hg19/chr1:1-1000 as links */
{
struct slName *el;
for (el = locs; el != NULL; el = el->next)
{
char* locString = el->name;
char* db = cloneNextWordByDelimiter(&locString, '/');
char* chrom = cloneNextWordByDelimiter(&locString, ':');
char* startStr = cloneNextWordByDelimiter(&locString, '-');
- char* endStr = locString;
+ char* endStr = cloneString(locString);
int start = atoi(startStr);
int end = atoi(endStr);
printHgTracksLink(db, chrom, start, end, NULL, NULL);
printf("
");
- //freeMem(endStr); //XX why can't I free these?
- //freeMem(chrom);
- //freeMem(startStr);
- //freeMem(db);
+ freeMem(endStr); //XX why can't I free these?
+ freeMem(chrom);
+ freeMem(startStr);
+ freeMem(db);
}
}
static bool printSeqSection(char* articleId, char* title, bool showDesc, struct sqlConnection* conn, struct hash* clickedSeqs, bool isClickedSection, bool fasta, char* pslTable)
/* print a table of sequences, show only sequences with IDs in hash,
* There are two sections, respective sequences are shown depending on isClickedSection and clickedSeqs
* - seqs that were clicked on (isClickedSection=True) -> show only seqs in clickedSeqs
* - other seqs (isClickedSection=False) -> show all other seqs
*
* */
{
// get data from mysql
char query[4096];
safef(query, sizeof(query),
"SELECT fileDesc, snippet, locations, articleId, fileId, seqId, sequence "
@@ -589,42 +589,53 @@
}
void pubsAli(struct sqlConnection *conn, char *pslTable, char *seqTable, char *item)
/* this is just a ripoff from htcCdnaAli, similar to markd's transMapAli */
{
bioSeq *oSeq = NULL;
writeFramesetType();
puts("");
printf("