2797186e7d69a8b79b92e30118bed55548f04caf hiram Thu Feb 8 14:39:16 2018 -0800 adding externalId column to ncbiRefSeqLink table refs #20215 diff --git src/hg/lib/ncbiRefSeqLink.c src/hg/lib/ncbiRefSeqLink.c index 36a8f16..8828ef8 100644 --- src/hg/lib/ncbiRefSeqLink.c +++ src/hg/lib/ncbiRefSeqLink.c @@ -1,254 +1,262 @@ /* ncbiRefSeqLink.c was originally generated by the autoSql program, which also * generated ncbiRefSeqLink.h and ncbiRefSeqLink.sql. This module links the database and * the RAM representation of objects. */ #include "common.h" #include "linefile.h" #include "dystring.h" #include "jksql.h" #include "ncbiRefSeqLink.h" -char *ncbiRefSeqLinkCommaSepFieldNames = "id,status,name,product,mrnaAcc,protAcc,locusLinkId,omimId,hgnc,genbank,pseudo,gbkey,source,gene_biotype,gene_synonym,ncrna_class,note,description"; +char *ncbiRefSeqLinkCommaSepFieldNames = "id,status,name,product,mrnaAcc,protAcc,locusLinkId,omimId,hgnc,genbank,pseudo,gbkey,source,gene_biotype,gene_synonym,ncrna_class,note,description,externalId"; void ncbiRefSeqLinkStaticLoad(char **row, struct ncbiRefSeqLink *ret) /* Load a row from ncbiRefSeqLink table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->id = row[0]; ret->status = row[1]; ret->name = row[2]; ret->product = row[3]; ret->mrnaAcc = row[4]; ret->protAcc = row[5]; ret->locusLinkId = row[6]; ret->omimId = row[7]; ret->hgnc = row[8]; ret->genbank = row[9]; ret->pseudo = row[10]; ret->gbkey = row[11]; ret->source = row[12]; ret->gene_biotype = row[13]; ret->gene_synonym = row[14]; ret->ncrna_class = row[15]; ret->note = row[16]; ret->description = row[17]; +ret->externalId = row[18]; } struct ncbiRefSeqLink *ncbiRefSeqLinkLoad(char **row) /* Load a ncbiRefSeqLink from row fetched with select * from ncbiRefSeqLink * from database. Dispose of this with ncbiRefSeqLinkFree(). */ { struct ncbiRefSeqLink *ret; AllocVar(ret); ret->id = cloneString(row[0]); ret->status = cloneString(row[1]); ret->name = cloneString(row[2]); ret->product = cloneString(row[3]); ret->mrnaAcc = cloneString(row[4]); ret->protAcc = cloneString(row[5]); ret->locusLinkId = cloneString(row[6]); ret->omimId = cloneString(row[7]); ret->hgnc = cloneString(row[8]); ret->genbank = cloneString(row[9]); ret->pseudo = cloneString(row[10]); ret->gbkey = cloneString(row[11]); ret->source = cloneString(row[12]); ret->gene_biotype = cloneString(row[13]); ret->gene_synonym = cloneString(row[14]); ret->ncrna_class = cloneString(row[15]); ret->note = cloneString(row[16]); ret->description = cloneString(row[17]); +ret->externalId = cloneString(row[18]); return ret; } struct ncbiRefSeqLink *ncbiRefSeqLinkLoadAll(char *fileName) /* Load all ncbiRefSeqLink from a whitespace-separated file. * Dispose of this with ncbiRefSeqLinkFreeList(). */ { struct ncbiRefSeqLink *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); -char *row[18]; +char *row[19]; while (lineFileRow(lf, row)) { el = ncbiRefSeqLinkLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; } struct ncbiRefSeqLink *ncbiRefSeqLinkLoadAllByChar(char *fileName, char chopper) /* Load all ncbiRefSeqLink from a chopper separated file. * Dispose of this with ncbiRefSeqLinkFreeList(). */ { struct ncbiRefSeqLink *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); -char *row[18]; +char *row[19]; while (lineFileNextCharRow(lf, chopper, row, ArraySize(row))) { el = ncbiRefSeqLinkLoad(row); slAddHead(&list, el); } lineFileClose(&lf); slReverse(&list); return list; } struct ncbiRefSeqLink *ncbiRefSeqLinkCommaIn(char **pS, struct ncbiRefSeqLink *ret) /* Create a ncbiRefSeqLink out of a comma separated string. * This will fill in ret if non-null, otherwise will * return a new ncbiRefSeqLink */ { char *s = *pS; if (ret == NULL) AllocVar(ret); ret->id = sqlStringComma(&s); ret->status = sqlStringComma(&s); ret->name = sqlStringComma(&s); ret->product = sqlStringComma(&s); ret->mrnaAcc = sqlStringComma(&s); ret->protAcc = sqlStringComma(&s); ret->locusLinkId = sqlStringComma(&s); ret->omimId = sqlStringComma(&s); ret->hgnc = sqlStringComma(&s); ret->genbank = sqlStringComma(&s); ret->pseudo = sqlStringComma(&s); ret->gbkey = sqlStringComma(&s); ret->source = sqlStringComma(&s); ret->gene_biotype = sqlStringComma(&s); ret->gene_synonym = sqlStringComma(&s); ret->ncrna_class = sqlStringComma(&s); ret->note = sqlStringComma(&s); ret->description = sqlStringComma(&s); +ret->externalId = sqlStringComma(&s); *pS = s; return ret; } void ncbiRefSeqLinkFree(struct ncbiRefSeqLink **pEl) /* Free a single dynamically allocated ncbiRefSeqLink such as created * with ncbiRefSeqLinkLoad(). */ { struct ncbiRefSeqLink *el; if ((el = *pEl) == NULL) return; freeMem(el->id); freeMem(el->status); freeMem(el->name); freeMem(el->product); freeMem(el->mrnaAcc); freeMem(el->protAcc); freeMem(el->locusLinkId); freeMem(el->omimId); freeMem(el->hgnc); freeMem(el->genbank); freeMem(el->pseudo); freeMem(el->gbkey); freeMem(el->source); freeMem(el->gene_biotype); freeMem(el->gene_synonym); freeMem(el->ncrna_class); freeMem(el->note); freeMem(el->description); +freeMem(el->externalId); freez(pEl); } void ncbiRefSeqLinkFreeList(struct ncbiRefSeqLink **pList) /* Free a list of dynamically allocated ncbiRefSeqLink's */ { struct ncbiRefSeqLink *el, *next; for (el = *pList; el != NULL; el = next) { next = el->next; ncbiRefSeqLinkFree(&el); } *pList = NULL; } void ncbiRefSeqLinkOutput(struct ncbiRefSeqLink *el, FILE *f, char sep, char lastSep) /* Print out ncbiRefSeqLink. Separate fields with sep. Follow last field with lastSep. */ { if (sep == ',') fputc('"',f); fprintf(f, "%s", el->id); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->status); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->name); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->product); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->mrnaAcc); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->protAcc); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->locusLinkId); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->omimId); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->hgnc); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->genbank); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->pseudo); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->gbkey); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->source); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->gene_biotype); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->gene_synonym); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->ncrna_class); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->note); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->description); if (sep == ',') fputc('"',f); +fputc(sep,f); +if (sep == ',') fputc('"',f); +fprintf(f, "%s", el->externalId); +if (sep == ',') fputc('"',f); fputc(lastSep,f); } /* -------------------------------- End autoSql Generated Code -------------------------------- */