bdea957e48a8a725b3d1d2b981067b3f3d71d45b
chinhli
Fri Jan 27 10:13:51 2012 -0800
redmine #6725 redirect URLs to new CloneDB (from Clone Registry)
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 9d89743..d7fb4af 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -276,31 +276,31 @@
char *chrom;
int left;
int right;
char *rnaName;
};
/* See this NCBI web doc for more info about entrezFormat:
* http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html */
char *entrezFormat = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=%s&term=%s&doptcmdl=%s&tool=genome.ucsc.edu";
char *entrezPureSearchFormat = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=PureSearch&db=%s&details_term=%s[%s] ";
char *entrezUidFormat = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=%s&list_uids=%d&dopt=%s&tool=genome.ucsc.edu";
/* db=unists is not mentioned in NCBI's doc... so stick with this usage: */
char *unistsnameScript = "http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?db=unists";
char *unistsScript = "http://www.ncbi.nlm.nih.gov/genome/sts/sts.cgi?uid=";
char *gdbScript = "http://www.gdb.org/gdb-bin/genera/accno?accessionNum=";
-char *cloneRegScript = "http://www.ncbi.nlm.nih.gov/genome/clone/clname.cgi?stype=Name&list=";
+char *cloneDbScript = "http://www.ncbi.nlm.nih.gov//clone?term=";
char *traceScript = "http://www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=retrieve&val=";
char *genMapDbScript = "http://genomics.med.upenn.edu/perl/genmapdb/byclonesearch.pl?clone=";
char *uniprotFormat = "http://www.uniprot.org/uniprot/%s";
/* variables for gv tables */
char *gvPrevCat = NULL;
char *gvPrevType = NULL;
/* initialized by getCtList() if necessary: */
struct customTrack *theCtList = NULL;
/* getDNA stuff actually works when the database doesn't exist! */
boolean dbIsFound = FALSE;
/* was cartHtmlStart done? */
@@ -431,34 +431,34 @@
static void printUnistsUrl(FILE *f, int id)
/* Print URL for UniSTS record for an id. */
{
fprintf(f, "\"%s%d\"", unistsScript, id);
}
/* Print URL for GDB browser for an id
* GDB currently inoperative, so have temporarily disabled this function
*
static void printGdbUrl(FILE *f, char *id)
{
fprintf(f, "%s", id);
}
*/
-static void printCloneRegUrl(FILE *f, char *clone)
+static void printCloneDbUrl(FILE *f, char *clone)
/* Print URL for Clone Registry at NCBI for a clone */
{
-fprintf(f, "\"%s%s\"", cloneRegScript, clone);
+fprintf(f, "\"%s%s\"", cloneDbScript, clone);
}
static void printTraceUrl(FILE *f, char *idType, char *name)
/* Print URL for Trace Archive at NCBI for an identifier specified by type */
{
fprintf(f, "\"%s%s%%3D%%27%s%%27\"", traceScript, idType, name);
}
static void printGenMapDbUrl(FILE *f, char *clone)
/* Print URL for GenMapDb at UPenn for a clone */
{
fprintf(f, "\"%s%s\"", genMapDbScript, clone);
}
static void printFlyBaseUrl(FILE *f, char *fbId)
@@ -14323,31 +14323,31 @@
cartWebStart(cart, database, "%s", clone);
/* Find the instance of the object in the bed table */
sprintf(query, "SELECT * FROM fishClones WHERE name = '%s' "
"AND chrom = '%s' AND chromStart = %d "
"AND chromEnd = %d",
clone, seqName, start, end);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
fc = fishClonesLoad(row);
/* Print out general sequence positional information */
printf("
\n", clone);
htmlHorizontalLine();
printf("\n");
printf("Chromosome: | %s |
\n", seqName);
printf("Start: | %d |
\n",start+1);
printf("End: | %d |
\n",end);
printBand(seqName, start, end, TRUE);
printf("
\n");
htmlHorizontalLine();
/* Print out information about the clone */
printf("Placement of %s on draft sequence was determined using the location of %s
\n",
clone, fc->placeType);
printf("\n");
if (fc->accCount > 0)
@@ -15620,92 +15620,92 @@
}
void doCnpLocke(struct trackDb *tdb, char *itemName)
{
char *table = tdb->table;
struct cnpLocke thisItem;
struct sqlConnection *conn = hAllocConn(database);
struct sqlResult *sr;
char **row;
char query[256];
int rowOffset = hOffsetPastBin(database, seqName, table);
int start = cartInt(cart, "o");
genericHeader(tdb, itemName);
printf("NCBI Clone Registry: %s
\n", itemName);
safef(query, sizeof(query),
"select * from %s where chrom = '%s' and "
"chromStart=%d and name = '%s'", table, seqName, start, itemName);
sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
cnpLockeStaticLoad(row+rowOffset, &thisItem);
bedPrintPos((struct bed *)&thisItem, 3, tdb);
printf("
Variation Type: %s\n",thisItem.variationType);
}
printTrackHtml(tdb);
sqlFreeResult(&sr);
hFreeConn(&conn);
}
void doCnpIafrate(struct trackDb *tdb, char *itemName)
{
char *table = tdb->table;
struct cnpIafrate cnpIafrate;
struct sqlConnection *conn = hAllocConn(database);
struct sqlResult *sr;
char **row;
char query[256];
int rowOffset = hOffsetPastBin(database, seqName, table);
int start = cartInt(cart, "o");
genericHeader(tdb, itemName);
printf("NCBI Clone Registry: %s
\n", itemName);
safef(query, sizeof(query),
"select * from %s where chrom = '%s' and "
"chromStart=%d and name = '%s'", table, seqName, start, itemName);
sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
cnpIafrateStaticLoad(row+rowOffset, &cnpIafrate);
bedPrintPos((struct bed *)&cnpIafrate, 3, tdb);
printf("
Variation Type: %s\n",cnpIafrate.variationType);
printf("
Score: %g\n",cnpIafrate.score);
}
printTrackHtml(tdb);
sqlFreeResult(&sr);
hFreeConn(&conn);
}
void doCnpIafrate2(struct trackDb *tdb, char *itemName)
{
char *table = tdb->table;
struct cnpIafrate2 thisItem;
struct sqlConnection *conn = hAllocConn(database);
struct sqlResult *sr;
char **row;
char query[256];
int rowOffset = hOffsetPastBin(database, seqName, table);
int start = cartInt(cart, "o");
genericHeader(tdb, itemName);
printf("NCBI Clone Registry: %s
\n", itemName);
safef(query, sizeof(query),
"select * from %s where chrom = '%s' and "
"chromStart=%d and name = '%s'", table, seqName, start, itemName);
sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
cnpIafrate2StaticLoad(row+rowOffset, &thisItem);
bedPrintPos((struct bed *)&thisItem, 3, tdb);
printf("
Cohort Type: %s\n",thisItem.cohortType);
if (strstr(thisItem.cohortType, "Control"))
{
printf("
Control Gain Count: %d\n",thisItem.normalGain);
printf("
Control Loss Count: %d\n",thisItem.normalLoss);
}
@@ -15932,31 +15932,31 @@
char query[256];
int rowOffset = hOffsetPastBin(database, seqName, table);
int start = cartInt(cart, "o");
char variantSignal;
char *itemCopy = cloneString(itemName);
variantSignal = lastChar(itemName);
if (variantSignal == '*')
stripChar(itemCopy, '*');
if (variantSignal == '?')
stripChar(itemCopy, '?');
if (variantSignal == '#')
stripChar(itemCopy, '#');
genericHeader(tdb, itemCopy);
printf("NCBI Clone Registry: %s
\n", itemCopy);
if (variantSignal == '*' || variantSignal == '?' || variantSignal == '#')
printf("Note this BAC was found to be variant. See references.
\n");
safef(query, sizeof(query),
"select * from %s where chrom = '%s' and "
"chromStart=%d and name = '%s'", table, seqName, start, itemName);
sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
cnpSharpStaticLoad(row+rowOffset, &cnpSharp);
bedPrintPos((struct bed *)&cnpSharp, 3, tdb);
printCnpSharpDetails(cnpSharp);
}
sqlFreeResult(&sr);
hFreeConn(&conn);
@@ -15966,31 +15966,31 @@
void doCnpSharp2(struct trackDb *tdb, char *itemName)
{
char *table = tdb->table;
struct cnpSharp2 cnpSharp2;
struct sqlConnection *conn = hAllocConn(database);
struct sqlResult *sr;
char **row;
char query[256];
int rowOffset = hOffsetPastBin(database, seqName, table);
int start = cartInt(cart, "o");
genericHeader(tdb, itemName);
printf("NCBI Clone Registry: %s
\n", itemName);
safef(query, sizeof(query),
"select * from %s where chrom = '%s' and "
"chromStart=%d and name = '%s'", table, seqName, start, itemName);
sr = sqlGetResult(conn, query);
while ((row = sqlNextRow(sr)) != NULL)
{
cnpSharp2StaticLoad(row+rowOffset, &cnpSharp2);
bedPrintPos((struct bed *)&cnpSharp2, 3, tdb);
printf("Name: %s
\n", cnpSharp2.name);
printf("Variation type: %s
\n", cnpSharp2.variationType);
}
sqlFreeResult(&sr);
hFreeConn(&conn);
// printCnpSharpSampleData(itemName);
@@ -18264,60 +18264,60 @@
if (row != NULL)
{
lfs = lfsLoad(row+hasBin);
if (sameString("bacEndPairs", track) || sameString("bacEndSingles", track))
{
if (sameString("Zebrafish", organism) )
{
/* query to bacCloneXRef table to get Genbank accession */
/* and internal Sanger name for clones */
sprintf(query, "SELECT genbank, intName FROM bacCloneXRef WHERE name = '%s'", clone);
srb = sqlMustGetResult(conn1, query);
rowb = sqlNextRow(srb);
if (rowb != NULL)
{
printf("\n", clone);
if (rowb[0] != NULL)
{
printf("Genbank Accession: %s
\n", rowb[0]);
}
else
printf("Genbank Accession: n/a");
intName = cloneString(rowb[1]);
}
else
printf("%s
\n", clone);
}
else if (sameString("Dog", organism) ||
sameString("Zebra finch", organism))
{
printf("\n", clone);
}
else if (trackDbSetting(tdb, "notNCBI"))
{
printf("%s
\n", clone);
}
else
{
printf("\n", clone);
}
}
else
{
printf("%s\n", clone);
}
/*printf("%s - %s
\n", type, clone);*/
printf("
\n\n");
printf("Chromosome: | %s |
\n",seqName);
printf("Start: | %d |
\n",start+1);
printf("End: | %d |
\n",end);
printf("Length: | %d |
\n",length);
printf("Strand: | %s |
\n", lfs->strand);
printf("Score: | %d |
\n", lfs->score);